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 |
|---|---|---|---|---|---|---|
bubblemon_setup_samples(void)
{
int i;
u_int64_t load = 0, total = 0;
if (bm.load) {
load = bm.load[bm.loadIndex];
free(bm.load);
}
if (bm.total) {
total = bm.total[bm.loadIndex];
free(bm.total);
}
bm.loadIndex = 0;
bm.load = malloc(bm.samples * sizeof(u_int64_t));
bm.total = ... | false | false | false | false | false | 0 |
vfy_tag (vfy_constants *pool, int index)
{
int result = JPOOL_TAG (pool, index);
/* gcj will resolve constant pool entries other than string and
class references. The verifier doesn't care about the values, so
we just strip off the resolved flag. */
if ((result & CONSTANT_ResolvedFlag) != 0
&& r... | false | false | false | false | false | 0 |
tb_ctl_rx(struct tb_ctl *ctl, void *buffer,
size_t length, int timeout_msec,
u64 route, enum tb_cfg_pkg_type type)
{
struct tb_cfg_result res;
struct ctl_pkg *pkg;
if (!wait_for_completion_timeout(&ctl->response_ready,
msecs_to_jiffies(timeout_msec))) {
tb_ctl_WARN(ctl, "RX: timeout\n");... | false | false | false | false | false | 0 |
lto_file_finalize (struct lto_file_decl_data *file_data, lto_file *file)
{
const char *data;
size_t len;
VEC(ld_plugin_symbol_resolution_t,heap) *resolutions = NULL;
int i;
res_pair *rp;
/* Create vector for fast access of resolution. We do this lazily
to save memory. */
VEC_safe_grow_cleared (ld_p... | false | false | false | false | false | 0 |
startMultiRequest(const string& inSessionID,
const string& inLanguageCode){
mMultiResponse=new CXMLElement("mrml",0);
mMultiResponse->addAttribute("session-id",
inSessionID);
CTimeStampGenerator lGenerator;
addToMultiResponse(lGenerator.generateTimeStamp());
} | false | false | false | false | false | 0 |
create_texture_if_needed(int width, int height) {
//g_frame_texture.video_version = g_fs_emu_video_version;
if (g_frame_texture && g_frame_texture_width >= width &&
g_frame_texture_height >= height) {
return;
}
fs_gl_bind_texture(0);
if (g_frame_texture) {
glDeleteTextur... | false | false | false | false | false | 0 |
UpdateHistory(const vector< const Word* >& hypo) {
Phrase phrase(hypo);
std::vector< size_t > ngram_counts(BleuScoreState::bleu_order);
std::vector< size_t > ngram_matches(BleuScoreState::bleu_order);
// compute vector c(e;{r_k}):
// vector of effective reference length, number of ngrams in e, numb... | false | false | false | false | false | 0 |
error(const char *message, int add_errno)
{
memset(_lmo_error, 0, sizeof(_lmo_error));
if( add_errno )
snprintf(_lmo_error, sizeof(_lmo_error),
"%s: %s", message, strerror(errno));
else
snprintf(_lmo_error, sizeof(_lmo_error), "%s", message);
return NULL;
} | false | false | false | false | false | 0 |
operator()(const ExecutionTarget& lhs, const ExecutionTarget& rhs) const {
std::map<std::string, long>::const_iterator itLHS = CacheMappingTable.find(lhs.ComputingEndpoint->URLString);
std::map<std::string, long>::const_iterator itRHS = CacheMappingTable.find(rhs.ComputingEndpoint->URLString);
// itLHS... | false | false | false | false | false | 0 |
mbox(struct ast_vm_user *vmu, int id)
{
#ifdef IMAP_STORAGE
if (vmu && id == 0) {
return vmu->imapfolder;
}
#endif
return (id >= 0 && id < ARRAY_LEN(mailbox_folders)) ? mailbox_folders[id] : "Unknown";
} | false | false | false | false | false | 0 |
cpath_regions_hash_free( RFG_FilterCallPathRegionHN** htab )
{
uint32_t i;
for( i = 0; i < CPATH_REGIONS_HASH_MAX; i++ )
{
while( htab[i] )
{
RFG_FilterCallPathRegionHN* tmp = htab[i]->next;
free( htab[i]->name );
free( htab[i] );
htab[i] = tmp;
}
}
} | false | false | false | false | false | 0 |
monstinroom(struct permonst *mdat, int roomno)
{
struct monst *mtmp;
for(mtmp = fmon; mtmp; mtmp = mtmp->nmon)
if(!DEADMONSTER(mtmp) && mtmp->data == mdat &&
index(in_rooms(mtmp->mx, mtmp->my, 0), roomno + ROOMOFFSET))
return(true);
return(false);
} | false | false | false | false | false | 0 |
CleanUpMem( TreeDataType *ptd )
{
int i;
RecordNode *pNode;
for ( i = 0; i < ptd->nInterval; i++ ) {
if ( ptd->interval[ i ].p_phr ) {
free( ptd->interval[ i ].p_phr );
ptd->interval[ i ].p_phr = NULL;
}
}
while ( ptd->phList != NULL ) {
pNode = ptd->phList;
ptd->phList = pNode->next;
free( pNode-... | false | false | false | false | false | 0 |
EnvRtnUnknown(
void *theEnv,
int argumentPosition,
DATA_OBJECT_PTR returnValue)
{
int count = 1;
struct expr *argPtr;
/*=====================================================*/
/* Find the appropriate argument in the argument list. */
/*=====================================================*/
... | false | false | false | false | false | 0 |
csr1212_generate_positions(struct csr1212_csr_rom_cache *cache,
struct csr1212_keyval *start_kv,
int start_pos)
{
struct csr1212_keyval *kv = start_kv;
struct csr1212_keyval *okv = start_kv;
int pos = start_pos;
int kv_len = 0, okv_len = 0;
cache->layout_head = kv;
while(kv && pos < cache->size)... | false | false | false | false | false | 0 |
s_pack_into(PyObject *self, PyObject *args)
{
PyStructObject *soself;
char *buffer;
Py_ssize_t buffer_len, offset;
/* Validate arguments. +1 is for the first arg as buffer. */
soself = (PyStructObject *)self;
assert(PyStruct_Check(self));
assert(soself->s_codes != NULL);
if (PyTuple_GE... | false | false | false | false | true | 1 |
rsp_data (siobuf_t conn, smtp_session_t session)
{
int code;
smtp_message_t message;
message = session->current_message;
code = read_smtp_response (conn, session, &message->message_status, NULL);
if (code < 0)
{
session->rsp_state = S_quit;
return;
}
if (code == 4 || code == 5)
{
... | false | false | false | false | false | 0 |
procPropertyReference(parseUnion * lvalp, ParserControl * parm)
{
static XmlElement elm[] = { {"NAME"},
{"REFERENCECLASS"},
{"CLASSORIGIN"},
{"PROPAGATED"},
{NULL}
};
XmlAttr attr[4];
memset(attr, 0, sizeof(attr));
if (tagEquals(parm->xmb, "PROPERTY.REFERENCE")) {
attr[1].attr = NULL;
... | false | false | false | false | false | 0 |
vce_v3_0_mc_resume(struct amdgpu_device *adev, int idx)
{
uint32_t offset, size;
WREG32_P(mmVCE_CLOCK_GATING_A, 0, ~(1 << 16));
WREG32_P(mmVCE_UENC_CLOCK_GATING, 0x1FF000, ~0xFF9FF000);
WREG32_P(mmVCE_UENC_REG_CLOCK_GATING, 0x3F, ~0x3F);
WREG32(mmVCE_CLOCK_GATING_B, 0xf7);
WREG32(mmVCE_LMI_CTRL, 0x00398000);
W... | false | false | false | false | false | 0 |
mkDupCmd(HE_CMD * cmd)
{
int i;
HE_CMD *dupCmd;
dupCmd = (HE_CMD *) HDcalloc(1, sizeof(HE_CMD));
dupCmd->func = cmd->func;
dupCmd->argc = cmd->argc;
dupCmd->next = dupCmd->sub = (HE_CMD *) NULL;
for (i = 0; i < cmd->argc; i++)
dupCmd->argv[i] = copyStr(cmd->argv[i]);
return... | false | false | false | false | false | 0 |
graphics_tile_info(bx_svga_tileinfo_t *info)
{
if (!info) {
info = (bx_svga_tileinfo_t *)malloc(sizeof(bx_svga_tileinfo_t));
if (!info) {
return NULL;
}
}
BX_GUI_THIS host_pitch = BX_GUI_THIS host_xres * ((BX_GUI_THIS host_bpp + 1) >> 3);
info->bpp = BX_GUI_THIS host_bpp;
info->pitch = BX_... | false | false | false | false | false | 0 |
get_max_open_files(void)
{
struct rlimit rlp;
if (getrlimit(RLIMIT_NOFILE, &rlp)!=0)
vt_error_msg("");
return (rlp.rlim_max == RLIM_INFINITY) ? VT_MAX_OPEN_FILES :
(int)rlp.rlim_max;
} | false | false | false | false | false | 0 |
virt_ftruncate(int fd, off_t length)
{
int res;
int errno_save = errno;
res = av_fd_truncate(fd, length);
if(res < 0) {
errno = -res;
return -1;
}
errno = errno_save;
return 0;
} | false | false | false | false | false | 0 |
mono_method_can_access_method (MonoMethod *method, MonoMethod *called)
{
int can = can_access_member (method->klass, called->klass, NULL, called->flags & METHOD_ATTRIBUTE_MEMBER_ACCESS_MASK);
if (!can) {
MonoClass *nested = method->klass->nested_in;
while (nested) {
can = can_access_member (nested, called->kla... | false | false | false | false | false | 0 |
zfopen(const char *path, const char *mode) {
char path2[1024];
zfp *zf;
if (!(zf = (zfp *)malloc(sizeof(*zf))))
return NULL;
zf->fp = NULL;
zf->gz = NULL;
/* Try normal fopen */
if (mode[0] != 'z' && mode[1] != 'z' &&
NULL != (zf->fp = fopen(path, mode))) {
unsigned char magic[2];
if (... | false | false | false | false | true | 1 |
glusterd_handle_replace_brick (rpcsvc_request_t *req)
{
int32_t ret = -1;
gf_cli_req cli_req = {{0,}};
dict_t *dict = NULL;
char *src_brick = NULL;
char *ds... | true | true | false | true | false | 1 |
addvpndeclsig( Figure, Atom, Base, Kind )
vpnfig_list *Figure;
vexexpr *Atom;
unsigned char Base;
unsigned char Kind;
{
vpndecl_list *Signal;
char *Name;
if ( ! IsVexNodeAtom( Atom ) ) Name = getvexarrayname( Atom );
else Name = GetVexAtomValue( Atom );
... | false | false | false | false | false | 0 |
expcollect(struct Global *global)
{
/*
* Collect the actual parameters for this macro.
*/
int c;
int paren; /* For embedded ()'s */
ReturnCode ret;
for (;;) {
paren = 0; /* Collect next arg. */
while ((c = skipws(global)) == '\n')/* Skip over whitespace */
global->... | false | false | false | false | false | 0 |
json_page_diff(){
cson_object * pay = NULL;
cson_value * v = NULL;
char const * zFrom;
char const * zTo;
int nContext = 0;
char doSBS;
char doHtml;
if(!g.perm.Read){
json_set_err(FSL_JSON_E_DENIED,
"Requires 'o' permissions.");
return NULL;
}
zFrom = json_find_option_cstr("v... | false | false | false | false | false | 0 |
xmp_files_open_new(const char *path, XmpOpenFileOptions options)
{
CHECK_PTR(path, NULL);
RESET_ERROR;
SXMPFiles *txf = NULL;
try {
txf = new SXMPFiles(path, XMP_FT_UNKNOWN, options);
}
catch(const XMP_Error & e) {
set_error(e);
}
return (XmpFilePtr)txf;
} | false | false | false | false | false | 0 |
GetCopyGlobalIds(int ctype)
{
if (ctype == vtkDataSetAttributes::ALLCOPY)
{
return
this->CopyAttributeFlags[COPYTUPLE][GLOBALIDS] &&
this->CopyAttributeFlags[INTERPOLATE][GLOBALIDS] &&
this->CopyAttributeFlags[PASSDATA][GLOBALIDS];
}
else
{
return
this->CopyAttribut... | false | false | false | false | false | 0 |
dump_aout()
{
static char * cpu[] = { "unknown", "8086", "m68k", "ns16k", "i386", "sparc" };
static char * byteord[] = { "LITTLE_ENDIAN", "(2143)","(3412)","BIG_ENDIAN" };
int i;
long l;
if( h_cpu > 0x17 ) h_cpu &= 3;
printf("HLEN %d\n", h_len);
printf("CPU %s %s\n", cpu[h_cpu>>2], byteord[h_cpu&3]);
... | false | true | false | false | true | 1 |
block_dup_check_gen(struct parser_params *parser, NODE *node1, NODE *node2)
{
if (node2 && node1 && nd_type(node1) == NODE_BLOCK_PASS) {
compile_error(PARSER_ARG "both block arg and actual block given");
}
} | false | false | false | false | false | 0 |
gcd_hook (void *p, mp_srcptr gp, mp_size_t gn,
mp_srcptr qp, mp_size_t qn, int d)
{
struct gcd_ctx *ctx = (struct gcd_ctx *) p;
MPN_COPY (ctx->gp, gp, gn);
ctx->gn = gn;
} | false | false | false | false | false | 0 |
Scm_ConditionTypeName(ScmObj c)
{
ScmObj sname;
static SCM_DEFINE_STRING_CONST(cond_name_delim, ",", 1, 1);
/* just a safety net */
if (!SCM_CONDITIONP(c)) return SCM_MAKE_STR("(not a condition)");
if (!SCM_COMPOUND_CONDITION_P(c)) {
sname = Scm__InternalClassName(Scm_ClassOf(c));
} el... | false | false | false | false | false | 0 |
init_wordlist(WORD_INFO *winfo, char *filename, HTK_HMM_INFO *hmminfo, char *headphone, char *tailphone, char *contextphone, boolean force_dict)
{
FILE *fd;
jlog("Stat: init_wordlist: reading in word list\n");
if ((fd = fopen_readfile(filename)) == NULL) {
jlog("Error: init_wordlist: failed to open %s\n",fil... | false | false | false | false | false | 0 |
gpo_twl6040_probe(struct platform_device *pdev)
{
struct device *twl6040_core_dev = pdev->dev.parent;
struct twl6040 *twl6040 = dev_get_drvdata(twl6040_core_dev);
int ret;
twl6040gpo_chip.base = -1;
if (twl6040_get_revid(twl6040) < TWL6041_REV_ES2_0)
twl6040gpo_chip.ngpio = 3; /* twl6040 have 3 GPO */
else
... | false | false | false | false | false | 0 |
compress_dealloc(compressobject *lz)
{
PyObject_GC_UnTrack(lz);
Py_XDECREF(lz->data);
Py_XDECREF(lz->selectors);
Py_TYPE(lz)->tp_free(lz);
} | false | false | false | false | false | 0 |
uc_strnmatch(const unichar_t *str1, const char *str2, int len) {
long ch1, ch2;
for (;--len>=0;) {
ch1 = *str1++; ch2 = *(unsigned char *) str2++ ;
ch1 = tolower(ch1);
ch2 = tolower(ch2);
if ( ch1!=ch2 || ch1=='\0' || len<=0 )
return(ch1-ch2);
}
return( 0 );
} | false | false | false | false | false | 0 |
i40e_vlan_rx_add_vid(struct net_device *netdev,
__always_unused __be16 proto, u16 vid)
#else
static int i40e_vlan_rx_add_vid(struct net_device *netdev,
__always_unused __be16 proto, u16 vid)
#endif
{
struct i40e_netdev_priv *np = netdev_priv(netdev);
struct i40e_vsi *vsi = np->vsi;
int ret = 0;
if (vid > 4... | false | false | false | false | false | 0 |
P_Widget_Superclass (Object w) {
Check_Widget (w);
if (XtClass (WIDGET(w)->widget) == widgetClass)
return Sym_None;
return Make_Widget_Class (XtSuperclass (WIDGET(w)->widget));
} | false | false | false | false | false | 0 |
xmlSecNssKeySlotSupportMech(
xmlSecNssKeySlotPtr keySlot ,
CK_MECHANISM_TYPE type
) {
xmlSecAssert2( keySlot != NULL , 0 ) ;
xmlSecAssert2( keySlot->slot != NULL , 0 ) ;
xmlSecAssert2( type != CKM_INVALID_MECHANISM , 0 ) ;
if( PK11_DoesMechanism( keySlot->slot , type ) == PR_TRUE ) {
re... | false | false | false | false | false | 0 |
unescape(const char * url)
{
Pool pool;
return svn_path_uri_decode(url, pool);
} | false | false | false | false | false | 0 |
dummy_udc_start(struct usb_gadget *g,
struct usb_gadget_driver *driver)
{
struct dummy_hcd *dum_hcd = gadget_to_dummy_hcd(g);
struct dummy *dum = dum_hcd->dum;
if (driver->max_speed == USB_SPEED_UNKNOWN)
return -EINVAL;
/*
* SLAVE side init ... the layer above hardware, which
* can't enumerate without he... | false | false | false | false | false | 0 |
clear_level_structures()
{
static struct rm zerorm = { cmap_to_glyph(S_stone),
0, 0, 0, 0, 0, 0, 0, 0 };
register int x,y;
register struct rm *lev;
for(x=0; x<COLNO; x++) {
lev = &levl[x][0];
for(y=0; y<ROWNO; y++) {
*lev++ = zerorm;
#ifdef MICROPORT_BUG
level.objects[x][y] = (struct obj *)0;
... | false | false | false | false | false | 0 |
maybe_apply_pending_pragma_weaks (void)
{
tree alias_id, id, decl;
int i;
pending_weak *pe;
FOR_EACH_VEC_ELT (pending_weak, pending_weaks, i, pe)
{
alias_id = pe->name;
id = pe->value;
if (id == NULL)
continue;
decl = build_decl (UNKNOWN_LOCATION,
FUNCTION_DECL, alias_id, def... | false | false | false | false | false | 0 |
ComputeStoreGlobal(String* name,
GlobalObject* receiver,
JSGlobalPropertyCell* cell,
StrictModeFlag strict_mode) {
Code::Flags flags = Code::ComputeMonomorphicFlags(
Code::STORE_IC, N... | false | false | false | false | false | 0 |
cfs_delete_dir(const char *path)
{
int result = 1;
struct chirp_dir *dir;
struct chirp_dirent *d;
if(cfs->unlink(path) == 0) /* Handle files and symlinks here */
return 0;
dir = cfs->opendir(path);
if(!dir) {
return errno == ENOENT;
}
while((d = cfs->readdir(dir))) {
char subdir[PATH_MAX];
if(!strcmp(... | false | false | false | false | false | 0 |
do_learn_status (app_t app, ctrl_t ctrl, unsigned int flags)
{
gpg_error_t err;
if ((flags & 1))
err = 0;
else
{
err = send_certinfo (app, ctrl, "100", app->app_local->certificate_info);
if (!err)
err = send_certinfo (app, ctrl, "101",
app->app_local->trus... | false | false | false | false | false | 0 |
is_other()
{
return (!is_gun() && !is_ammo() && !is_armor() && !is_food() &&
!is_food_container() && !is_tool() && !is_gunmod() && !is_bionic() &&
!is_book() && !is_weap());
} | false | false | false | false | false | 0 |
pf_part2(font_info *fi, char **bufp, size_t *lenp) {
t1_font *tf = fi->fontfile;
if (tf->length2 == 0)
tf->length2 = pf_length2(tf);
pf_getbinary(tf, tf->length1, tf->length2, bufp, lenp);
if (*lenp >= 256)
*lenp -= 256;
} | false | false | false | false | false | 0 |
sockopt_data(VALUE self)
{
VALUE v = rb_attr_get(self, rb_intern("data"));
StringValue(v);
return v;
} | false | false | false | false | false | 0 |
ipw_remove_current_network(struct ipw_priv *priv)
{
struct list_head *element, *safe;
struct libipw_network *network = NULL;
unsigned long flags;
spin_lock_irqsave(&priv->ieee->lock, flags);
list_for_each_safe(element, safe, &priv->ieee->network_list) {
network = list_entry(element, struct libipw_network, list)... | false | false | false | false | false | 0 |
gst_dfbvideosink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
{
GstDfbVideoSink *dfbvideosink;
GstBufferPool *pool;
GstCaps *caps;
gboolean need_pool;
guint size;
dfbvideosink = GST_DFBVIDEOSINK (bsink);
gst_query_parse_allocation (query, &caps, &need_pool);
if ((pool = dfbvideosink->po... | false | false | false | false | false | 0 |
show_rev(int type, const unsigned char *sha1, const char *name)
{
if (!(filter & DO_REVS))
return;
def = NULL;
if ((symbolic || abbrev_ref) && name) {
if (symbolic == SHOW_SYMBOLIC_FULL || abbrev_ref) {
unsigned char discard[20];
char *full;
switch (dwim_ref(name, strlen(name), discard, &full)) {
c... | true | true | false | false | false | 1 |
invalidate_webkdc_factors(struct webauth_context *ctx,
apr_array_header_t *wkfactors,
time_t valid_threshold)
{
bool invalidated = false;
time_t now;
int i;
/* Nothing to do if no tokens or valid_threshold time. */
if (valid_threshold == 0)
... | false | false | false | false | false | 0 |
writeEndElement(const XMLString& namespaceURI, const XMLString& localName, const XMLString& qname)
{
if (_unclosedStartTag && !(_options & CANONICAL_XML))
{
writeMarkup(MARKUP_SLASHGT);
_unclosedStartTag = false;
}
else
{
if (_unclosedStartTag)
{
writeMarkup(MARKUP_GT);
_unclosedStartTag = false;
}... | false | false | false | false | false | 0 |
SetEntryIcon(int i, vtkImageData *icon)
{
if ( i >= 0 && i < this->NumberOfEntries )
{
if ( this->IconImage[i] == icon )
{
return;
}
if ( this->IconImage[i] )
{
this->IconImage[i]->Delete();
}
this->IconImage[i] = icon;
if ( this->IconImage[i] )
{
th... | false | false | false | false | false | 0 |
dma_sparse_view_set_property (GObject *object,guint prop_id, const GValue *value, GParamSpec *pspec)
{
DmaSparseView *view;
g_return_if_fail (DMA_IS_SPARSE_VIEW (object));
view = DMA_SPARSE_VIEW (object);
switch (prop_id)
{
case PROP_BUFFER:
dma_sparse_view_set_sparse_buffer (view, g_value_get_object ... | false | false | false | false | false | 0 |
init_resource_info (rtx epilogue_insn)
{
int i;
/* Indicate what resources are required to be valid at the end of the current
function. The condition code never is and memory always is. If the
frame pointer is needed, it is and so is the stack pointer unless
EXIT_IGNORE_STACK is nonzero. If the f... | false | false | false | false | false | 0 |
SelectorCreateProduct( const char * fctid, char * szRawFile,
int iIsScience, char * szProductFile, cpl_propertylist * qclist,
cpl_frameset * framelist, cpl_parameterlist * parlist,
const char * recipename)
{
int iStatus = 0;
char szMessage[1024];
char szFilenameProduct[1024];
cpl_table * pTable;
... | false | false | false | false | false | 0 |
extract(UChar *dest, int32_t destCapacity,
UErrorCode &errorCode) const {
int32_t len = length();
if(U_SUCCESS(errorCode)) {
if(isBogus() || destCapacity<0 || (destCapacity>0 && dest==0)) {
errorCode=U_ILLEGAL_ARGUMENT_ERROR;
} else {
const UChar *array = getArrayStart();
... | false | false | false | false | false | 0 |
__ecereNameSpace__ecere__com___malloc(unsigned int size)
{
void * pointer;
pointer = size ? __ecereNameSpace__ecere__com___mymalloc(size + 2 * 0) : (((void *)0));
return pointer ? ((unsigned char *)pointer + 0) : (((void *)0));
} | false | false | false | false | false | 0 |
mxs_auart_set_ldisc(struct uart_port *port,
struct ktermios *termios)
{
if (termios->c_line == N_PPS) {
port->flags |= UPF_HARDPPS_CD;
mxs_auart_enable_ms(port);
} else {
port->flags &= ~UPF_HARDPPS_CD;
}
} | false | false | false | false | false | 0 |
GenerateUserXorMessage()
{
QByteArray msg;
uint size = static_cast<uint>(_slot_signing_keys.size());
_server_alibi_data.StorePhaseRngByteIndex(_rngs_with_servers[0]->BytesGenerated());
/* For each slot */
for(uint idx = 0; idx < size; idx++) {
uint length = _message_lengths[idx] + _header_... | false | false | false | false | false | 0 |
riello_serialcomm(BYTE* bufIn, BYTE typedev)
{
time_t realt, nowt;
BYTE commb = 0;
realt = time(NULL);
while (wait_packet) {
serial_read(1000, &commb);
nowt = time(NULL);
commbyte = (BYTE) commb;
riello_parse_serialport(typedev, bufIn, gpser_error_control);
if ((nowt - realt) > 4)
break;
}
} | false | false | false | false | false | 0 |
gfxr_add_to_pic(gfx_resstate_t *state, int old_nr, int new_nr, int maps, int flags,
int old_default_palette, int default_palette, int scaled)
{
gfx_resource_type_t restype = GFX_RESOURCE_TYPE_PIC;
sbtree_t *tree = state->resource_trees[restype];
gfxr_pic_t *pic = NULL;
gfx_resource_t *res = NULL;
int hash = gfxr... | false | false | false | false | false | 0 |
choose_visual(Gt_Viewer *viewer)
{
Display *display = viewer->display;
int screen_number = viewer->screen_number;
VisualID default_visualid = DefaultVisual(display, screen_number)->visualid;
XVisualInfo visi_template;
int nv, i;
XVisualInfo *v, *best_v = 0;
Gt_Viewer *trav;
/* Look for an existing Gt_... | false | false | false | false | false | 0 |
add_sm_device (SANE_String_Const devname, SANE_String_Const modname)
{
SM3840_Device *dev;
dev = calloc (sizeof (*dev), 1);
if (!dev)
return (SANE_STATUS_NO_MEM);
memset (dev, 0, sizeof (*dev));
dev->sane.name = strdup (devname);
dev->sane.model = modname;
dev->sane.vendor = "Microtek";
dev->sane.... | false | false | false | false | false | 0 |
dce_v10_0_crtc_init(struct amdgpu_device *adev, int index)
{
struct amdgpu_crtc *amdgpu_crtc;
int i;
amdgpu_crtc = kzalloc(sizeof(struct amdgpu_crtc) +
(AMDGPUFB_CONN_LIMIT * sizeof(struct drm_connector *)), GFP_KERNEL);
if (amdgpu_crtc == NULL)
return -ENOMEM;
drm_crtc_init(adev->ddev, &amdgpu_crtc->... | false | false | false | false | false | 0 |
import_vc_from(const char *filename, FLAC__StreamMetadata *block, const Argument_String *vc_filename, FLAC__bool *needs_write, FLAC__bool raw)
{
FILE *f;
char line[65536];
FLAC__bool ret;
if(0 == vc_filename->value || strlen(vc_filename->value) == 0) {
flac_fprintf(stderr, "%s: ERROR: empty import file name\n", ... | true | true | false | false | false | 1 |
report_error (KKamPanel *p, char *fmt, ...)
{
va_list ap;
char *str;
va_start (ap, fmt);
str = g_strdup_vprintf (fmt, ap);
va_end (ap);
if (popup_errors)
{
GtkWidget *label, *vbox, *dialog;
dialog = gtk_dialog_new_with_buttons(_("GKrellKam warning:"),
NULL, GTK_DIALOG_DESTROY_WITH... | false | false | false | false | false | 0 |
Namespaces(void) {
NS namespaces;
if (node_ == NULL) return namespaces;
if (node_->type != XML_ELEMENT_NODE) return namespaces;
GetNamespaces(namespaces, node_);
return namespaces;
} | false | false | false | false | false | 0 |
ComputeGlobalTarget(Handle<GlobalObject> global,
Handle<String> name) {
target_ = Handle<JSFunction>::null();
cell_ = Handle<JSGlobalPropertyCell>::null();
LookupResult lookup;
global->Lookup(*name, &lookup);
if (lookup.IsProperty() &&
lookup.type() == NORMAL &&
look... | false | false | false | false | false | 0 |
slap_str2clist( char ***out, char *in, const char *brkstr )
{
char *str;
char *s;
char *lasts;
int i, j;
char **new;
/* find last element in list */
for (i = 0; *out && (*out)[i]; i++);
/* protect the input string from strtok */
str = ch_strdup( in );
if ( *str == '\0' ) {
free( str );
return( *out );
... | false | false | false | false | false | 0 |
network_assoc(void *a)
{
struct network *n = a;
if (_state.s_state != STATE_ATTACK ||
_state.s_curnet != n
|| n->n_wstate != WSTATE_AUTH)
return;
do_assoc(n, IEEE80211_FC0_SUBTYPE_ASSOC_REQ);
time_printf(V_VERBOSE, "Associating...\n");
timer_in(_conf.cf_to * 1000, network_assoc, n);
} | false | false | false | false | false | 0 |
hash_inner_and_outer(PlannerInfo *root,
RelOptInfo *joinrel,
RelOptInfo *outerrel,
RelOptInfo *innerrel,
List *restrictlist,
JoinType jointype)
{
bool isouterjoin;
List *hashclauses;
ListCell *l;
/*
* Hashjoin only supports inner, left, and IN joins.
*/
switch (jointype)
{... | false | false | false | false | false | 0 |
interpolate_trigger_get (GstTimedValueControlSource * self,
GstClockTime timestamp, gdouble * value)
{
gboolean ret = FALSE;
GSequenceIter *iter;
g_mutex_lock (&self->lock);
iter =
gst_timed_value_control_source_find_control_point_iter (self, timestamp);
if (iter) {
*value = _interpolate_trigg... | false | false | false | false | false | 0 |
setContainer(fp_Container* pContainer)
{
if (pContainer == getContainer())
{
return;
}
if (getContainer() && (pContainer != NULL))
{
xxx_UT_DEBUGMSG(("SetContainer clearScreen in fp_Line %x page %x \n",this,getPage()));
clearScreen();
}
if(pContainer != NULL)
{
getFillType().setParent(&pContainer->get... | false | false | false | false | false | 0 |
panel_menu_button_load (PanelWidget *panel,
const char *id,
GSettings *settings)
{
GSettings *settings_instance;
char *scheme;
MenuPathRoot root;
char *menu_path;
char *custom_icon;
char *tooltip;
settings_instance = panel_layout_get_instance_settings (settings,
... | false | false | false | false | false | 0 |
num_free_items(void) {
item *tmp;
int count = 0;
for (tmp = free_items; tmp; tmp = tmp->next) {
count++;
}
return count;
} | false | false | false | false | false | 0 |
drm_mode_createblob_ioctl(struct drm_device *dev,
void *data, struct drm_file *file_priv)
{
struct drm_mode_create_blob *out_resp = data;
struct drm_property_blob *blob;
void __user *blob_ptr;
int ret = 0;
if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;
blob = drm_property_create_bl... | false | false | false | false | false | 0 |
libpd_midibyte(int port, int byte) {
CHECK_PORT
CHECK_RANGE_8BIT(byte)
inmidi_byte(port, byte);
return 0;
} | false | false | false | false | false | 0 |
egg_markdown_to_text_line_is_blank (const gchar *line)
{
guint i;
guint len;
gboolean ret = FALSE;
len = egg_strlen (line, EGG_MARKDOWN_MAX_LINE_LENGTH);
/* a line with no characters is blank by definition */
if (len == 0) {
ret = TRUE;
goto out;
}
/* find if there are only space chars */
for (i=0; i<le... | false | false | false | false | false | 0 |
gnm_style_unlink (GnmStyle *style)
{
g_return_if_fail (style->link_count > 0);
d(("unlink %p = %d\n", style, style->link_count-1));
if (style->link_count-- == 1) {
sheet_style_unlink (style->linked_sheet, style);
style->linked_sheet = NULL;
gnm_style_unref (style);
}
} | false | false | false | false | false | 0 |
swsmi_rfkill_query(struct rfkill *rfkill, void *priv)
{
struct samsung_rfkill *srfkill = priv;
struct samsung_laptop *samsung = srfkill->samsung;
struct sabi_data data;
int ret;
ret = swsmi_wireless_status(samsung, &data);
if (ret)
return ;
if (srfkill->type == RFKILL_TYPE_WLAN)
ret = data.data[WL_STATUS_W... | false | false | false | false | false | 0 |
bgav_http_header_status_line(bgav_http_header_t * h)
{
if(!h->num_lines)
return NULL;
return h->lines[0].line;
} | false | false | false | false | false | 0 |
do_yyerror (YYLTYPE *loc, PARSECONTEXT *parse_context, const char *format, ...)
{
char msg[ERROR_MSG_LEN];
int len;
va_list ap;
YYLTYPE local_loc;
if (! parse_context->report_errors ) {
return;
}
if (!loc) {
local_loc = LEXER_get_location( & parse_context->lexctx );
loc = &local_loc;
}... | false | false | false | false | false | 0 |
UNLOneBusPower(void) {
uint32 i;
IRQReload = IRQCount = IRQa = 0;
memset(cpu410x, 0x00, sizeof(cpu410x));
memset(ppu201x, 0x00, sizeof(ppu201x));
memset(apu40xx, 0x00, sizeof(apu40xx));
SetupCartCHRMapping(0, PRGptr[0], PRGsize[0], 0);
for (i = 0; i < 64; i++) {
defapuread[i] = GetReadHandler(0x4... | false | false | false | false | false | 0 |
viadrv_acknowledge_irqs(drm_via_private_t *dev_priv)
{
u32 status;
if (dev_priv) {
/* Acknowledge interrupts */
status = VIA_READ(VIA_REG_INTERRUPT);
VIA_WRITE(VIA_REG_INTERRUPT, status |
dev_priv->irq_pending_mask);
}
} | false | false | false | false | false | 0 |
SortTocFromFile(Archive *AHX, RestoreOptions *ropt)
{
ArchiveHandle *AH = (ArchiveHandle *) AHX;
FILE *fh;
char buf[1024];
char *cmnt;
char *endptr;
DumpId id;
TocEntry *te;
/* Allocate space for the 'wanted' array, and init it */
ropt->idWanted = (bool *) malloc(sizeof(bool) * AH->maxDumpId);
m... | true | true | true | false | true | 1 |
parse(std::istream& prg, ProgramBuilder& api) {
clear();
api_ = &api;
if (!prg) {
throw ReadError(0, "Could not read from stream!");
}
StreamSource source(prg);
source_ = &source;
return readRules()
&& readSymbolTable()
&& readComputeStatement()
&& readModels()
&& endParse();
} | false | false | false | false | false | 0 |
H5F_block_write(const H5F_t *f, H5FD_mem_t type, haddr_t addr, size_t size,
hid_t dxpl_id, const void *buf)
{
H5F_io_info_t fio_info; /* I/O info for operation */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
#ifdef QAK
HDfprintf(stderr, "%s: write to addr = ... | false | false | false | false | false | 0 |
slab_attr_store(struct kobject *kobj,
struct attribute *attr,
const char *buf, size_t len)
{
struct slab_attribute *attribute;
struct kmem_cache *s;
int err;
attribute = to_slab_attr(attr);
s = to_slab(kobj);
if (!attribute->store)
return -EIO;
err = attribute->store(s, buf, len);
#ifdef CONFIG_MEMC... | false | false | false | false | false | 0 |
prepareProgram() {
assert(!frozen_);
transformExtended();
if (eqOpts_.normalize) { normalize(); }
stats.atoms = numAtoms() - (startAtom()-1);
stats.bodies= numBodies();
updateFrozenAtoms();
frozen_ = true;
if (atoms_[0]->value() == value_true) { return false; }
Preprocessor p;
p.enableBackprop(eqOpts_.backpro... | false | false | false | false | false | 0 |
starmap_new(PyTypeObject *type, PyObject *args, PyObject *kwds)
{
PyObject *func, *seq;
PyObject *it;
starmapobject *lz;
if (type == &starmap_type && !_PyArg_NoKeywords("starmap()", kwds))
return NULL;
if (!PyArg_UnpackTuple(args, "starmap", 2, 2, &func, &seq))
return NULL;
/*... | false | false | false | false | false | 0 |
maybe_change_selected_ship(int offset)
{
int ship_class;
ship_class = ss_get_ship_class_from_list(offset);
if ( ship_class == -1 )
return;
if ( Ss_mouse_down_on_region != (SHIP_SELECT_ICON_0+offset) ) {
return;
}
if ( Selected_ss_class == -1 ) {
Selected_ss_class = ship_class;
start_ship_animation(Sele... | false | false | false | false | false | 0 |
try_all_codes(const pquad* pq,
const int* fieldstars, int dimquad,
solver_t* solver, double tol2) {
int dimcode = (dimquad - 2) * 2;
double code[DCMAX];
double flipcode[DCMAX];
int i;
solver->numtries++;
debug(" trying quad [");
for (i=0; i... | false | false | false | false | true | 1 |
send_req(DBusMessage *req, int verbose)
{
DBusMessage *rep;
DBusError err;
memset(&err, 0, sizeof(err));
rep = dbus_connection_send_with_reply_and_block(globals.conn, req,
30 * 1000, &err);
if (rep == NULL) {
if (dbus_error_is_set(&err)) {
if (err.name != NULL) {
if ((print_hint(err.name,
err... | false | false | false | false | false | 0 |
DeleteFeature( long nFID )
{
GetLayerDefn();
if( pszFIDColumn == NULL )
{
CPLError( CE_Failure, CPLE_AppDefined,
"DeleteFeature() without any FID column." );
return OGRERR_FAILURE;
}
if( nFID == OGRNullFID )
{
CPLError( CE_Failu... | 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.