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 |
|---|---|---|---|---|---|---|
scope_conditional_clause (NODE_T * p, SCOPE_T ** s)
{
scope_serial_clause (NEXT_SUB (p), NO_VAR, A68_TRUE);
FORWARD (p);
scope_serial_clause (NEXT_SUB (p), s, A68_TRUE);
if ((FORWARD (p)) != NO_NODE) {
if (is_one_of (p, ELSE_PART, CHOICE, STOP)) {
scope_serial_clause (NEXT_SUB (p), s, A68_TRUE);
}... | false | false | false | false | false | 0 |
NonposArgsGet(Tcl_HashTable *nonposArgsTable, char * methodName) {
Tcl_HashEntry *hPtr;
if (nonposArgsTable &&
((hPtr = XOTcl_FindHashEntry(nonposArgsTable, methodName)))) {
return (XOTclNonposArgs*) Tcl_GetHashValue(hPtr);
}
return NULL;
} | false | false | false | false | false | 0 |
ia_phy_write(struct iadev_priv *iadev,
const struct ia_reg *regs, int len)
{
while (len--) {
ia_phy_write32(iadev, regs->reg, regs->val);
regs++;
}
} | false | false | false | false | false | 0 |
exit_files(void)
{
int i;
for (i = 0; i < ARRAY_count(_files); i++)
STR_free(_files[i]);
ARRAY_delete(&_files);
} | false | false | false | false | false | 0 |
list(bool recursive, bool dirs) {
StringVectorPtr ret = StringVectorPtr(new StringVector());
FileInfoList::iterator i, iend;
iend = mFileList.end();
for(i = mFileList.begin(); i != iend; ++i) {
ret->push_back(i->filename);
}
return ret;
} | false | false | false | false | false | 0 |
writeScanLines(uint8 *buf, exif_uint32 bufLineStride, exif_uint32 numLines,
exif_uint32 *numLinesWritten, exif_uint32 *nextLine)
{
#ifndef OPENEXIF_NO_IJG
bool bTmpPtr = false;
exif_uint32 dwRowBytes;
unsigned short linesCompressed;
OE_JSAMPARRAY row_pointers;
dw... | false | false | false | false | false | 0 |
lower_try_finally_fallthru_label (struct leh_tf_state *tf)
{
tree label = tf->fallthru_label;
treemple temp;
if (!label)
{
label = create_artificial_label (gimple_location (tf->try_finally_expr));
tf->fallthru_label = label;
if (tf->outer->tf)
{
temp.t = label;
r... | false | false | false | false | false | 0 |
efreet_mime_load_globs(Eina_List *datadirs, const char *datahome)
{
Eina_List *l;
char buf[4096];
const char *datadir = NULL;
IF_FREE_HASH(wild);
wild = eina_hash_string_superfast_new(EINA_FREE_CB(eina_stringshare_del));
while (globs)
{
efreet_mime_glob_free(eina_list_data_get(globs... | true | true | false | false | false | 1 |
ltc_frame_alignment(double samples_per_frame, enum LTC_TV_STANDARD standard) {
switch (standard) {
case LTC_TV_525_60:
return rint(samples_per_frame * 4.0 / 525.0);
case LTC_TV_625_50:
return rint(samples_per_frame * 1.0 / 625.0);
default:
return 0;
}
} | false | false | false | false | false | 0 |
try_unit_conflict(Topform a, Topform b)
{
Context c1 = get_context();
Context c2 = get_context();
Trail tr = NULL;
Topform empty = NULL;
if (unit_clause(a->literals) && unit_clause(b->literals) &&
a->literals->sign != b->literals->sign &&
unify(a->literals->atom, c1, b->literals->atom, c2, &tr)) {... | false | false | false | false | false | 0 |
archive_write_cpio_options(struct archive_write *a, const char *key,
const char *val)
{
struct cpio *cpio = (struct cpio *)a->format_data;
int ret = ARCHIVE_FAILED;
if (strcmp(key, "hdrcharset") == 0) {
if (val == NULL || val[0] == 0)
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"%s: hdrchars... | false | false | false | false | false | 0 |
is_bus( char *signame )
{
char *t = signame, c;
char is_a_bus = 0, flag = 0;
char i, where = 0; /* used to say exactly where */
while ((c = *t++)) {
where++; /* increment the position to know where if an error occurs */
if (c == '[') { /* To make -Wall happy */
if (!flag) {
flag = 1... | false | false | false | false | false | 0 |
krb5_gss_inquire_cred_by_oid(OM_uint32 *minor_status,
const gss_cred_id_t cred_handle,
const gss_OID desired_object,
gss_buffer_set_t *data_set)
{
OM_uint32 major_status = GSS_S_FAILURE;
#if 0
size_t i;
#endif
if (minor_... | false | false | false | false | false | 0 |
make_thumbnail_dirs (GnomeDesktopThumbnailFactory *factory)
{
char *thumbnail_dir;
char *image_dir;
gboolean res;
res = FALSE;
thumbnail_dir = thumbnail_factory_build_filename (factory, NULL);
if (!g_file_test (thumbnail_dir, G_FILE_TEST_IS_DIR))
{
g_mkdir (thumbnail_dir, 0700);
res = TRUE... | false | false | false | false | false | 0 |
run_query_cb( const gchar* type, gpointer data_p, gpointer be_data_p )
{
GncSqlObjectBackend* pData = data_p;
sql_backend* be_data = be_data_p;
g_return_if_fail( type != NULL && pData != NULL && be_data != NULL );
g_return_if_fail( pData->version == GNC_SQL_BACKEND_VERSION );
if ( be_data->is_ok ) ... | false | false | false | false | false | 0 |
e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, uint32_t no_snoop)
{
uint32_t gcr_reg = 0;
DEBUGFUNC("e1000_set_pci_ex_no_snoop");
if (hw->bus_type == e1000_bus_type_unknown)
e1000_get_bus_info(hw);
if (hw->bus_type != e1000_bus_type_pci_express)
return E1000_SUCCESS;
if (no_snoop... | false | false | false | false | false | 0 |
getSLVL(unsigned int iport,unsigned int oport,uint8_t sl)
{
// Identity mapping
if (SLVL.empty())
return sl;
return SLVL[iport][oport][sl];
} | false | false | false | false | false | 0 |
SetAttributeFilter( const char *pszQuery )
{
/* -------------------------------------------------------------------- */
/* Are we just clearing any existing query? */
/* -------------------------------------------------------------------- */
if( pszQuery == NULL || strlen(pszQuery) == 0... | false | false | false | false | false | 0 |
printnorm(std::ostream & o){
gauche->printnorm(o);
o << " -> ";
droit->printnorm(o);
if (val>MINVAL){
o << " (";
if (cste!=std::string("")) o << cste << " = ";
o << val;
if (redox()) o << " V";
o << ")";
}
} | false | false | false | false | false | 0 |
get_abs_align_pos(char *seq, int &pos)
{
int q_exists = 0;
if(pos > 3) {
pos-=3;
while(pos > 0) {
uint32_t c= *((uint32_t*)(seq+pos));
if(c == 0x2E2E2E2E) {
q_exists = 1;
pos-=4;
continue;
}
if(c == 0... | false | false | false | false | true | 1 |
depsAddSearchDir(const char *path)
{
if (!inState(DEPS_STATE_INIT | DEPS_STATE_SEARCH))
{
if (!inState(DEPS_STATE_SEARCH)) setErr(DEPS_ERROR_NOT_SEARCH);
if (!inState(DEPS_STATE_INIT)) setErr(DEPS_ERROR_NOT_INIT);
return;
}
setErr(0);
search_adddir(path);
} | false | false | false | false | false | 0 |
Scale(double *p1, double *p2,
int vtkNotUsed(X), int Y)
{
//Get the motion vector
double v[3];
v[0] = p2[0] - p1[0];
v[1] = p2[1] - p1[1];
v[2] = p2[2] - p1[2];
double *o = this->Plane->GetOrigin();
// Compute the scale factor
double sf = vtkMath::Norm(v) / this->Out... | false | false | false | false | false | 0 |
ssl_sock_get_cert_used_conn(struct connection *conn)
{
if (!ssl_sock_is_ssl(conn))
return 0;
return SSL_SOCK_ST_FL_VERIFY_DONE & conn->xprt_st ? 1 : 0;
} | false | false | false | false | false | 0 |
sciw_make_window_fit(rect_t *rect, gfxw_port_t *parent)
{
/* This window is meant to cover the whole screen, so we allow it to go through. */
if (rect->xl == 319 && rect->yl == 189) return;
if (rect->x + rect->xl > parent->bounds.x + parent->bounds.xl)
rect->x -= (rect->x + rect->xl) - (parent->bounds.x + par... | false | false | false | false | false | 0 |
mgetCommand(redisClient *c) {
int j;
addReplySds(c,sdscatprintf(sdsempty(),"*%d\r\n",c->argc-1));
for (j = 1; j < c->argc; j++) {
robj *o = lookupKeyRead(c->db,c->argv[j]);
if (o == NULL) {
addReply(c,shared.nullbulk);
} else {
if (o->type != REDIS_STRING) ... | false | false | false | false | false | 0 |
addAppender(SharedAppenderPtr newAppender)
{
LOG4CPLUS_BEGIN_SYNCHRONIZE_ON_MUTEX( appender_list_mutex )
if(newAppender == NULL) {
getLogLog().warn( LOG4CPLUS_TEXT("Tried to add NULL appender") );
return;
}
ListIteratorType it = appenderList.begin();
while (i... | false | false | false | false | false | 0 |
debug_set_enabled(const std::string& domain, const debug_level::type& levels, bool enabled)
{
using namespace debug_internal;
DebugState::domain_map_t& dm = get_debug_state().get_domain_map();
if (domain == "all") {
bool status = true;
for (DebugState::domain_map_t::iterator iter = dm.begin(); iter != dm.end();... | false | false | false | false | false | 0 |
move_to_san(int move, const board_t * board, char string[], int size) {
int from, to, piece;
char tmp_string[256];
ASSERT(move_is_ok(move));
ASSERT(board_is_ok(board));
ASSERT(string!=NULL);
ASSERT(size>=8);
ASSERT(move_is_legal(move,board));
if (size < 8) return false;
// init
from ... | false | false | false | false | false | 0 |
emit_extension(const char *ftype)
{
int i;
if (ftype) {
for(i=0; i<FORMTABSIZE; i++ ) {
if (!strcmp(formtab[i].name, ftype))
return formtab[i].extension;
}
}
return formtab[0].extension;
} | false | false | false | false | false | 0 |
soc_pcm_bespoke_trigger(struct snd_pcm_substream *substream,
int cmd)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct snd_soc_platform *platform = rtd->platform;
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct snd_soc_dai *codec_dai;
int i, ret;
for (i = 0; i < rtd->num_codecs; i++)... | false | false | false | false | false | 0 |
getcon(void)
{
if (code & 64)
{
/* getconsmall */
return *codeptr++;
}
else return movewa5d0();
} | false | false | false | false | false | 0 |
snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
struct snd_soc_pcm_runtime *be, int stream)
{
struct snd_soc_dpcm *dpcm;
int state;
list_for_each_entry(dpcm, &be->dpcm[stream].fe_clients, list_fe) {
if (dpcm->fe == fe)
continue;
state = dpcm->fe->dpcm[stream].state;
if (state == SND_SOC_DPCM... | false | false | false | false | false | 0 |
canClose()
{
if (isModified()) {
// Prompt the user for unsaved changes.
QString msg = tr("The file '%1' was modified.\n"
"Would you like to save it?")
.arg(path_);
QMessageBox::StandardButtons buttons = QMessageBox::Yes
| QMessageBox::N... | false | false | false | false | false | 0 |
UpdateColourControls(const OptionColour *opt)
{
if (opt)
{
wxColour c = opt->fore;
if (c == wxNullColour)
{
XRCCTRL(*this, "btnColoursFore", wxButton)->SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));
XRCCTRL(*this, "btnColoursFore", wxButto... | false | false | false | false | false | 0 |
RLP_AddRingBufferDataToSlots(void)
{
u8 buffer[24];
int size;
while ((S[VD].State == _idle)
&& ((size = RLP_Passup(GetData,buffer,24)) != 0)) {
memset(S[VD].Data, 0xff, 25); /* FIXME - this isn't necessary - but makes debugging easier! */
if (size > 23) {
S[VD].Data[0] = 0x1e;
size = 24;
} el... | false | false | false | false | false | 0 |
stage_apply_chunk(struct view *view, struct line *chunk, bool revert)
{
char cmd[SIZEOF_STR];
size_t cmdsize = 0;
struct line *diff_hdr;
FILE *pipe;
diff_hdr = stage_diff_find(view, chunk, LINE_DIFF_HEADER);
if (!diff_hdr)
return FALSE;
if (opt_cdup[0] &&
!string_format_from(cmd, &cmdsize, "cd %s;", opt... | false | false | false | false | false | 0 |
GC_invoke_finalizers(void)
{
struct finalizable_object * curr_fo;
int count = 0;
word bytes_freed_before = 0; /* initialized to prevent warning. */
DCL_LOCK_STATE;
while (GC_finalize_now != 0) {
# ifdef THREADS
LOCK();
# endif
if (count == 0) {
bytes_free... | false | false | false | false | true | 1 |
brasero_disc_add_ui (BraseroDisc *disc, GtkUIManager *manager, GtkWidget *message)
{
BraseroDiscIface *iface;
if (!disc)
return 0;
g_return_val_if_fail (BRASERO_IS_DISC (disc), 0);
g_return_val_if_fail (GTK_IS_UI_MANAGER (manager), 0);
iface = BRASERO_DISC_GET_IFACE (disc);
if (iface->add_ui)
return (* ifa... | false | false | false | false | false | 0 |
add_clause(int c[], int n)
{
Clauses_generated++;
#ifdef PRINT_CLAUSES
decode_and_p_clause(c,n);
#endif
n = unit_delete(c, n);
if (n == 0) {
printf("*** Unsatisfiability detected ***\n");
Unsatisfiable = 1;
}
else {
sort_clause(c, n);
if (!unit_subsumed(c, n) && !MACE_tautology(c, n)) {
... | false | false | false | false | false | 0 |
bdf_save_options(FILE *out, bdf_options_t *opts)
#else
bdf_save_options(out, opts)
FILE *out;
bdf_options_t *opts;
#endif
{
unsigned long i;
if (out == 0 || opts == 0)
return;
fprintf(out, "#\n# Metrics corrections.\n#\ncorrect_metrics ");
if (opts->correct_metrics)
fprintf(out, "true\n\n"... | false | false | false | false | false | 0 |
main(int argc, char* argv[]) {
std::string help_string =
std::string("Usage:\n") + argv[0] +
" INPUTFILE COMMAND VARIABLE\n INPUTFILE: *.vtk\n COMMAND: output, average\n VARIABLE: points, fa, trace, freewater";
bool error = false;
bool Verbose = false;
std::string mode;
std::string output... | false | false | false | false | false | 0 |
output_last_position (buffer)
const output_buffer *buffer;
{
const char *p = NULL;
if (obstack_base (&buffer->obstack) != obstack_next_free (&buffer->obstack))
p = ((const char *) obstack_next_free (&buffer->obstack)) - 1;
return p;
} | false | false | false | false | false | 0 |
TCSP_ReadManuMaintPub_Internal(TCS_CONTEXT_HANDLE hContext, /* in */
TCPA_NONCE antiReplay, /* in */
TCPA_DIGEST * checksum) /* out */
{
TSS_RESULT result;
UINT32 paramSize;
UINT64 offset = 0;
BYTE txBlob[TSS_TPM_TXBLOB_SIZE];
LogDebug("Entering Read Manu Maint Pub");
if ((result = tpm_rqu_b... | false | false | false | false | false | 0 |
Select(SDNode *N) {
DebugLoc dl = N->getDebugLoc();
if (N->isMachineOpcode())
return NULL; // Already selected.
switch (N->getOpcode()) {
default: break;
case SPISD::GLOBAL_BASE_REG:
return getGlobalBaseReg();
case ISD::SDIV:
case ISD::UDIV: {
// FIXME: should use a custom expander to expo... | false | false | false | false | false | 0 |
au_set_h_fptr(struct file *file, aufs_bindex_t bindex, struct file *val)
{
struct au_finfo *finfo = au_fi(file);
struct au_hfile *hf;
struct au_fidir *fidir;
fidir = finfo->fi_hdir;
if (!fidir) {
AuDebugOn(finfo->fi_btop != bindex);
hf = &finfo->fi_htop;
} else
hf = fidir->fd_hfile + bindex;
if (hf && hf... | false | false | false | false | false | 0 |
rb_struct_aset(s, idx, val)
VALUE s, idx, val;
{
long i;
if (TYPE(idx) == T_STRING || TYPE(idx) == T_SYMBOL) {
return rb_struct_aset_id(s, rb_to_id(idx), val);
}
i = NUM2LONG(idx);
if (i < 0) i = RSTRUCT(s)->len + i;
if (i < 0) {
rb_raise(rb_eIndexError, "offset %ld too small for ... | false | false | false | false | false | 0 |
validate_expr_stmt(node *tree)
{
int j;
int nch = NCH(tree);
int res = (validate_ntype(tree, expr_stmt)
&& is_odd(nch)
&& validate_testlist_star_expr(CHILD(tree, 0)));
if (res && nch == 3
&& TYPE(CHILD(tree, 1)) == augassign) {
res = validate_numnodes(CHILD... | false | false | false | false | false | 0 |
ExistMapAndVMap(uint32 mapid, float x, float y)
{
GridPair p = MaNGOS::ComputeGridPair(x, y);
int gx = 63 - p.x_coord;
int gy = 63 - p.y_coord;
return GridMap::ExistMap(mapid, gx, gy) && GridMap::ExistVMap(mapid, gx, gy);
} | false | false | false | false | false | 0 |
_elm_ews_wm_init(void)
{
Evas *e;
Evas_Object *o;
if (strcmp(_elm_config->engine, ELM_EWS) != 0)
{
_ews_used = EINA_FALSE;
return EINA_TRUE;
}
e = ecore_evas_ews_evas_get();
if (!e) return EINA_FALSE;
o = edje_object_add(e);
if (!o) return EINA_FALSE;
if (!_elm_theme... | false | false | false | false | false | 0 |
xd_erase_block(struct rtsx_chip *chip, u32 phy_blk)
{
struct xd_info *xd_card = &(chip->xd_card);
u32 page_addr;
u8 reg = 0, *ptr;
int i, retval;
if (phy_blk == BLK_NOT_FOUND) {
rtsx_trace(chip);
return STATUS_FAIL;
}
page_addr = phy_blk << xd_card->block_shift;
for (i = 0; i < 3; i++) {
rtsx_init_cmd(... | false | false | false | false | false | 0 |
async_proxy_create_free (AsyncProxyCreate *data)
{
if (data->notify)
data->notify (data->callback_data);
g_clear_object (&data->result);
g_clear_object (&data->file);
g_free (data->op);
g_clear_object (&data->cancellable);
if (data->mount_info)
g_mount_info_unref (data->mount_info);
g_clear_objec... | false | false | false | false | false | 0 |
adp5520_keys_notifier(struct notifier_block *nb,
unsigned long event, void *data)
{
struct adp5520_keys *dev;
uint8_t reg_val_lo, reg_val_hi;
unsigned short keymask;
dev = container_of(nb, struct adp5520_keys, notifier);
if (event & ADP5520_KP_INT) {
adp5520_read(dev->master, ADP5520_KP_INT_STAT_1, ®_v... | false | false | false | false | false | 0 |
ChapLowerUp(unit)
int unit;
{
chap_state *cstate = &chap[unit];
if (cstate->clientstate == CHAPCS_INITIAL)
cstate->clientstate = CHAPCS_CLOSED;
else if (cstate->clientstate == CHAPCS_PENDING)
cstate->clientstate = CHAPCS_LISTEN;
if (cstate->serverstate == CHAPSS_INITIAL)
cstate->serverstate =... | false | false | false | false | false | 0 |
__db_xa_start(xid, rmid, arg_flags)
XID *xid;
int rmid;
long arg_flags;
{
DB_ENV *dbenv;
DB_TXN *txnp;
ENV *env;
TXN_DETAIL *td;
int ret;
u_long flags;
flags = (u_long)arg_flags; /* Conversion for bit operations. */
ret = 0;
#define OK_FLAGS (TMJOIN | TMRESUME | TMNOWAIT | TMASYNC | TMNOFLAGS)
if (LF_ISSE... | false | false | false | false | false | 0 |
ttree_lookup(struct ttree *tt, unsigned *key)
{
struct node **c = &tt->root;
int count = tt->klen;
while (*c && count) {
c = _lookup_single(c, *key++);
count--;
}
return *c ? (*c)->data : NULL;
} | false | false | false | false | false | 0 |
gt_pch_nx_cpp_token (void *x_p)
{
struct cpp_token * const x = (struct cpp_token *)x_p;
if (gt_pch_note_object (x, x, gt_pch_p_9cpp_token))
{
switch (cpp_token_val_index (&((*x))))
{
case CPP_TOKEN_FLD_NODE:
{
union tree_node * const x0 =
((*x).val.node.... | false | false | false | false | false | 0 |
cavan_display_print_ntext(struct cavan_display_device *display, const char *text, size_t size)
{
const char *text_end;
for (text_end = text + size; text < text_end; text++)
{
cavan_display_print_char(display, *text);
}
return 0;
} | false | false | false | false | false | 0 |
koulescreator (CONST int r)
{
int time = 100;
int z1;
int x, y;
int x1, y1, i;
Effect (S_CREATOR1, next);
for (i = 0; i < 360; i += 60)
{
x1 = (MAPWIDTH / 2 - +sin (RAD (i)) * r);
y1 = (MAPHEIGHT / 2 - +cos (RAD (i)) * r);
for (z1 = 0; z1... | false | false | false | false | false | 0 |
info_read_in_echo_area (WINDOW *window, const char *prompt)
{
char *line;
/* If the echo area is already active, remember the current state. */
if (echo_area_is_active)
push_echo_area ();
/* Initialize our local variables. */
initialize_input_line (prompt);
/* Initialize the echo area for the first (... | false | false | false | false | false | 0 |
process_this_resolution(struct link_node *curr_node,
struct link_node *target,
struct term *tp,
char *target_here,
int *hit_dp_count)
{
BOOLEAN process, temp;
if (((tp->occ.lit)->container)->type == LINK)
{
process = TRUE;
*target_here = FALSE;
}
e... | false | false | false | false | false | 0 |
failed_oper_notice(struct Client *source_p, const char *name,
const char *reason)
{
if (ConfigFileEntry.failed_oper_notice)
sendto_realops_flags(UMODE_ALL, L_ALL, "Failed OPER attempt as %s "
"by %s (%s@%s) - %s", name, source_p->name,
source_p-... | false | false | false | false | false | 0 |
compare_artist_tracknumber(const void* _x, const void* _y)
{
int ret = 0;
const sorting_track_t* x = (const sorting_track_t*)_x;
const sorting_track_t* y = (const sorting_track_t*)_y;
/* Compare head artist names (for omnibus albums). */
ret = compare_string(x->head_artist, y->head_artist);
if (ret == 0) {
ret... | false | false | false | false | false | 0 |
OnEditScript(cb_unused wxCommandEvent& event)
{
wxListCtrl* list = GetVisibleListCtrl();
if (!list)
return;
long index = list->GetNextItem(-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
if (index == -1)
return;
ListItemData* data = (ListItemData*)list->GetItemData(index);
cbWizardP... | false | false | false | false | false | 0 |
EditSubEntries(GtkWidget * clist,
gint row, gint column, GdkEventButton * event, gpointer data)
{
gchar *buf;
gint type;
if (editSubEntriesData.dialog == NULL)
CreateSubEntriesDialog(&editSubEntriesData, _("Edit entry"), (GtkSignalFunc) OkEditSubEntriesDialog, row);
gtk_clist_get_text(GTK_CLIST(clist), ro... | false | false | false | false | false | 0 |
unlink_obj(struct config_item *item)
{
struct config_group *group;
group = item->ci_group;
if (group) {
list_del_init(&item->ci_entry);
item->ci_group = NULL;
item->ci_parent = NULL;
/* Drop the reference for ci_entry */
config_item_put(item);
/* Drop the reference for ci_parent */
config_group_put... | false | false | false | false | false | 0 |
sh_eth_ring_format(struct net_device *ndev)
{
struct sh_eth_private *mdp = netdev_priv(ndev);
int i;
struct sk_buff *skb;
struct sh_eth_rxdesc *rxdesc = NULL;
struct sh_eth_txdesc *txdesc = NULL;
int rx_ringsize = sizeof(*rxdesc) * mdp->num_rx_ring;
int tx_ringsize = sizeof(*txdesc) * mdp->num_tx_ring;
int skbu... | false | false | false | false | false | 0 |
show_title(void)
{
if (p_ptr->wizard)
return "[=-WIZARD-=]";
else if (p_ptr->total_winner || p_ptr->lev > PY_MAX_LEVEL)
return "***WINNER***";
else
return p_ptr->class->title[(p_ptr->lev - 1) / 5];
} | false | false | false | false | false | 0 |
nssCKMDFindSessionObjects_Create
(
NSSCKFWToken *fwToken,
CK_ATTRIBUTE_PTR pTemplate,
CK_ULONG ulCount,
CK_RV *pError
)
{
NSSArena *arena;
nssCKMDFindSessionObjects *mdfso;
nssCKFWHash *hash;
NSSCKMDFindObjects *rv;
#ifdef NSSDEBUG
if (!pError) {
return (NSSCKMDFindObjects *)NULL;
}
*pError ... | false | false | false | false | false | 0 |
ajTrnSeqAltRevinitC(const AjPTrn trnObj, const char *str, ajint len,
AjPStr *pep)
{
ajint i;
ajint iend;
iend = len-1;
if(iend > 1)
{
if('M' == trnObj->Starts[trncomp[(ajint)str[iend]]]
[trncomp[(ajint)str[iend-1]]]
... | false | false | false | false | false | 0 |
read_npas_temps_energy(FILE *flux, GError **error, ToolFortranEndianId endian)
{
guint ncheck, mcheck;
gboolean valid;
double temps;
valid = tool_fortran_readFlag(&ncheck, flux, error, endian);
if (!valid) return valid;
valid = tool_fortran_readInteger(&npas, 1, flux, error, endian, FALSE, TRUE);
if (!... | false | false | false | false | false | 0 |
UpdateTraces( start, end )
TimeType start, end;
{
if( not (windowState.iconified or windowState.tooSmall) )
{
UpdateScrollBar();
RedrawTimes();
DrawTraces( start, end );
}
} | false | false | false | false | false | 0 |
check_for_clock_skew (saver_info *si)
{
saver_preferences *p = &si->prefs;
time_t now = time ((time_t *) 0);
long shift = now - si->last_wall_clock_time;
if (p->debug_p)
{
int i = (si->last_wall_clock_time == 0 ? 0 : shift);
fprintf (stderr,
"%s: checking wall clock for hibernati... | false | false | false | false | false | 0 |
main(int argc, char** argv)
{
char* p;
char* sid;
char* nid;
char* res;
char* setcookie;
#ifdef _GNU_SOURCE
if (getenv("MALLOC_TRACE"))
mtrace();
#endif
#if 0
/* Allocate and realase memory to cause malloc to grab bigger mmap page */
/* Apparently this trick does not work - perhaps memory allocati... | false | false | false | false | false | 0 |
set_env(const char *name, const char *value, int loc)
{
int n;
int empty;
char *tv;
/* if value is NULL or empty string, convert into an unsetenv() */
if (!value || !strlen(value)) {
unset_env(name, loc);
return 0;
}
tv = G_store(value);
G_strip(tv);
if (*tv == 0) {
G_free(tv);
... | false | false | false | false | false | 0 |
scan_string (FILE *fp, sstring *s, int init)
{
int c;
for (;;)
{
c = getc (fp);
if (c == EOF || c == '\n')
break;
if (c == init)
{
c = getc (fp);
break;
}
if (c == '\\')
{
c = getc (fp);
if (c == EOF)
break;
if (c == '\n')
continue;
}
SSTRING_PUT (s, ... | false | false | false | false | false | 0 |
requireAuthentication(const std::string& realm)
{
poco_assert (!_pStream);
setStatusAndReason(HTTPResponse::HTTP_UNAUTHORIZED);
std::string auth("Basic realm=\"");
auth.append(realm);
auth.append("\"");
set("WWW-Authenticate", auth);
} | false | false | false | false | false | 0 |
quit_event_handler(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
{
if (save_game_gtk())
{
save_prefs();
quit(NULL);
exit(0);
return(FALSE);
}
else
return(TRUE);
} | false | false | false | false | false | 0 |
sweepcalc(c, x, y)
Client *c;
int x;
int y;
{
int dx, dy, sx, sy;
dx = x - c->x;
dy = y - c->y;
sx = sy = 1;
if (dx < 0) {
dx = -dx;
sx = -1;
}
if (dy < 0) {
dy = -dy;
sy = -1;
}
dx -= 2*BORDER;
dy -= 2*BORDER;
if (!c->is9term) {
if (dx < c->min_dx)
dx = c->min_dx;
if (dy < c->min_dy)
dy... | false | false | false | false | false | 0 |
undo_init(GtkWidget *text)
{
UndoMain *undostruct;
GtkTextView *textview = GTK_TEXT_VIEW(text);
GtkTextBuffer *textbuf = gtk_text_view_get_buffer(textview);
cm_return_val_if_fail(text != NULL, NULL);
undostruct = g_new0(UndoMain, 1);
undostruct->textview = textview;
undostruct->undo = NULL;
undostruct->redo... | false | false | false | false | false | 0 |
Stage3_free (T *old, bool free_pairarray_p) {
if (*old) {
/* Don't free strain. Belongs to altstrain_iit. */
if (free_pairarray_p == true) {
FREE_OUT((*old)->pairarray);
}
FREE_OUT(*old);
}
return;
} | false | false | false | false | false | 0 |
EffectTeachTaxiNode(SpellEffectIndex eff_idx)
{
if (!unitTarget || unitTarget->GetTypeId() != TYPEID_PLAYER)
return;
uint32 taxiNodeId = m_spellInfo->EffectMiscValue[eff_idx];
if (!sTaxiNodesStore.LookupEntry(taxiNodeId))
return;
Player* player = (Player*)unitTarget;
if (player->m... | false | false | false | false | false | 0 |
floor0_look (vorbis_dsp_state *vd, vorbis_info_mode *mi,
vorbis_info_floor *i) {
int j;
float scale;
vorbis_info *vi=vd->vi;
codec_setup_info *ci=vi->codec_setup;
vorbis_info_floor0 *info=(vorbis_info_floor0 *)i;
vorbis_look_floor0 *look=_ogg_calloc(1, sizeof(vorbis_lo... | false | false | false | false | false | 0 |
double_lock_hb(struct futex_hash_bucket *hb1, struct futex_hash_bucket *hb2)
{
if (hb1 <= hb2) {
spin_lock(&hb1->lock);
if (hb1 < hb2)
spin_lock_nested(&hb2->lock, SINGLE_DEPTH_NESTING);
} else { /* hb1 > hb2 */
spin_lock(&hb2->lock);
spin_lock_nested(&hb1->lock, SINGLE_DEPTH_NESTING);
}
} | false | false | false | false | false | 0 |
gsb_data_budget_new_sub_budget ( gint budget_number,
const gchar *name )
{
gint sub_budget_number;
sub_budget_number = gsb_data_budget_new_sub_budget_with_number ( gsb_data_budget_max_sub_budget_number (budget_number) + 1,
budget_number );
/* append the name if necessa... | false | false | false | false | false | 0 |
bus_dbus_impl_get_name_owner (BusDBusImpl *dbus,
BusConnection *connection,
GVariant *parameters,
GDBusMethodInvocation *invocation)
{
const gchar *name_owner = NULL;
const gchar *name = NULL... | false | false | false | false | false | 0 |
fan_get_state(struct acpi_device *device, unsigned long *state)
{
int result;
int acpi_state = ACPI_STATE_D0;
result = acpi_device_update_power(device, &acpi_state);
if (result)
return result;
*state = acpi_state == ACPI_STATE_D3_COLD
|| acpi_state == ACPI_STATE_D3_HOT ?
0 : (acpi_state == ACPI_STATE_D0 ?... | false | false | false | false | false | 0 |
mono_debug_open_image (MonoImage *image, const guint8 *raw_contents, int size)
{
MonoDebugHandle *handle;
if (mono_image_is_dynamic (image))
return NULL;
mono_debugger_lock ();
handle = mono_debug_get_image (image);
if (handle != NULL) {
mono_debugger_unlock ();
return handle;
}
handle = g_new0 (MonoDe... | false | false | false | false | false | 0 |
Find (const Sha1Hash& root_hash) {
for(int i=0; i<files.size(); i++)
if (files[i] && files[i]->root_hash()==root_hash)
return files[i];
return NULL;
} | false | false | false | false | false | 0 |
gamma_help_1 (double a, double x, const char *prompt)
{
int i;
double ap, del, gln, sum;
static const double eps = 1e-20;
gln = lngamma (a);
ap = a;
del = sum = 1 / a;
for (i = 1; i <= 100; i++)
{
ap++;
del *= x / ap;
sum += del;
if (fabs (del) < fabs (sum) * eps)
re... | false | false | false | false | false | 0 |
getnewbasename(char **newbasename, int typedefp, const char *basename, const char *name)
{
if (typedefp)
*newbasename = strdup(name);
else {
if (name[0] == '*')
name++;
if (asprintf(newbasename, "%s_%s", basename, name) < 0)
errx(1, "malloc");
}
if (*newbasename == NULL)
err(1, "malloc");
... | false | false | false | false | false | 0 |
PrintVarName(char *buf, RfmVar var)
{
if ((buf == NULL) || (var == NULL)) {
return(buf);
}
if (var->sym_dict == NULL) {
if (var->is_generate) {
buf += sprintf(buf, "<$tmp%d>", FCV_Var_Temp_No++);
return(buf);
}
MSG_LOGICALERROR;
return(buf);
... | false | false | false | false | false | 0 |
m_can_config_endisable(const struct m_can_priv *priv,
bool enable)
{
u32 cccr = m_can_read(priv, M_CAN_CCCR);
u32 timeout = 10;
u32 val = 0;
if (enable) {
/* enable m_can configuration */
m_can_write(priv, M_CAN_CCCR, cccr | CCCR_INIT);
udelay(5);
/* CCCR.CCE can only be set/reset while CCCR.INIT = ... | false | false | false | false | false | 0 |
draw_whole(VgaBuf *vgabuf)
{
while(!goal())
{
draw_step(vgabuf);
}
} | false | false | false | false | false | 0 |
camel_yencode_step (const guchar *in,
gsize inlen,
guchar *out,
gint *state,
guint32 *pcrc,
guint32 *crc)
{
register const guchar *inptr;
register guchar *outptr;
const guchar *inend;
register gint already;
guchar c... | false | false | false | false | false | 0 |
soxr_quality_spec(unsigned long recipe, unsigned long flags)
{
soxr_quality_spec_t spec, * p = &spec;
unsigned quality = recipe & 0xf;
double rej;
memset(p, 0, sizeof(*p));
if (quality > 13) {
p->e = "invalid quality type";
return spec;
}
flags |= quality < SOXR_LSR0Q? RESET_ON_CLEAR : 0;
if (qu... | false | false | false | false | false | 0 |
isShallowNumeric(K k)
{
if(ABS(k->t) > 2) R 0;
if(0==k->t) DO(k->n, I t=kK(k)[i]->t; if(t!=1 && t!=2) R 0)
R 1;
} | false | false | false | false | true | 1 |
ext4_quota_off(struct super_block *sb, int type)
{
struct inode *inode = sb_dqopt(sb)->files[type];
handle_t *handle;
/* Force all delayed allocation blocks to be allocated.
* Caller already holds s_umount sem */
if (test_opt(sb, DELALLOC))
sync_filesystem(sb);
if (!inode)
goto out;
/* Update modificatio... | false | false | false | false | false | 0 |
id_memq(ScmObj name, ScmObj list)
{
ScmObj lp;
ScmObj n;
if (SCM_IDENTIFIERP(name)) {
n = SCM_OBJ(SCM_IDENTIFIER(name)->name);
} else {
n = name;
}
SCM_FOR_EACH(lp, list) {
if (SCM_OBJ(SCM_IDENTIFIER(SCM_CAR(lp))->name) == name)
return SCM_CAR(lp);
}
r... | false | false | false | false | false | 0 |
fm10k_iov_supported_xcast_mode_pf(struct fm10k_vf_info *vf_info,
u8 mode)
{
u8 vf_flags = vf_info->vf_flags;
/* match up mode to capabilities as best as possible */
switch (mode) {
case FM10K_XCAST_MODE_PROMISC:
if (vf_flags & FM10K_VF_FLAG_PROMISC_CAPABLE)
return FM10K_XCAST_MODE_PROMISC;
/* fallt... | false | false | false | false | false | 0 |
sigar_file_system_usage_calc_used(sigar_t *sigar,
sigar_file_system_usage_t *fsusage)
{
/*
* win32 will not convert __uint64 to double.
* convert to KB then do unsigned long -> double.
*/
sigar_uint64_t b_used = (fsusage->total - fsusage->free) / 1024;
... | 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.