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 |
|---|---|---|---|---|---|---|
timing_event_stop(char *event_name)
{
#ifndef USE_TIMING
return;
#else
int event;
// sanity
if(event_name == NULL){
return;
}
// try and find the event
event = timing_event_lookup(event_name);
// if we already have one
if(event != -1){
Assert(Timing_events[event].ref_count == 1);
Timing_events[event].... | false | false | false | false | false | 0 |
listcharsets(void) {
int i = 0, c;
do {
c = charset_localenc_nth(i);
if (c == CS_NONE) break;
printf("%s\n", charset_to_localenc(c));
i++;
} while (1);
} | false | false | false | false | false | 0 |
read_essence_container_data(bgav_input_context_t * input,
partition_t * ret, mxf_metadata_t * m,
int tag, int size, uint8_t * uid)
{
mxf_essence_container_data_t * d = (mxf_essence_container_data_t *)m;
switch(tag)
{
case 0x270... | false | false | false | false | false | 0 |
__reverse_ulong(unsigned char *str)
{
unsigned long tmp = 0;
int shift = 24, idx = 0;
#if BITS_PER_LONG == 64
shift = 56;
#endif
while (shift >= 0) {
tmp |= (unsigned long)str[idx++] << shift;
shift -= BITS_PER_BYTE;
}
return tmp;
} | false | false | false | false | false | 0 |
radeon_sync_fence(struct radeon_sync *sync,
struct radeon_fence *fence)
{
struct radeon_fence *other;
if (!fence)
return;
other = sync->sync_to[fence->ring];
sync->sync_to[fence->ring] = radeon_fence_later(fence, other);
if (fence->is_vm_update) {
other = sync->last_vm_update;
sync->last_vm_updat... | false | false | false | false | false | 0 |
writeToStream(mrpt::utils::CStream &out,int *version) const
{
if (version)
*version = 1;
else
{
writeToStreamRender(out);
out << m_radius;
out << (uint32_t)m_nDivsLongitude << (uint32_t)m_nDivsLatitude
<< m_keepRadiusIndependentEyeDistance;
}
} | false | false | false | false | false | 0 |
listGet(List root, int n)
{
int i;
for (i = 0; i <= n; ++i) /* intentional apparent off-by-one! */
{
root = listNext(root);
if (root == NULL)
return NULL; /* out-of-list exception */
}
return root;
} | false | false | false | false | false | 0 |
_trace_func_name (SQLUSMALLINT fFunc, int format)
{
char *ptr = "unknown function";
switch (fFunc)
{
/* All ODBC 2.x functions */
_S (SQL_API_ALL_FUNCTIONS);
/* ODBC 2.x */
_S (SQL_API_SQLALLOCCONNECT);
_S (SQL_API_SQLALLOCENV);
_S (SQL_API_SQLALLOCSTMT);
_S (SQL_API_SQLBINDCOL);... | false | false | false | false | false | 0 |
AnnoyingDlgReturnToString(const wxString& caption)
{
std::map<wxString, wxString>::const_iterator it = m_AnnoyingDlgReturnMap.find(caption.AfterLast(wxT(':')));
if (it != m_AnnoyingDlgReturnMap.end())
return caption.BeforeLast(wxT(':')) + wxT(':') + it->second;
return caption;
} | false | false | false | false | false | 0 |
akiko_nvram_write (int offset, uae_u32 v)
{
int sda;
switch (offset)
{
case 0:
oscl = scl_out;
scl_out = (v & 0x80) ? 1 : 0;
osda = sda_out;
sda_out = (v & 0x40) ? 1 : 0;
break;
case 2:
scl_dir = (v & 0x80) ? 1 : 0;
sda_dir = (v & 0x40) ? 1 : 0;
break;
default:
return;
}
sda = sda_out;
if (os... | false | false | false | false | false | 0 |
ajAtomListCopy(AjPList *Pto, const AjPList from)
{
AjIList iter = NULL;
AjPAtom hit = NULL;
AjPAtom new = NULL;
/* Check arg's */
if (!from || !Pto)
{
ajWarn("Bad arg's passed to ajAtomListCopy\n");
return ajFalse;
}
/* Allocate the new list, if necessary */
if (!*P... | false | false | false | false | false | 0 |
ocfs2_validate_meta_ecc(struct super_block *sb, void *data,
struct ocfs2_block_check *bc)
{
int rc = 0;
struct ocfs2_super *osb = OCFS2_SB(sb);
if (ocfs2_meta_ecc(osb))
rc = ocfs2_block_check_validate(data, sb->s_blocksize, bc,
&osb->osb_ecc_stats);
return rc;
} | false | false | false | false | false | 0 |
readFromStream(void *context, char *buffer, int len)
{
try
{
WPXInputStream *const input = reinterpret_cast<WPXInputStream *>(context);
unsigned long bytesRead = 0;
const unsigned char *const bytes = input->read(len, bytesRead);
std::memcpy(buffer, bytes, static_cast<int>(bytesRead));
return s... | false | false | false | false | false | 0 |
copy_skel_dir( const char *src, /*source directory*/
const char *dest, /*destination directory*/
const struct stat *st, /*stat of source directory*/
uid_t uid,
gid_t gid )
{
char sdent[ PATH_MAX+1 ]; /*source directory entry*/
char ddent[ PATH_MAX+1 ]; /*destination directory entry*/
struct stat sden... | true | true | false | false | true | 1 |
dm_StrCopyOut2_W2A (
SQLWCHAR * inStr,
SQLCHAR * outStr,
SQLSMALLINT size,
SQLSMALLINT * result)
{
size_t length;
if (!inStr)
return -1;
length = wcslen (inStr);
if (result)
*result = (SQLSMALLINT) length;
if (!outStr)
return 0;
if (size >= length + 1)
{
if (length > 0)
... | false | false | false | false | false | 0 |
count_nonsticky_in_hashtab(void *arg)
{
WinData *win = (WinData *)arg;
WinManager *man = the_manager;
if (!(IS_STICKY_ACROSS_DESKS(win) || IS_STICKY_ACROSS_PAGES(win)) &&
!(WINDATA_ICONIFIED(win) && (IS_ICON_STICKY_ACROSS_PAGES(win) ||
IS_ICON_STICKY_ACROSS_DESKS(win))) &&
win->complete && win->manag... | false | false | false | false | false | 0 |
grecs_txtacc_cur_entry(struct grecs_txtacc *acc)
{
struct grecs_txtacc_entry *ent;
if (grecs_list_size(acc->cur) == 0)
return grecs_txtacc_alloc_entry(acc->cur,
GRECS_TXTACC_BUFSIZE);
ent = acc->cur->tail->data;
if (grecs_txtacc_entry_freesize(ent) == 0)
ent = grecs_txtacc_alloc_entry(acc->cur,
... | false | false | false | false | false | 0 |
intel_blit_framebuffer_with_blitter(struct gl_context *ctx,
GLint srcX0, GLint srcY0,
GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0,
GLint dstX1, GLint dstY1,
... | false | false | false | false | false | 0 |
add_tchk_chged(struct chktchg_t *chkchgp)
{
struct tc_pendlst_t *tcpendp;
/* get a list element from somewhere */
if (__tcpendfreelst == NULL)
tcpendp = (struct tc_pendlst_t *) __my_malloc(sizeof(struct tc_pendlst_t));
else
{
tcpendp = __tcpendfreelst;
__tcpendfreelst = __tcpendfreelst->tc_plnxt;
}
tc... | false | false | false | false | false | 0 |
SendListToServer(){
std::vector<CKnownFile*> SortedList;
{
wxMutexLocker lock(list_mut);
if (m_Files_map.empty() || !theApp->IsConnectedED2K() ) {
return;
}
// Getting a sorted list of the non-published files.
SortedList.reserve( m_Files_map.size() );
CKnownFileMap::iterator it = m_Files_map.begin... | false | false | false | true | false | 1 |
WriteFileEntries()
/*
* FUNCTION: Writes file entries for all files
* RETURNS:
* Status of operation
*/
{
PCFFILE_NODE File;
ULONG BytesWritten;
bool SetCont = false;
DPRINT(MAX_TRACE, ("Writing file table.\n"));
File = FileListHead;
while (File != NULL)
{
if (File->Commit)... | false | false | false | false | false | 0 |
cubicspline_irreg_reg_nonans(
int nin, double *xi,
double *yi,
int nout, double xo0, double dxo,
enum boundary_mode mode, ...)
{
va_list ap;
double *tmpVals = NULL,
*x = NULL,
*y = NULL;
double y1start = 0.0;
double y1end = 0.0;
int new_size = 0;... | false | false | false | false | false | 0 |
logfs_exist_loop(struct inode *inode, u64 bix)
{
struct logfs_inode *li = logfs_inode(inode);
u64 bofs = li->li_data[INDIRECT_INDEX];
level_t level;
int ret;
struct page *ipage;
if (!bofs)
return 0;
if (bix >= maxbix(li->li_height))
return 0;
for (level = LEVEL(li->li_height); level != 0; level = SUBLEVEL... | false | false | false | false | false | 0 |
get_textobject(sharedptr<LayoutItem_Text>& textobject) const
{
textobject->set_title(m_entry_title->get_text(), AppWindow::get_current_locale());
textobject->set_text( m_text_view->get_buffer()->get_text(), AppWindow::get_current_locale());
}
} | false | false | false | false | false | 0 |
H5D_get_space(H5D_t *dset)
{
H5S_t *space = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER_NOAPI_NOINIT
/* Read the data space message and return a data space object */
if(NULL == (space = H5S_copy(dset->shared->space, FALSE, TRUE)))
HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to ... | false | false | false | false | false | 0 |
nautilus_list_model_ptr_to_iter (NautilusListModel *model, GSequenceIter *ptr, GtkTreeIter *iter)
{
g_assert (!g_sequence_iter_is_end (ptr));
if (iter != NULL) {
iter->stamp = model->details->stamp;
iter->user_data = ptr;
}
} | false | false | false | false | false | 0 |
validate_allowed_keysalts(const char *allowed_keysalts)
{
kadm5_ret_t ret;
krb5_key_salt_tuple *ks_tuple = NULL;
krb5_int32 n_ks_tuple = 0;
if (strchr(allowed_keysalts, '\t') != NULL)
return KADM5_BAD_KEYSALTS;
ret = krb5_string_to_keysalts(allowed_keysalts, ",", ":.-", 0,
... | false | false | false | false | false | 0 |
Init_Type() {
int i, bytes;
char *p;
Num_Types = (sizeof(builtin_types) - 1) / sizeof(char *);
Max_Type = Num_Types + TYPE_GROW;
bytes = Max_Type * sizeof(TYPEDESCR);
Types = (TYPEDESCR *)Safe_Malloc(bytes);
memset(Types, 0, bytes);
for (i = 0; (p = builtin_types[i]); i++) {
Typ... | false | false | false | false | false | 0 |
ast_cc_callback(struct ast_channel *inbound, const char * const tech, const char * const dest, ast_cc_callback_fn callback)
{
const struct ast_channel_tech *chantech = ast_get_channel_tech(tech);
if (chantech && chantech->cc_callback) {
chantech->cc_callback(inbound, dest, callback);
}
return 0;
} | false | false | false | false | false | 0 |
assign_syslog_facility(int newval, void *extra)
{
#ifdef HAVE_SYSLOG
set_syslog_parameters(syslog_ident_str ? syslog_ident_str : "postgres",
newval);
#endif
/* Without syslog support, just ignore it */
} | false | false | false | false | false | 0 |
afr_rmdir_unwind (call_frame_t *frame, xlator_t *this)
{
call_frame_t *main_frame = NULL;
afr_local_t *local = NULL;
local = frame->local;
LOCK (&frame->lock);
{
if (local->transaction.main_frame) {
main_frame = local->transaction.main_f... | false | false | false | false | false | 0 |
GetNextNick( const CString & nick )
{
CString s;
m_Mutex.Lock();
if ( ! m_MyInfoMap.empty() )
{
MyInfoMap::iterator it;
if ( nick.IsEmpty() )
{
it = m_MyInfoMap.begin();
s = it->first;
}
else
{
it = m_MyInfoMap.find(nick);
if ( it != m_MyInfoMap.end() )
{
++it;
if ( it ... | false | false | false | false | false | 0 |
OnRightButtonUp()
{
if ( this->State == vtkBrokenLineWidget::Outside ||
this->State == vtkBrokenLineWidget::Start )
{
return;
}
if ( this->State == vtkBrokenLineWidget::Inserting )
{
this->InsertHandleOnLine( this->LastPickPosition );
}
else if ( this->State == vtkBrokenLineWidget:... | false | false | false | false | false | 0 |
mca_pml_bfo_recv_frag_callback_fin(mca_btl_base_module_t* btl,
mca_btl_base_tag_t tag,
mca_btl_base_descriptor_t* des,
void* cbdata ) {
mca_btl_base_segment_t* segments = des->des_dst;
mca_pm... | false | false | false | false | false | 0 |
Gchangecase(symb)
truc symb;
{
ifun chfun;
char *str;
unsigned k, len;
int flg, ch;
flg = *FLAGPTR(argStkPtr);
chfun = (symb == toupsym ? toupcase : tolowcase);
if(flg == fCHARACTER || flg == fFIXNUM) {
ch = *WORD2PTR(argStkPtr);
return(mkchar(chfun(ch)));
}
else if... | false | false | false | false | false | 0 |
gamgi_global_selection_update_windows (gamgi_dlist **start, char *label)
{
gamgi_window *window;
/*******************************************
* update all windows for one object label *
*******************************************/
for (window = gamgi->window_start; window != NULL; window = window->next)
gamgi_glo... | false | false | false | false | false | 0 |
insert(le_int32 position, le_int32 count, LEErrorCode &success)
{
if (LE_FAILURE(success)) {
return 0;
}
InsertionRecord *insertion = (InsertionRecord *) LE_NEW_ARRAY(char, sizeof(InsertionRecord) + (count - ANY_NUMBER) * sizeof (LEGlyphID));
if (insertion == NULL) {
success = LE_MEMOR... | false | false | false | false | false | 0 |
prepare_before_connected_before_async (TpProxy *proxy,
const TpProxyFeature *feature,
GAsyncReadyCallback callback,
gpointer user_data)
{
TpTestsMyConnProxy *self = (TpTestsMyConnProxy *) proxy;
GSimpleAsyncResult *result;
g_assert (tp_proxy_is_prepared (proxy, TP_TESTS_MY_CONN_PROXY_FEATURE_CORE));
... | false | false | false | false | false | 0 |
add_general(int generalUnitRecno)
{
if(monster_general_count>=MAX_MONSTER_GENERAL_IN_FIRM)
return;
Unit* unitPtr = unit_array[generalUnitRecno];
UnitInfo* unitInfo = unit_res[unitPtr->unit_id];
MonsterInFirm* monsterInFirm = monster_general_array+monster_general_count;
monsterInFirm->monster_id = unitPt... | false | false | false | false | false | 0 |
recorre_lista(struct my_pack *init )
{
struct router *cursor = init->router;
struct in_addr direc;
while(cursor)
{
direc.s_addr = cursor->address;
fprintf(stdout, " -> Router = %s - Pref = %ld\n", inet_ntoa(direc),
cursor->pref);
cursor = cursor->next;
}
} | false | false | false | false | false | 0 |
add_reloption_kind(void)
{
/* don't hand out the last bit so that the enum's behavior is portable */
if (last_assigned_kind >= RELOPT_KIND_MAX)
ereport(ERROR,
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
errmsg("user-defined relation parameter types limit exceeded")));
last_assigned_kind <<= 1;
return (relopt... | false | false | false | false | false | 0 |
preorderNonRecursive(BinarySearchTreeNode* root) {
BinarySearchTreeNode* current = root;
while (current) {
if (!current->visited) {
current->print();
current->visited = true;
}
if (current->left && !current->left->visited) {
current = current->left;
... | false | false | false | true | false | 1 |
arm_no_early_mul_dep (rtx producer, rtx consumer)
{
rtx value = PATTERN (producer);
rtx op = PATTERN (consumer);
if (GET_CODE (value) == COND_EXEC)
value = COND_EXEC_CODE (value);
if (GET_CODE (value) == PARALLEL)
value = XVECEXP (value, 0, 0);
value = XEXP (value, 0);
if (GET_CODE (op) == COND_EXE... | false | false | false | false | false | 0 |
gnucash_sheet_get_header_widths (GnucashSheet *sheet,
GNCHeaderWidths widths)
{
SheetBlockStyle *style;
CellBlock *header;
int row, col;
g_return_if_fail (sheet != NULL);
g_return_if_fail (GNUCASH_IS_SHEET(sheet));
style = gnucash_sheet_get_style_from_cursor (s... | false | false | false | false | false | 0 |
HtmlDrawImage(
pCanvas, pImage,
x, y, w, h,
pNode,
size_only
)
HtmlCanvas *pCanvas;
HtmlImage2 *pImage; /* Image name or NULL */
HtmlNode *pNode;
int x;
int y;
int w; /* Width of image */
int h; /* Hei... | false | false | false | false | false | 0 |
cpy_struct(char *dest, char *src, int num, MPI_Datatype dtype)
{
MPI_Aint *disp; /* ptr displacements */
MPI_Datatype *type; /* ptr datatypes */
int *len; /* ptr lengths */
int extent; /* datatype extent */
int i, j;
extent = dtype->dt_upper - dtype->dt_lower;
for (i = 0; i < num; ++i, src += extent... | false | false | false | false | false | 0 |
igb_ndo_set_vf_bw(struct net_device *netdev, int vf,
int min_tx_rate, int max_tx_rate)
{
struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
int actual_link_speed;
if (hw->mac.type != e1000_82576)
return -EOPNOTSUPP;
if (min_tx_rate)
return -EINVAL;
actual_link_sp... | false | false | false | false | false | 0 |
zx_DEC_ELEM_xa_Condition(struct zx_ctx* c, struct zx_xa_Condition_s* x)
{
struct zx_elem_s* el = x->gg.kids;
switch (el->g.tok) {
case zx_xa_Expression_ELEM:
if (!x->Expression)
x->Expression = el;
return 1;
default: return 0;
}
} | false | false | false | false | false | 0 |
toIcon(GMCover * cover) {
if (cover) {
FXImage * image = GMCover::toImage(cover);
if (image) {
FXIcon * icon = new FXIcon(FXApp::instance(),image->getData(),0,IMAGE_OWNED,image->getWidth(),image->getHeight());
FXImageOwner::clear(image);
delete image;
return icon;
}
}
retur... | false | false | false | false | false | 0 |
release_componentid ( struct slapi_componentid * id )
{
if ( id ) {
if ( id->sci_component_name ) {
slapi_ch_free((void **)&id->sci_component_name);
id->sci_component_name=NULL;
}
slapi_ch_free((void **)&id);
... | false | false | false | false | false | 0 |
processLine(imap &imapAccount,
vector<const char *> &words)
{
if (words.size() >= 3 && strcmp(words[0], "*") == 0 &&
strcasecmp(words[1], "ACL") == 0)
{
rights=words[2];
return true;
}
return smapHandler::processLine(imapAccount, words);
} | false | false | false | false | false | 0 |
snd_usb_substream_playback_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct snd_usb_substream *subs = substream->runtime->private_data;
switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
subs->trigger_tstamp_pending_update = true;
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
subs->data_endpoint->pr... | false | false | false | false | false | 0 |
cha_read_grammar(FILE * fp_out, int ret, int dir)
{
FILE *fp;
char *filepath;
fp = cha_fopen_grammar(GRAMMAR_FILE, "r", ret, dir, &filepath);
if (fp_out != NULL)
fprintf(fp_out, "parsing %s\n", filepath);
cha_read_class(fp);
fclose(fp);
} | false | false | false | false | false | 0 |
processLexicalBlock(DILexicalBlock LB) {
DIScope Context = LB.getContext();
if (Context.isLexicalBlock())
return processLexicalBlock(DILexicalBlock(Context));
else if (Context.isLexicalBlockFile()) {
DILexicalBlockFile DBF = DILexicalBlockFile(Context);
return processLexicalBlock(DILexicalBlock(DBF.ge... | false | false | false | false | false | 0 |
canSample(StochasticNode *snode, Graph const &graph)
{
switch (getDist(snode)) {
case GAMMA: case EXP: case CHISQ:
//The exponential and chisquare distributions are both special
//cases of the gamma distribution and are handled by the conjugate
//gamma method.
break;
default:
return false;
}
G... | false | false | false | false | false | 0 |
ReadBufferFromSocket(void *buffer, size_t required_len)
{
wxASSERT(required_len);
if (m_curr_rx_data->GetUnreadDataLength() < required_len) {
// need more data that we have. Looks like nothing will help here
AddDebugLogLineN(logEC, CFormat(wxT("ReadBufferFromSocket: not enough data (%d < %d)"))
% m_curr_rx_d... | false | false | false | false | false | 0 |
update_source(struct source *src,
unsigned short seqno, unsigned short metric)
{
if(metric >= INFINITY)
return;
/* If a source is expired, pretend that it doesn't exist and update
it unconditionally. This makes ensures that old data will
eventually be overridden, and preven... | false | false | false | false | false | 0 |
week_day_range_list(lList **wdrl) {
lListElem *tmr;
DENTER(TOP_LAYER, "week_day_range_list");
if (week_day_range(&tmr)) {
DRETURN(-1);
}
if (wdrl) {
*wdrl = lCreateList("week_day_range_list", TMR_Type);
lAppendElem(*wdrl, tmr);
split_wday_range(*wdrl, tmr);
}
while ... | false | false | false | false | false | 0 |
bundle_setlocale(struct SRBRoot *bundle, UChar *locale, UErrorCode *status) {
if(U_FAILURE(*status)) {
return;
}
if (bundle->fLocale!=NULL) {
uprv_free(bundle->fLocale);
}
bundle->fLocale= (char*) uprv_malloc(sizeof(char) * (u_strlen(locale)+1));
if(bundle->fLocale == NULL) {... | true | true | false | false | false | 1 |
CreateMetropolisRenderer(const ParamSet ¶ms,
Camera *camera) {
float largeStepProbability = params.FindOneFloat("largestepprobability", .25f);
int perPixelSamples = params.FindOneInt("samplesperpixel", 100);
int nBootstrap = params.FindOneInt("bootstrapsamples", 100000);
int nDirectPixelSamp... | false | false | false | false | false | 0 |
ftruncate2 (const cl_F& x)
{
#if 0 // 3 type dispatches
var cl_F q = ftruncate(x);
return cl_F_fdiv_t(q,x-q);
#else // 1 type dispatch
floatcase(x
, var cl_SF q = ftruncate(x); return cl_F_fdiv_t(q,x-q);
, var cl_FF q = ftruncate(x); return cl_F_fdiv_t(q,x-q);
, var cl_DF q = ftruncate(x); return cl_F_fdiv_t(q,x-... | false | false | false | false | false | 0 |
_free_all_outgoing_msgs(List msg_queue, stepd_step_rec_t *job)
{
ListIterator msgs;
struct io_buf *msg;
msgs = list_iterator_create(msg_queue);
while((msg = list_next(msgs))) {
_free_outgoing_msg(msg, job);
}
list_iterator_destroy(msgs);
} | false | false | false | false | false | 0 |
log_hexdump(int level, const void *data, size_t length)
{
const unsigned char *p = data;
size_t row;
char line[80];
if (level > verbose)
return;
for (row = 0; row < length; row += 0x10) {
hexdump_line(line, row, p + row,
min_size_t(0x10, length - row));
... | false | false | false | false | false | 0 |
init_tmds_reg(struct nvbios_init *init, u8 tmds)
{
/* For mlv < 0x80, it is an index into a table of TMDS base addresses.
* For mlv == 0x80 use the "or" value of the dcb_entry indexed by
* CR58 for CR57 = 0 to index a table of offsets to the basic
* 0x6808b0 address.
* For mlv == 0x81 use the "or" value of the... | false | false | false | false | false | 0 |
drop_rg(char *hdtxt, rghash_t h, int *len)
{
char *p = hdtxt, *q, *r, *s;
kstring_t str;
memset(&str, 0, sizeof(kstring_t));
while (1) {
int toprint = 0;
q = strchr(p, '\n');
if (q == 0) q = p + strlen(p);
if (q - p < 3) break; // the line is too short; then stop
if (strncmp(p, "@RG\t", 4) == 0) {
int ... | false | false | false | false | false | 0 |
get_hwtype (char * dev) {
int sock;
struct ifreq ifr;
int type = -1;
if ( (sock = socket(AF_UNIX, SOCK_STREAM, 0)) != -1 ) {
strcpy(ifr.ifr_name, dev);
if ( ioctl(sock, SIOCGIFHWADDR, &ifr) == 0)
type = ifr.ifr_hwaddr.sa_family;
close(sock);
}
switch (type) {
// supported by current kernel:
case ... | false | false | false | false | false | 0 |
finishNode(node_t * n)
{
char buf [40];
if (N_fontsize) {
char* str = agxget(n, N_fontsize);
if (*str == '\0') {
sprintf (buf, "%.03f", ND_ht(n)*0.7);
agxset(n, N_fontsize, buf);
}
}
common_init_node (n);
} | true | true | false | false | false | 1 |
remove_fallthru_edge (vec<edge, va_gc> *ev)
{
edge_iterator ei;
edge e;
FOR_EACH_EDGE (e, ei, ev)
if ((e->flags & EDGE_FALLTHRU) != 0)
{
remove_edge_and_dominated_blocks (e);
return true;
}
return false;
} | false | false | false | false | false | 0 |
read_pwm(struct budget* budget)
{
u8 b = 0xff;
u8 pwm;
struct i2c_msg msg[] = { { .addr = 0x50,.flags = 0,.buf = &b,.len = 1 },
{ .addr = 0x50,.flags = I2C_M_RD,.buf = &pwm,.len = 1} };
if ((i2c_transfer(&budget->i2c_adap, msg, 2) != 2) || (pwm == 0xff))
pwm = 0x48;
return pwm;
} | false | false | false | false | false | 0 |
close_file_entry (NODE_T *p, int k)
{
if (k >= 0 && k < MAX_OPEN_FILES) {
FILE_ENTRY *fe = &(file_entries[k]);
if (IS_OPEN (fe)) {
/* Close the file */
if (FD (fe) != A68_NO_FILENO && close (FD (fe)) == -1) {
init_file_entry (k);
diagnostic_node (A68_RUNTIME_ERROR, p, ERROR_FILE_CLOSE);
... | false | false | false | false | false | 0 |
main(int argc, char *argv[]) {
struct sigaction act;
int argn = 1, ret;
{
const char *home = getenv("HOME");
if (home) {
char *conffile = xmalloc(strlen(home) + sizeof(CONFIG_FILE) + 2);
strcpy(conffile, home);
strcat(conffile, "/" CONFIG_FILE);
xconfig_parse_file(evilwm_options, conffile);
free(... | false | false | false | false | false | 0 |
game_position_rab_solve (const GamePosition *const root,
const gchar *const log_file,
const int repeats)
{
ExactSolution* result = NULL;
int n;
if (repeats < 1) {
n = 1;
} else {
n = repeats;
}
log_env = game_tree_log_init(log_file);
if (log_env... | false | false | false | false | false | 0 |
IsAWordChar(int ch, bool sqlAllowDottedWord) {
if (!sqlAllowDottedWord)
return (ch < 0x80) && (isalnum(ch) || ch == '_');
else
return (ch < 0x80) && (isalnum(ch) || ch == '_' || ch == '.');
} | false | false | false | false | false | 0 |
bcm_sf2_sw_get_ethtool_stats(struct dsa_switch *ds,
int port, uint64_t *data)
{
struct bcm_sf2_priv *priv = ds_to_priv(ds);
const struct bcm_sf2_hw_stats *s;
unsigned int i;
u64 val = 0;
u32 offset;
mutex_lock(&priv->stats_mutex);
/* Now fetch the per-port counters */
for (i = 0; i < BCM_SF2_STATS_SIZE;... | false | false | false | false | false | 0 |
Curl_pretransfer(struct SessionHandle *data)
{
CURLcode result;
if(!data->change.url) {
/* we can't do anything without URL */
failf(data, "No URL set!");
return CURLE_URL_MALFORMAT;
}
/* Init the SSL session ID cache here. We do it here since we want to do it
after the *_setopt() calls (that ... | false | false | false | false | false | 0 |
media_volume_compare (gconstpointer a, gconstpointer b)
{
OsinfoMedia *media_a = OSINFO_MEDIA(a);
OsinfoMedia *media_b = OSINFO_MEDIA(b);
const gchar *volume_a = osinfo_media_get_volume_id(media_a);
const gchar *volume_b = osinfo_media_get_volume_id(media_b);
if (volume_a == NULL || volume_b == NUL... | false | false | false | false | false | 0 |
overcount(I*m,I n) {I c=0,p=0;DO(n, if( WORD_START(m[i]) && !(m[i]==p && GREEDY_START(p))){p=m[i];c++;}) R c; } | false | false | false | false | false | 0 |
scatter_random(int i, int j, int icell)
{
double mag_delv,cos_phi,cos_squared,r,theta;
double delv[3],vcm[3];
double *vi = atom->v[i];
double *vj = atom->v[j];
subtract3d(vi,vj,delv);
if (itype == jtype) mag_delv = sqrt(dot3d(delv,delv))*0.5;
else mag_delv = sqrt(dot3d(delv,delv));
cos_phi = 1.0 - (2.... | false | false | false | false | false | 0 |
end_board ()
{
if(gcomprisBoard!=NULL)
{
pause_board(TRUE);
gc_score_end();
click_on_letter_destroy_all_items();
g_strfreev(answers);
g_strfreev(questions);
g_object_unref(carriage_svg_handle);
g_object_unref(cloud_svg_handle);
clear_levels();
}
gc_locale_set... | false | false | false | false | false | 0 |
test_revwalk_signatureparsing__initialize(void)
{
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
cl_git_pass(git_revwalk_new(&_walk, _repo));
} | false | false | false | false | false | 0 |
rocker_port_internal_vlan_id_put(const struct rocker_port *rocker_port,
int ifindex)
{
struct rocker *rocker = rocker_port->rocker;
struct rocker_internal_vlan_tbl_entry *found;
unsigned long lock_flags;
unsigned long bit;
spin_lock_irqsave(&rocker->internal_vlan_tbl_lock, lock_flags);
found = rocker_inter... | false | false | false | false | false | 0 |
dissect_p1_MTAName(gboolean implicit_tag _U_, tvbuff_t *tvb _U_, int offset _U_, asn1_ctx_t *actx _U_, proto_tree *tree _U_, int hf_index _U_) {
#line 695 "../../asn1/p1/p1.cnf"
tvbuff_t *mtaname = NULL;
p1_address_ctx_t* ctx = (p1_address_ctx_t*)actx->subtree.tree_ctx;
offset = dissect_ber_constrained_restricted... | false | false | false | false | false | 0 |
Cell_I_print(Cell_I C){
int i,j;
#ifdef LOG_PRINT
fprintf(msd_out,"[")
#endif
;
for(i=1;i<=C_r(C);i++){
for(j=0;j<=C_type(C,i);j++){
#ifdef LOG_PRINT
fprintf(msd_out,"%d",C_idx(C,i,j))
#endif
;
if (j<C_type(C,i))
#ifdef LOG_PRINT
fprintf(msd_out,", ")
#endif
;
}
if (i<C_r(C))
#ifdef LOG_PRINT
... | false | false | false | false | false | 0 |
gnome_scan_plugin_params_add (GnomeScanPlugin *plugin, GParamSpec *param)
{
g_return_if_fail (GNOME_IS_SCAN_PLUGIN (plugin));
g_param_spec_pool_insert (plugin->params, param, G_OBJECT_TYPE (plugin));
gnome_scan_plugin_params_changed (plugin, param);
} | false | false | false | true | false | 1 |
mlnx_ext_port_info(ib_portid_t * dest, char **argv, int argc)
{
char buf[2300];
char data[IB_SMP_DATA_SIZE];
int portnum = 0;
if (argc > 0)
portnum = strtol(argv[0], 0, 0);
if (!smp_query_via(data, dest, IB_ATTR_MLNX_EXT_PORT_INFO, portnum, 0, srcport))
return "Mellanox ext port info query failed";
mad_dum... | false | false | false | false | false | 0 |
_ml_Sock_getpeername (ml_state_t *msp, ml_val_t arg)
{
char addr[MAX_SOCK_ADDR_SZB];
socklen_t addrLen = MAX_SOCK_ADDR_SZB;
if (getpeername (INT_MLtoC(arg), (struct sockaddr *)addr, &addrLen) < 0)
return RAISE_SYSERR(msp, sts);
else {
ml_val_t cdata = ML_CData(msp, addr, addrLen);
ml_val_t r... | false | false | false | false | false | 0 |
qexp(NUMBER *q, NUMBER *epsilon)
{
long m, n;
NUMBER *tmp1, *tmp2;
if (qiszero(epsilon)) {
math_error("Zero epsilon value for exp");
/*NOTREACHED*/
}
if (qiszero(q))
return qlink(&_qone_);
tmp1 = qmul(q, &_qlge_);
m = qtoi(tmp1); /* exp(q) < 2^(m+1) or m == MAXLONG */
qfree(tmp1);
if (m > (1 << 30))
... | false | false | false | false | false | 0 |
filename_generate(char *filepath, const char *dir, const char *base,
const char *ext)
{
int len = 0;
if (filepath)
filepath[0] = '\0';
if (dir)
{
if (filepath)
{
strcat(filepath, dir);
strcat(filepath, "/");
}
len += my_strlen(dir) + 1;
}
if (base)
{
if (filepath)
strc... | false | false | false | false | false | 0 |
hash_iterator_init_range (struct hash *hash,
struct hash_iterator *hi,
bool autolock,
int start_bucket,
int end_bucket)
{
if (end_bucket > hash->n_buckets)
end_bucket = hash->n_buckets;
ASSERT (start_bucket >= 0 && start_bucket <= end_bucket);
hi->hash = hash;
hi->elem ... | false | false | false | false | false | 0 |
operator<<(ostream& o, const Point& P)
{
vector<parameter_t> w;
P.GetAllWeights(w);
for (unsigned int i = 0; i < Point::m_pdim; i++) {
o << w[i] << " ";
}
return o;
} | false | false | false | false | false | 0 |
test_status_submodules__api(void)
{
git_submodule *sm;
cl_assert(git_submodule_lookup(NULL, g_repo, "nonexistent") == GIT_ENOTFOUND);
cl_assert(git_submodule_lookup(NULL, g_repo, "modified") == GIT_ENOTFOUND);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
cl_assert(sm != NULL);
cl_assert_equal_s(... | false | false | false | false | false | 0 |
getOffsetLog(UT_uint32 iVisOff) const
{
if(getVisDirection() == UT_BIDI_RTL) //rtl needs translation
{
return(getBlockOffset() + getLength() - iVisOff + getBlockOffset() - 1);
}
else return (iVisOff);
} | false | false | false | false | false | 0 |
_dbus_string_get_length (const DBusString *str)
{
DBUS_CONST_STRING_PREAMBLE (str);
return real->len;
} | false | false | false | true | false | 1 |
s_option_list(prefix, bool_only)
const char *prefix;
int bool_only;
{
struct option_s *i;
char **list;
int n;
for (i = option_first, n = 0; i; i = i->next)
if (!strncmp(i->option, prefix, strlen(prefix))) ++n;
list = (char **)malloc((n + 1) * sizeof(char *));
for (i = option_first, n = 0; i; i = i-... | false | true | false | false | true | 1 |
remove_update (const gchar *key, gpointer closure, CryptUIKeyset *keyset)
{
if (closure == GINT_TO_POINTER (TRUE))
closure = NULL;
g_signal_emit (keyset, signals[REMOVED], 0, key, closure);
return TRUE;
} | false | false | false | false | false | 0 |
updateDepth() {
for(std::list<AbstractEntry*>::iterator i = subEntries.begin(); i != subEntries.end(); i++) {
(*i)->depth = depth + 1;
(*i)->updateDepth();
}
} | false | false | false | false | false | 0 |
writeElToritoBootCatalog(VolInfo* volInfo,
bk_off_t* bootRecordSectorNumberOffset)
{
unsigned char buffer[NBYTES_LOGICAL_BLOCK];
int rc;
memset(buffer, 0, NBYTES_LOGICAL_BLOCK);
if(wcSeekTell(volInfo) % NBYTES_LOGICAL_BLOCK != 0)
/* file pointer not at sector ... | true | true | false | false | false | 1 |
Init()
{
/* number of pixels per plane */
const unsigned long planeSize = OFstatic_cast(unsigned long, Columns) * OFstatic_cast(unsigned long, Rows);
switch (InputData->getRepresentation())
{
case EPR_Uint8:
InterData = new DiHSVPixelTemplate<Uint8, Uint8>(Document, InputData, ImageS... | false | false | false | false | false | 0 |
gsql_content_class_init (GSQLContentClass *klass)
{
GSQL_TRACE_FUNC;
GObjectClass *obj_class = G_OBJECT_CLASS (klass);
GtkObjectClass *gtkobject_class = GTK_OBJECT_CLASS (klass);
GtkContainerClass *container_class = GTK_CONTAINER_CLASS (klass);
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
parent_... | false | false | false | false | false | 0 |
qinstance_create(sge_gdi_ctx_class_t *ctx,
const lListElem *cqueue, lList **answer_list,
const char *hostname, bool *is_ambiguous, monitoring_t *monitor)
{
dstring buffer = DSTRING_INIT;
const char *cqueue_name = lGetString(cqueue, CQ_name);
lList *centry_list = *(object_type... | 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.