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 |
|---|---|---|---|---|---|---|
dundi_encrypt(struct dundi_transaction *trans, struct dundi_packet *pack)
{
unsigned char *compress_space;
int len;
int res;
unsigned long bytes;
struct dundi_ie_data ied;
struct dundi_peer *peer;
unsigned char iv[16];
len = pack->datalen + pack->datalen / 100 + 42;
compress_space = ast_alloca(len);
memset(co... | true | true | false | false | false | 1 |
get_box_y_range (PLOTGROUP *grp, double gyrange,
double *ymin, double *ymax)
{
if (grp->gmin >= 0 && grp->gmin < 0.05 &&
grp->gmax <= 1 && grp->gmax > 0.95) {
/* proportions? */
*ymin = 0.0;
*ymax = 1.0;
} else {
*ymin = grp->gmin - 0.04 * gyrange;
*ymax = grp->gmax + 0.04 * gyrange;
}
} | false | false | false | false | false | 0 |
lineeditor_input_decoder_setup
___P((lineeditor_input_decoder *decoder),
(decoder)
lineeditor_input_decoder *decoder;)
{
#define LINEEDITOR_INPUT_DECODER_INITIAL_BUFFER_SIZE 150
int n = LINEEDITOR_INPUT_DECODER_INITIAL_BUFFER_SIZE;
decoder->buffer = ___CAST(lineeditor_input_test*,
... | false | false | false | false | false | 0 |
dgap_tty_digisetedelay(struct channel_t *ch, struct board_t *bd,
struct un_t *un, int __user *new_info)
{
int new_digi;
ulong lock_flags;
ulong lock_flags2;
if (copy_from_user(&new_digi, new_info, sizeof(int)))
return -EFAULT;
spin_lock_irqsave(&bd->bd_lock, lock_flags);
spin_lock_irqsave(&ch->ch_lock, ... | false | false | false | false | false | 0 |
SetBreakPoint(Handle<DebugInfo> debug_info,
int code_position,
int source_position,
int statement_position,
Handle<Object> break_point_object) {
Handle<Object> break_point_info(debug_info->GetBreakP... | false | false | false | false | false | 0 |
btusb_setup_qca(struct hci_dev *hdev)
{
const struct qca_device_info *info = NULL;
struct qca_version ver;
u32 ver_rom;
u8 status;
int i, err;
err = btusb_qca_send_vendor_req(hdev, QCA_GET_TARGET_VERSION, &ver,
sizeof(ver));
if (err < 0)
return err;
ver_rom = le32_to_cpu(ver.rom_version);
for (i = 0; ... | false | false | false | false | false | 0 |
print_word(FILE *file, struct diff_words_buffer *buffer, int len, int color,
int suppress_newline)
{
const char *ptr;
int eol = 0;
if (len == 0)
return;
ptr = buffer->text.ptr + buffer->current;
buffer->current += len;
if (ptr[len - 1] == '\n') {
eol = 1;
len--;
}
fputs(diff_get_color(1, color), fi... | false | false | false | false | false | 0 |
budb_dissect_DbHeader(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *parent_tree, dcerpc_info *di _U_, guint8 *drep _U_, int hf_index, guint32 param _U_)
{
proto_item *item=NULL;
proto_tree *tree=NULL;
int old_offset;
ALIGN_TO_4_BYTES;
old_offset=offset;
if(parent_tree){
i... | false | false | false | false | false | 0 |
eb_set_font(EB_Book *book, EB_Font_Code font_code)
{
EB_Error_Code error_code;
EB_Subbook *subbook;
eb_lock(&book->lock);
LOG(("in: eb_set_font(book=%d, font_code=%d)", (int)book->code,
(int)font_code));
/*
* Check `font_code'.
*/
if (font_code < 0 || EB_MAX_FONTS <= font_code) {
e... | false | false | false | false | false | 0 |
handleNewProperties(GLEGlobalSource* source, GLEPropertyStore* props) {
vector<GLEProperty*> changed;
GLEPropertyStoreModel* model = props->getModel();
for (int i = 0; i < model->getNumberOfProperties(); i++) {
GLEProperty* prop = model->getProperty(i);
if (!prop->isEqualToState(props)) {
prop->updateState(pr... | false | false | false | false | false | 0 |
startDrag(Qt::DropActions supportedActions)
{
QModelIndexList indexes = selectedIndexes();
for(int i = indexes.count() - 1 ; i >= 0; --i)
{
const QModelIndex &index = indexes.at(i);
if(!(index.flags() & Qt::ItemIsDragEnabled))
indexes.removeAt(i);
}
if(indexes.count() == 0)
return;
QMimeData *data = mo... | false | false | false | false | false | 0 |
gdm_xdmcp_send_accept (GdmXdmcpDisplayFactory *factory,
GdmAddress *address,
CARD32 session_id,
ARRAY8Ptr authentication_name,
ARRAY8Ptr authentication_data,
... | false | false | false | false | false | 0 |
ftp_command(char *fmt,...)
{
va_list ap ;
char cmd_string[BUFSIZ];
memset (cmd_string, 0, BUFSIZ);
if (coutput<0)
{
fprintf (FileErr,"No control connection for command\n");
return -1;
}
va_start(ap,fmt);
vsprintf(cmd_string, fmt, ap);
va_end(ap);
strcat(cmd_string,"\r\n");
SendMsg(cinput,cmd_st... | false | false | false | false | false | 0 |
RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
// get the info objects
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkInformation *outInfo = outputVector->GetInformationObject(0);
// get the input and outpu... | false | false | false | false | false | 0 |
print_tcp(struct packet *p, struct iphdr *ip, struct tcphdr *tcp)
{
fprintf(stdout, "%s [%d] seq=(%u) ack=(%u)\t--->\t%s [%d] len=%d/%d\n",
host_lookup(ip->saddr, hl_mode), ntohs(tcp->source),
(unsigned int) ntohl(tcp->seq), tcp->ack ? (unsigned int) ntohl(tcp->ack_seq) : 0,
host_lookup(... | false | false | false | false | false | 0 |
v4l2_menu(int fd, const struct v4l2_queryctrl *ctl)
{
struct STRTAB *menu;
struct v4l2_querymenu item;
int i;
menu = malloc(sizeof(struct STRTAB) * (ctl->maximum-ctl->minimum+2));
for (i = ctl->minimum; i <= ctl->maximum; i++) {
item.id = ctl->id;
item.index = i;
if (-1 == xioctl(fd, VIDIOC_QUER... | false | false | false | false | false | 0 |
OpenTable( CPLString& osCurrentSchema,
const char *pszNewName,
const char *pszSchemaName,
const char * pszGeomColumnIn,
int bUpdate,
int bTestOpen,
... | false | false | false | false | false | 0 |
orte_plm_base_select(void)
{
int exit_status = ORTE_SUCCESS;
orte_plm_base_component_t *best_component = NULL;
orte_plm_base_module_t *best_module = NULL;
/*
* Select the best component
*/
if( OPAL_SUCCESS != mca_base_select("plm", orte_plm_base_framework.framework_output,
... | false | false | false | false | false | 0 |
sh2_execute(int cycles)
{
sh2_icount = cycles;
if (sh2.cpu_off)
return 0;
do
{
UINT32 opcode;
if (sh2.delay)
{
opcode = RW(sh2.delay & AM);
change_pc32bedw(sh2.pc & AM);
sh2.pc -= 2;
}
else
opcode = RW(sh2.pc & AM);
CALL_MAME_DEBUG;
sh2.delay = 0;
sh2.pc += ... | false | false | false | false | false | 0 |
open_uri(const gchar *uri, const gchar *cmdline)
{
#ifndef G_OS_WIN32
gchar buf[BUFFSIZE];
gchar *p;
gchar encoded_uri[BUFFSIZE];
cm_return_val_if_fail(uri != NULL, -1);
/* an option to choose whether to use encode_uri or not ? */
encode_uri(encoded_uri, BUFFSIZE, uri);
if (cmdline &&
(p = strchr(cmdline... | false | false | false | false | true | 1 |
my_timer(GB_TIMER *timer,bool on)
{
if (timer->id) {
MyTimerTag *tag = (MyTimerTag *)timer->tag;
g_source_remove(timer->id);
g_timer_destroy(tag->timer);
g_free(tag);
timer->id = 0;
timer->tag = 0;
}
if (on)
{
MyTimerTag *tag = g_new(MyTimerTag, 1);
tag->timer = g_timer_new();
tag->timeout = time... | false | false | false | false | false | 0 |
wasp_unroot_obj( wasp_object obj ){
if( obj == NULL )return;
assert( obj->type );
//TODO: Assertions against rooting during garbage collection.
wasp_unpool_obj( obj );
wasp_pool_obj( obj, wasp_blacks );
} | false | false | false | false | false | 0 |
morus_initialization(const unsigned char *key, const unsigned char *iv, unsigned int state[][4])
{
int i;
unsigned int temp[4] = {0,0,0,0};
unsigned char con0[16] = {0x0,0x1,0x01,0x02,0x03,0x05,0x08,0x0d,0x15,0x22,0x37,0x59,0x90,0xe9,0x79,0x62};
unsigned char con1[16] = {0xdb, 0x3d, 0x1... | false | false | false | false | false | 0 |
batch_job_submit_cluster(struct batch_queue * q, const char *cmd, const char *args, const char *infile, const char *outfile, const char *errfile, const char *extra_input_files, const char *extra_output_files)
{
char *command = string_format("%s %s", cmd, args);
if (infile) {
char *new = string_format("%s <%s", comm... | false | false | false | false | false | 0 |
init(MachineFunction *mf,
LiveIntervalUnion *liuarray,
SlotIndexes *indexes,
LiveIntervals *lis,
const TargetRegisterInfo *tri) {
MF = mf;
LIUArray = liuarray;
TRI = tri;
reinitPhysRegEntries();
... | false | false | false | false | false | 0 |
mxf_read_primer_pack(MXFContext *mxf)
{
ByteIOContext *pb = mxf->fc->pb;
int item_num = get_be32(pb);
int item_len = get_be32(pb);
if (item_len != 18) {
av_log(mxf->fc, AV_LOG_ERROR, "unsupported primer pack item length\n");
return -1;
}
if (item_num > UINT_MAX / item_len)
... | false | false | false | false | false | 0 |
dBodyAddRelForceAtPos (dBodyID b, dReal fx, dReal fy, dReal fz,
dReal px, dReal py, dReal pz)
{
dAASSERT (b);
dVector3 frel,f;
frel[0] = fx;
frel[1] = fy;
frel[2] = fz;
frel[3] = 0;
dMULTIPLY0_331 (f,b->posr.R,frel);
b->facc[0] += f[0];
b->facc[1] += f[1];
b->facc[2] += f[2];
dVector3 q;
... | false | false | false | false | false | 0 |
AddCosetFactor2 (
Int factor )
{
Obj * ptFac; /* pointer to the factor */
Obj * ptWord; /* pointer to the word */
Int leng; /* length of the factor */
Obj sum; ... | false | false | false | false | false | 0 |
createJob(const QString& operation,
QMap<QString,QVariant>& parameters)
{
return new PlasmoidServiceJob(m_packagePath, destination(), operation, parameters, this);
} | false | false | false | false | false | 0 |
PyCodec_ReplaceErrors(PyObject *exc)
{
PyObject *restuple;
Py_ssize_t start;
Py_ssize_t end;
Py_ssize_t i;
if (PyObject_IsInstance(exc, PyExc_UnicodeEncodeError)) {
PyObject *res;
Py_UNICODE *p;
if (PyUnicodeEncodeError_GetStart(exc, &start))
return NULL;
... | false | false | false | false | false | 0 |
hfsplus_fill_cat_thread(struct super_block *sb,
hfsplus_cat_entry *entry, int type,
u32 parentid, struct qstr *str)
{
int err;
entry->type = cpu_to_be16(type);
entry->thread.reserved = 0;
entry->thread.parentID = cpu_to_be32(parentid);
err = hfsplus_asc2uni(sb, &entry->thread.nodeName, HFSPLUS_MAX_S... | false | false | false | false | false | 0 |
help(void)
{
printf(_("%s %s -- set file access control lists\n"),
progname, VERSION);
printf(_("Usage: %s %s\n"),
progname, cmd_line_spec);
printf(_(
" -m, --modify=acl modify the current ACL(s) of file(s)\n"
" -M, --modify-file=file read ACL entries to modify from file\n"
" -x, --remove=acl r... | false | false | false | false | false | 0 |
parse(const ByteVector &data)
{
if(d->header)
d->header->setData(data);
else
d->header = new Header(data);
parseFields(fieldData(data));
} | false | false | false | false | false | 0 |
pass_password_set(struct entry *ent, const char *param, const char *val)
{
struct pass_session *fts;
struct statefile *sf = (struct statefile *) av_namespace_get(ent);
struct pass_session *passd = (struct pass_session *) sf->data;
unsigned int len;
AV_LOCK(pass_lock);
fts = pass_get_session(pas... | false | false | false | false | false | 0 |
find_closest_points(vtkPolyData * points, vtkSmartPointer<vtkIdList> pointIds0, vtkSmartPointer<vtkIdList> pointIds1)
{
vtkIdType i0 = -1;
vtkIdType i1 = -1;
double minPointDistance2 = std::numeric_limits<double>::max();
int n0 = pointIds0->GetNumberOfIds();
int n1 = pointIds1->GetNumberOfIds();
for (int j0... | false | false | false | false | false | 0 |
addHandle( std::vector<std::string>available, std::string ID)
{
unsigned int i=0;
int count=0;
std::vector<std::string>id;
if(!ID.empty()) {
// if requested 'cid' is in 'available' add it to the list of 'id's
if(std::find(available.begin(), available.end(), ID)!=available.end()) {
id.push_back(ID... | false | false | false | false | false | 0 |
reply(std::ostream& out, cxxtools::http::Request& request, cxxtools::http::Reply& reply)
{
log_debug("send hello");
reply.addHeader("Content-Type", "text/html");
out << "<html>\n"
" <head>\n"
" <title>Hello World-application</title>\n"
" </head>\n"
" <body bgcolor=\"#FFFFFF\"... | false | false | false | false | false | 0 |
getPairedGPR(unsigned Reg, bool Odd, const MCRegisterInfo *RI) {
for (MCSuperRegIterator Supers(Reg, RI); Supers.isValid(); ++Supers)
if (ARM::GPRPairRegClass.contains(*Supers))
return RI->getSubReg(*Supers, Odd ? ARM::gsub_1 : ARM::gsub_0);
return 0;
} | false | false | false | false | false | 0 |
Itcl_ClassCmdResolver(interp, name, context, flags, rPtr)
Tcl_Interp *interp; /* current interpreter */
CONST char* name; /* name of the command being accessed */
Tcl_Namespace *context; /* namespace performing the resolution */
int flags; /* TCL_LEAVE_ERR_MSG => leave error messages
* in int... | false | false | false | false | false | 0 |
f_gd(int count, VALUE **vals)
{
VALUE result;
NUMBER *eps;
NUMBER *q;
COMPLEX *tmp;
/* initialize VALUE */
result.v_subtype = V_NOSUBTYPE;
eps = conf->epsilon;
if (count == 2) {
if (vals[1]->v_type != V_NUM || qiszero(vals[1]->v_num))
return error_value(E_GD1);
eps = vals[1]->v_num;
}
result.v_type =... | false | false | false | false | false | 0 |
updateFrame(int frame)
{
if ( !metaAlertIcon ) // just in case
metaAlertIcon = new MetaAlertIcon();
if ( frame )
impix = real->impix();
else
impix = metaAlertIcon->blank16();
emit ai->pixmapChanged();
} | false | false | false | false | false | 0 |
renderPhong(Material *m, Point hit, Vector N, Vector V)
{
Color color;
Vector L, R;
for (std::vector<Light*>::iterator it=lights.begin(); it!=lights.end(); ++it) {
// Ambient
color += (*it)->color * m->color * m->ka;
// Diffusion
L = (*it)->position - hit;
L.normalize... | false | false | false | false | false | 0 |
__lpfc_findnode_did(struct lpfc_vport *vport, uint32_t did)
{
struct lpfc_nodelist *ndlp;
uint32_t data1;
list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) {
if (lpfc_matchdid(vport, ndlp, did)) {
data1 = (((uint32_t) ndlp->nlp_state << 24) |
((uint32_t) ndlp->nlp_xri << 16) |
((uint32_t) ndlp->... | false | false | false | false | false | 0 |
changed(bool update_metrics) const
{
BufferStorage::const_iterator it = bstore.begin();
BufferStorage::const_iterator end = bstore.end();
for (; it != end; ++it)
(*it)->changed(update_metrics);
it = binternal.begin();
end = binternal.end();
for (; it != end; ++it)
(*it)->changed(update_metrics);
} | false | false | false | false | false | 0 |
ghost(char *name)
{
if (isdigit(name[0])) {
netid_t hostid;
#ifdef DGAVIION
struct in_addr ina_str;
ina_str = inet_addr(name);
hostid = ina_str.s_addr;
#else
hostid = inet_addr(name);
#endif
if (hostid == -1L) {
fprintf(stderr, "%s: Invalid internet address %s\n", progname, name);
exit(51);
}
... | false | false | false | false | false | 0 |
addChunk_PLTE(ucvector* out, const LodePNG_InfoColor* info)
{
unsigned error = 0;
size_t i;
ucvector PLTE;
ucvector_init(&PLTE);
for(i = 0; i < info->palettesize * 4; i++)
{
/*add all channels except alpha channel*/
if(i % 4 != 3) ucvector_push_back(&PLTE, info->palette[i]);
}
error = addChunk(o... | false | false | false | false | false | 0 |
ParseName( char* p )
{
if ( !p || !(*p) ) {
return 0;
}
char* const start = p;
while( *p && ( p == start ? XMLUtil::IsNameStartChar( *p ) : XMLUtil::IsNameChar( *p ) )) {
++p;
}
if ( p > start ) {
Set( start, p, 0 );
return p;
}
return 0... | false | false | false | false | false | 0 |
expr_parse_string_expr (void)
{
/*
* Parse a string factor, then all repeated concatenations. Because the '+'
* and '&' are context sensitive, we have to invent/translate them into the
* otherwise unused TOK_CONCATENATE for evaluation.
*/
expr_parse_string_factor ();
while (expr_parse_lookahead == TO... | false | false | false | false | false | 0 |
player_throw_food(Model *m, Model_object *p, Object_type t,
int32_t x, int32_t y, int32_t w, int32_t h) {
Model_object *food;
/* Create food and accelerate it. */
food = new_object(m, t, p, x, y, w, h);
food->speed->y = -p->throw_speed->y;
food->speed->x = (LOOKS_LEFT(p) ? -p->throw_speed-... | false | false | false | false | false | 0 |
gap_story_remove_section(GapStoryBoard *stb, GapStorySection *del_section)
{
GapStorySection *section;
GapStorySection *prev_section;
GapStorySection *main_section;
GapStoryElem *stb_elem;
/* check for mask section */
if (del_section == stb->mask_section) { return(FALSE); }
main_section = gap_story_fin... | false | false | false | false | false | 0 |
burningsVideo(void)
{
IrrlichtDevice *device = createDevice(video::EDT_BURNINGSVIDEO,
core::dimension2du(160,120), 32);
if (!device)
return false;
IVideoDriver* driver = device->getVideoDriver();
ISceneManager* smgr = device->getSceneManager();
smgr->addCubeSceneNode(10... | false | false | false | false | false | 0 |
rinoo_socket_writeb(t_socket *socket, t_buffer *buffer)
{
size_t len;
size_t total;
ssize_t res;
total = 0;
len = buffer_size(buffer);
while (len > 0) {
res = socket->class->write(socket, buffer_ptr(buffer) + buffer_size(buffer) - len, len);
if (res <= 0) {
return -1;
}
total += res;
len -= res;
}
... | false | false | false | false | false | 0 |
bgav_video_parser_peek_packet_parse_frame(void * parser1, int force)
{
bgav_video_parser_t * parser = parser1;
if(parser->out_packet)
return parser->out_packet;
if(!parser->src.peek_func(parser->src.data, force))
return NULL;
parser->out_packet = parser->src.get_func(parser->src.data);
if(bgav_v... | false | false | false | false | false | 0 |
load(string filename, long start_smpl, long end_smpl) {
if (filename == "") throw -1;
// If we're not stopped, change to a stopped state
if (state != STATE_STOP) {
// If all the audio fits into cache, no need to restart caching
if (!allCached) stopCaching();
// Change to stopped st... | false | false | false | false | false | 0 |
scan_include_options(LEX *lc, int keyword, char *opts, int optlen)
{
int i;
char option[3];
int lcopts = lc->options;
option[0] = 0; /* default option = none */
option[2] = 0; /* terminate options */
lc->options |= LOPT_STRING; /* force string */
lex_... | false | false | false | false | false | 0 |
validate_mdc_config(hid_t file_id,
H5AC_cache_config_t * ext_config_ptr,
hbool_t compare_init,
int test_num)
{
/* const char * fcn_name = "validate_mdc_config()"; */
static char msg[256];
H5F_t * file_ptr = NULL;
H5C_t * cache_ptr = NULL;
H... | false | false | false | false | false | 0 |
lam_ssi_crlam_self_finalize(void)
{
lam_ssi_crlam_self_thread_status_t status =
LAM_SSI_CRLAM_SELF_THREAD_STATUS_DONE;
/* Tell the thread to exit */
if (write(crlam_self_filedesc[1], &status, sizeof(status)) !=
sizeof(status)) {
show_help_file("lam-ssi-crlam-self-helpfile", "cr-self-signal",
... | false | false | false | false | false | 0 |
nextLHAdec( Event& process) {
// Read resonance decays from LHA interface.
infoPtr->setEndOfFile(false);
if (!lhaUpPtr->setEvent()) {
infoPtr->setEndOfFile(true);
return false;
}
// Store LHA output in standard event record format.
containerLHAdec.constructDecays( process);
// Done.
return ... | false | false | false | false | false | 0 |
ompi_comm_nextcid_nb (ompi_communicator_t* newcomm,
ompi_communicator_t* comm,
ompi_communicator_t* bridgecomm,
int mode, ompi_request_t **req)
{
struct mca_comm_nextcid_context *context;
ompi_comm_request_t *request;
int ret;
... | false | false | false | false | false | 0 |
nameserver_ready_callback(int fd, short events, void *arg) {
struct nameserver *ns = (struct nameserver *) arg;
(void)fd;
if (events & EV_WRITE) {
ns->choked = 0;
if (!evdns_transmit()) {
nameserver_write_waiting(ns, 0);
}
}
if (events & EV_READ) {
nameserver_read(ns);
}
} | false | false | false | false | false | 0 |
get_nr_inodes(void)
{
int i;
long sum = 0;
for_each_possible_cpu(i)
sum += per_cpu(nr_inodes, i);
return sum < 0 ? 0 : sum;
} | false | false | false | false | false | 0 |
SqlPodcastChannel( SqlPodcastProvider *provider,
const QStringList &result )
: Podcasts::PodcastChannel()
, m_episodesLoaded( false )
, m_provider( provider )
{
SqlStorage *sqlStorage = CollectionManager::instance()->sqlStorage();
QStringList::ConstIterato... | false | false | false | false | false | 0 |
SignMessageWithRecovery(RandomNumberGenerator &rng, const byte *recoverableMessage, size_t recoverableMessageLength,
const byte *nonrecoverableMessage, size_t nonrecoverableMessageLength, byte *signature) const
{
std::auto_ptr<PK_MessageAccumulator> m(NewSignatureAccumulator(rng));
InputRecoverableMessage(*m, recov... | false | false | false | false | false | 0 |
sycheck_cmtab(const char *cmtab)
/** Check that permissions on ${sysconfdir}/cryptmount/cmtab are sensible */
{ struct stat sfile;
char *dirname=NULL;
int pos, eflag=ERR_NOERROR;
/* Extract directory name from cmtab filename: */
pos = (int)strlen(cmtab);
dirname = (char*)malloc((size_t)(pos +... | false | false | false | false | true | 1 |
e_collection_backend_delete_resource (ECollectionBackend *backend,
ESource *source,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
ECol... | false | false | false | true | false | 1 |
ocfs2_mv_xattr_bucket_cross_cluster(struct inode *inode,
handle_t *handle,
struct ocfs2_xattr_bucket *first,
struct ocfs2_xattr_bucket *target,
u64 new_blkno,
u32 num_clusters,
u32 *first_hash)
{
int ret;
struct super_block *sb = inode->i_sb;
in... | false | false | false | false | false | 0 |
bcf_p1_call_gt(const bcf_p1aux_t *ma, double f0, int k)
{
double sum, g[3];
double max, f3[3], *pdg = ma->pdg + k * 3;
int q, i, max_i, ploidy;
ploidy = ma->ploidy? ma->ploidy[k] : 2;
if (ploidy == 2) {
f3[0] = (1.-f0)*(1.-f0); f3[1] = 2.*f0*(1.-f0); f3[2] = f0*f0;
} else {
f3[0] = 1. - f0; f3[1] = 0; f3[2] =... | false | false | false | false | false | 0 |
mapToSource(const QModelIndex &proxyIndex) const
{
Q_D(const KSelectionProxyModel);
if (!proxyIndex.isValid() || !sourceModel() || d->m_rootIndexList.isEmpty())
return QModelIndex();
Q_ASSERT(proxyIndex.internalPointer() >= 0);
Q_ASSERT(proxyIndex.model() == this);
if (proxyIndex.internal... | false | false | false | false | false | 0 |
read_args(int argc, char *argv[])
{
int n;
char c = 'i';
int used = 1;
/* Check each argument */
for (n = 1; n < argc; n++)
{
/* '-' is special; anything else starting with '-' is an option. */
if ((argv[n][0] == '-' || argv[n][0] == '+') && argv[n][1])
{
/* Warn about options that need a... | true | true | false | false | false | 1 |
ssh1_write_bignum(void *data, Bignum bn)
{
unsigned char *p = data;
int len = ssh1_bignum_length(bn);
int i;
int bitc = bignum_bitcount(bn);
*p++ = (bitc >> 8) & 0xFF;
*p++ = (bitc) & 0xFF;
for (i = len - 2; i--;)
*p++ = bignum_byte(bn, i);
return len;
} | false | false | false | false | false | 0 |
ike_sa_id_hash(ike_sa_id_t *ike_sa_id)
{
/* IKEv2 does not mandate random SPIs (RFC 5996, 2.6), they just have to be
* locally unique, so we use our randomly allocated SPI whether we are
* initiator or responder to ensure a good distribution. The latter is not
* possible for IKEv1 as we don't know whether we ar... | false | false | false | false | false | 0 |
setShape() {
if (!shapesSupported)
return ;
if (client()->shaped()) {
MSG(("setting shape w=%d, h=%d", width(), height()));
if (isRollup() || isIconic()) {
XRectangle full;
full.x = 0;
full.y = 0;
full.width = width();
full.hei... | false | false | false | false | false | 0 |
config_save(void)
{
gsize size;
GKeyFile *file = g_key_file_new();
g_key_file_load_from_file(file, cfg.config_file, G_KEY_FILE_KEEP_COMMENTS, NULL);
gchar *ruleset;
switch (cfg.ruleset)
{
case RULESET_OMNIBUS: ruleset = "omnibus"; break;
case RULESET_OMNIBUS_ALT: ruleset = "omnibus_alt"; break;
case RULES... | false | false | false | false | false | 0 |
git_tag_set_message(git_tag *tag, const char *message)
{
assert(tag && message);
tag->object.modified = 1;
if (tag->message)
free(tag->message);
tag->message = git__strdup(message);
} | false | false | false | false | false | 0 |
cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap)
{
dvb_attach(dvb_pll_attach, adap->fe_adap[0].fe, 0x61, NULL, DVB_PLL_LG_Z201);
return 0;
} | false | false | false | false | false | 0 |
jdvbt90502_single_reg_write(struct jdvbt90502_state *state,
const u8 reg, const u8 val)
{
struct i2c_msg msg;
u8 wbuf[2];
wbuf[0] = reg;
wbuf[1] = val;
msg.addr = state->config.demod_address;
msg.flags = 0;
msg.buf = wbuf;
msg.len = sizeof(wbuf);
if (i2c_transfer(state->i2c, &msg, 1) != 1) {
de... | false | false | false | false | false | 0 |
zd_rx_rate(const void *rx_frame, const struct rx_status *status)
{
u8 zd_rate;
if (status->frame_status & ZD_RX_OFDM) {
zd_rate = zd_rate_from_ofdm_plcp_header(rx_frame);
} else {
switch (zd_cck_plcp_header_signal(rx_frame)) {
case ZD_CCK_PLCP_SIGNAL_1M:
zd_rate = ZD_CCK_RATE_1M;
break;
case ZD_CCK_PLC... | false | false | false | false | false | 0 |
php_stream_get_record(php_stream *stream, size_t maxlen, size_t *returned_len, char *delim, size_t delim_len TSRMLS_DC)
{
char *e, *buf;
size_t toread, len;
int skip = 0;
len = stream->writepos - stream->readpos;
while (len < maxlen) {
size_t just_read;
toread = MIN(maxlen - len, stream->chunk_size);
php... | false | false | false | false | false | 0 |
tcs_wrap_ReadCounter(struct tcsd_thread_data *data)
{
TCS_CONTEXT_HANDLE hContext;
TSS_COUNTER_ID idCounter;
TPM_COUNTER_VALUE counterValue;
TSS_RESULT result;
if (getData(TCSD_PACKET_TYPE_UINT32, 0, &hContext, 0, &data->comm))
return TCSERR(TSS_E_INTERNAL_ERROR);
if ((result = ctx_verify_context(hContext)))
... | false | false | false | false | false | 0 |
RemoveTooCloseFeatures(KLTContext::FeatureList *features,
double mindist2) {
KLTContext::FeatureList::iterator i = features->begin();
while (i != features->end()) {
bool i_deleted = false;
KLTContext::FeatureList::iterator j = i;
++j;
while (j != features->end() &... | false | false | false | false | false | 0 |
_save_accounts (FrogrConfig *self)
{
FrogrConfigPrivate *priv = NULL;
FrogrAccount *account = NULL;
GSList *item = NULL;
xmlDocPtr xml = NULL;
xmlNodePtr root = NULL;
gchar *xml_path = NULL;
gboolean retval = TRUE;
g_return_val_if_fail (FROGR_IS_CONFIG (self), FALSE);
priv = FROGR_CONFIG_GET_PRIVATE... | false | false | false | false | false | 0 |
col_name(struct csa *csa, int j, char cname[255+1])
{ /* construct symbolic name of j-th column (variable) */
const char *name;
name = glp_get_col_name(csa->P, j);
if (name == NULL) goto fake;
strcpy(cname, name);
adjust_name(cname);
if (check_name(cname)) goto fake;
return... | false | false | false | false | false | 0 |
collate(int (*hash)(char *, int))
{
if (kv == NULL) error->all("Cannot collate without KeyValue");
if (timer) start_timer();
int verbosity_hold = verbosity;
int timer_hold = timer;
verbosity = timer = 0;
aggregate(hash);
convert();
verbosity = verbosity_hold;
timer = timer_hold;
stats("Collate",1... | false | false | false | false | false | 0 |
IoMessage_mark(IoMessage *self)
{
IoObject_shouldMarkIfNonNull(DATA(self)->name);
IoObject_shouldMarkIfNonNull(DATA(self)->cachedResult);
if (DATA(self)->args)
{
LIST_FOREACH(DATA(self)->args, i, v, IoObject_shouldMark(v));
}
IoObject_shouldMarkIfNonNull((IoObject *)DATA(self)->next);
IoObject_shouldMarkIfNo... | false | false | false | false | false | 0 |
findaction(int *verbs,int preposition,int flag)
{
int act,mask;
/* look up the action */
for (act = 1; act <= acount; act++) {
if (preposition && !haspreposition(act,preposition))
continue;
if (!hasverb(act,verbs))
continue;
mask = ~getabyte(act,A_MASK);
if ((flag & mask) == (getabyte(act,A_F... | false | false | false | false | false | 0 |
gnutls_pkcs12_set_bag (gnutls_pkcs12_t pkcs12, gnutls_pkcs12_bag_t bag)
{
ASN1_TYPE c2 = ASN1_TYPE_EMPTY;
ASN1_TYPE safe_cont = ASN1_TYPE_EMPTY;
int result;
int enc = 0, dum = 1;
char null;
if (pkcs12 == NULL)
{
gnutls_assert ();
return GNUTLS_E_INVALID_REQUEST;
}
/* Step 1. Check if... | false | false | false | false | false | 0 |
access(uint param){
uint mult=0;
register uint j;
uint partialSum=0;
uint ini=param-1;
uint * bsData = ((BitSequenceRG *)bS)->data;
byte * level;
byte readByte;
uint pos, rankini, cont;
j=0;
level= levels + (levelsIndex[j]>>1);
cont = ini + (levelsIndex[j]&0x1);
pos= levelsIndex[j]+ini; ... | false | false | false | false | false | 0 |
debug()
{
FILE *f = stderr;
fprintf(f, "<areas>\n");
foreach(FileArea, x, mods,
if (dynamic_cast<ModifiedFileArea*>(x)) {
ModifiedFileArea *m = (ModifiedFileArea *)x;
ht_fprintf(f, "\tmodify %08qx, %qd bytes", &x->start, &x->size);
for (uint i=0; i < x->size; i++) {
ht_fprintf(f, " %02x", m->buf[i]);
... | false | false | false | false | false | 0 |
cmd_MatchIP_Mode(cmd_parms *cmd, void *InDirConf, const char *p1) {
strAuth_memCookie_config_rec *conf=(strAuth_memCookie_config_rec*)InDirConf;
if ((strcasecmp("1",p1)==0) || (strcasecmp("X-Forwarded-For",p1)==0))
{
conf->nAuth_memCookie_MatchIP_Mode=1;
}
else if ((strcasecmp("2",p1)... | false | false | false | false | false | 0 |
msxml_read_cb_new_window(struct msxml_cbdata *cbdata)
{
const unsigned char *new_window = NULL;
off_t new_mappos;
size_t bytes;
if (cbdata->mappos == cbdata->map->len) {
cli_msxmlmsg("msxml_read_cb: fmap REALLY EOF\n");
return 0;
}
new_mappos = cbdata->mappos + cbdata->winsize;... | false | false | false | false | false | 0 |
ReadReal(cmsIT8* it8, int inum)
{
it8->dnum = (cmsFloat64Number) inum;
while (isdigit(it8->ch)) {
it8->dnum = it8->dnum * 10.0 + (it8->ch - '0');
NextCh(it8);
}
if (it8->ch == '.') { // Decimal point
cmsFloat64Number frac = 0.0; // fraction
int prec = 0; ... | false | false | false | false | false | 0 |
OslMapTable (
ACPI_SIZE Address,
char *Signature,
ACPI_TABLE_HEADER **Table)
{
ACPI_TABLE_HEADER *MappedTable;
UINT32 Length;
if (!Address)
{
return (AE_BAD_ADDRESS);
}
/*
* Map the header so we can get the... | false | false | false | false | false | 0 |
writecell_2p1(node *root, int depth) {
g_uintptr_t thiscell = 0 ;
if (root == zeronode(depth))
return 0 ;
if (depth == 2) {
if (root->nw != 0)
return (g_uintptr_t)(root->nw) ;
} else {
if (marked2(root))
return (g_uintptr_t)(root->next) ;
unhash_node(root) ;
m... | false | false | false | false | false | 0 |
packstr_array(char **valp, uint32_t size_val, Buf buffer)
{
int i;
uint32_t ns = htonl(size_val);
if (remaining_buf(buffer) < sizeof(ns)) {
if (buffer->size > (MAX_BUF_SIZE - BUF_SIZE)) {
error("packstr_array: buffer size too large");
return;
}
buffer->size += BUF_SIZE;
xrealloc(buffer->head, buffer->... | false | false | false | false | false | 0 |
redisOpArrayFree(redisOpArray *oa) {
while(oa->numops) {
int j;
redisOp *op;
oa->numops--;
op = oa->ops+oa->numops;
for (j = 0; j < op->argc; j++)
decrRefCount(op->argv[j]);
zfree(op->argv);
}
zfree(oa->ops);
} | false | false | false | false | false | 0 |
saveEngineStatus ( const char filename[] ) {
// First save the engine status just like the base class would do:
getTheEngine()->saveStatus( filename );
// Now append the cached variate, if any:
std::ofstream outfile ( filename, std::ios::app );
if ( getFlag() ) {
std::vector<unsigned long> t(2);
t... | false | false | false | false | false | 0 |
bus_engine_proxy_new_finish (GAsyncResult *res,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
g_assert (error == NULL || *error == NULL);
g_assert (g_simple_async_result_get_source_tag (simple) == bus_engine_proxy_new);
if (g_simple_as... | false | false | false | false | false | 0 |
widen_column (StfDialogData *pagedata, int col, gboolean test_only)
{
int colcount = stf_parse_options_fixed_splitpositions_count (pagedata->parseoptions);
int nextstart, nextnextstart;
if (col >= colcount - 1)
return FALSE;
nextstart = stf_parse_options_fixed_splitpositions_nth (pagedata->parseoptions, col);
... | false | false | false | false | false | 0 |
cs_complement (Charset *cs) {
loopset(i, cs->cs[i] = ~cs->cs[i]);
} | false | false | false | false | false | 0 |
intel_fbdev_initial_config(void *data, async_cookie_t cookie)
{
struct drm_i915_private *dev_priv = data;
struct intel_fbdev *ifbdev = dev_priv->fbdev;
/* Due to peculiar init order wrt to hpd handling this is separate. */
if (drm_fb_helper_initial_config(&ifbdev->helper,
ifbdev->preferred_bpp))
intel_fbde... | 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.