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 |
|---|---|---|---|---|---|---|
cmd_unselectfirst(MainInfo *min, DirPane *src, DirPane *dst, const CmdArg *ca)
{
GSList *slist;
if((slist = dp_get_selection(src)) != NULL)
{
dp_unselect(src, slist->data);
dp_free_selection(slist);
}
return 1;
} | false | false | false | false | false | 0 |
mvapich_abort_accept (mvapich_state_t *st)
{
slurm_addr_t addr;
int rc;
struct pollfd pfds[2];
/*
* st->fd accepts connections from MPI procs to indicate an MPI error
* st->shutdown_pipe is written to by the main thread, to break out
* of the poll call when it is time to shut down
*/
pfds[0].fd = st->fd;... | false | false | false | false | false | 0 |
setFileClose(const QString& s, int lastIndex)
{
if(DatabaseListEntry* e = FindEntry(s))
{
if(e->m_state == EDBL_OPEN)
{
e->m_state = EDBL_CLOSE;
e->m_lastGameIndex = lastIndex;
QModelIndex m = createIndex(m_databases.indexOf(*e), DBLV_OPEN, (void*) 0);
... | false | false | false | false | false | 0 |
gribRefDate(int *isec1)
{
int date, ryear, rmonth, rday;
int century;
century = ISEC1_Century;
if ( century < 0 ) century = -century;
century -= 1;
ryear = ISEC1_Year;
/* if ( century != 0 ) */
{
if ( ryear == 100 )
{
ryear = 0;
century += 1;
}
if ( ryear != 255 )
{
ryear... | false | false | false | false | false | 0 |
HashFindPhonePhrase( ChewingData *pgdata, const uint16_t phoneSeq[], HASH_ITEM *pItemLast )
{
HASH_ITEM *pNow = pItemLast ?
pItemLast->next :
pgdata->static_data.hashtable[ HashFunc( phoneSeq ) ];
for ( ; pNow; pNow = pNow->next )
if ( PhoneSeqTheSame( pNow->data.phoneSeq, phoneSeq ) )
return pNow;
retur... | false | false | false | false | false | 0 |
CreateBackPointers() {
HeapObjectIterator iterator(Heap::map_space());
for (HeapObject* next_object = iterator.next();
next_object != NULL; next_object = iterator.next()) {
if (next_object->IsMap()) { // Could also be ByteArray on free list.
Map* map = Map::cast(next_object);
if (map->instan... | false | false | false | false | false | 0 |
path_basename(const char *path)
{
char *pos, *trail = NULL;
if (!path || !*path)
{
return strdup(".");
}
pos = strrchr(path, '/');
if (pos && !pos[1])
{ /* if path ends with slashes we have to look beyond them */
while (pos > path && *pos == '/')
{ /* skip trailing slashes */
pos--;
}
if (pos == pa... | false | false | false | false | true | 1 |
since_last_pl(iTunesDB *itdb) {
g_return_if_fail (itdb);
update_ranked_playlist(itdb, _("Last Time"), 0, since_last_IF, since_last_CF, (gpointer) 0);
} | false | false | false | false | false | 0 |
visit(ir_constant *ir)
{
const glsl_type* type = ir->type;
if (type == glsl_type::float_type)
{
buffer = print_float (buffer, ir->value.f[0]);
return;
}
else if (type == glsl_type::int_type)
{
ralloc_asprintf_append (&buffer, "%d", ir->value.i[0]);
return;
}
else if (type == glsl_type::uint_type)
{
... | false | false | false | false | false | 0 |
SetDirection(const DirectionType & direction)
{
for ( unsigned int rr = 0; rr < 4; rr++ )
{
for ( unsigned int cc = 0; cc < 4; cc++ )
{
m_Direction[rr][cc] = direction[rr][cc];
}
}
this->Modified();
} | false | false | false | false | false | 0 |
lua_chat_drop_dead(lua_State * L)
{
enemy *en = get_enemy_arg(L, 1);
hit_enemy(en, en->energy + 1, 0, Druidmap[en->type].is_human - 2, 0);
if (en == chat_control_chat_droid)
chat_control_end_dialog = 1;
return 0;
} | false | false | false | false | false | 0 |
response_is_html(request_rec *r)
{
char *ctype = ap_field_noparam(r->pool, r->content_type);
ap_str_tolower(ctype);
return !strcmp(ctype, "text/html")
|| !strcmp(ctype, "application/xhtml+xml");
} | false | false | false | false | false | 0 |
user_list(void){
char **azResult;
int i;
login_check_credentials();
if( !g.okWrite && g.isAnon ){
login_needed();
return;
}
common_standard_menu("userlist", 0);
common_add_help_item("CvstracAdminUsers");
common_add_action_item("useredit", "Add User");
common_header("User List");
cgi_printf(... | false | false | false | false | false | 0 |
action_untag_subject(Widget w, XEvent *event,
String *params, Cardinal *no_params)
{
ARTICLE *art;
char message[80];
if (global.busy || (global.mode != NewsModeGroup &&
global.mode != NewsModeThread))
return;
if (!global.curr_subj) {
set_message("No selected subject!", True);
return;
}
... | false | false | false | false | false | 0 |
db_d_close_database(void)
{
int stat;
/* no arg(s) */
/* see if a database is open */
if (!db__test_database_open()) {
db_error("no database is open");
DB_SEND_FAILURE();
return DB_OK;
};
/* make sure all cursors are closed */
db__close_all_cursors();
/* call the procedure */
s... | false | false | false | false | false | 0 |
addQualityString(const std::string& qual)
{
size_t num_bytes_required = m_codec.getRequiredUnits(qual.size());
QualityString incoming;
incoming.encoded_data = new QualityStorageUnit[num_bytes_required];
incoming.num_encoded_symbols = qual.size();
for(size_t i = 0; i < qual.size(); ++i)
m_cod... | false | false | false | false | false | 0 |
AddTimeStepInternalForLocations(
unsigned int vtkNotUsed(composite_index), double vtkNotUsed(time), vtkDataSet* input)
{
if (!input)
{
vtkGenericWarningMacro("Ignoring since input is not a vtkDataset.");
return;
}
vtkDataSetAttributes* inDSA = input->GetPointData();
vtkCharArray* validMask = vt... | false | false | false | false | false | 0 |
check_opt(const int queue_head, const int queue_tail)
{
int queue_c;
queue_c = queue_head - queue_tail;
if (queue_c > 0) {
if (argv_error_stream != NULL) {
(void)fprintf(argv_error_stream,
"%s: %s, %d more option-argument%s must be specified\n",
argv_program, USAGE_ERROR_NAME,
queue... | false | false | false | false | false | 0 |
card16(unsigned int *u, const cff_data_t *o, unsigned p, unsigned pe)
{
if (pe > o->length || p > pe - 2)
return_error(e_rangecheck); /* out of range access */
*u = (o->blk_ref[ p >> o->shift].value.bytes[ p & o->mask]) << 8 |
o->blk_ref[(p + 1) >> o->shift].value.bytes[(p + 1) & o->... | false | false | false | false | false | 0 |
c_map(void)
{
FILE *f;
int i, j;
char line[MAP_HEIGHT+2];
prompt ("Filename? ");
get_str (jnkbuf, STRSIZE);
f = fopen (jnkbuf, "w");
if (f == NULL) {
error ("I can't open that file.");
return;
}
for (i = 0; i < MAP_WIDTH; i++) { /* for each column */
for (j = MAP_HEIGHT-1; j >= ... | false | false | false | false | false | 0 |
format_packet(p, len, printer, arg)
u_char *p;
int len;
void (*printer) __P((void *, char *, ...));
void *arg;
{
int i, n;
u_short proto;
u_char x;
struct protent *protp;
if (len >= PPP_HDRLEN && p[0] == PPP_ALLSTATIONS && p[1] == PPP_UI) {
p += 2;
GETSHORT(proto, p);
len -= PPP_... | false | false | false | false | false | 0 |
kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
void *data, unsigned long len)
{
struct kvm_memslots *slots = kvm_memslots(kvm);
int r;
BUG_ON(len > ghc->len);
if (slots->generation != ghc->generation)
kvm_gfn_to_hva_cache_init(kvm, ghc, ghc->gpa, ghc->len);
if (unlikely(!ghc->memsl... | false | false | false | false | false | 0 |
mrpc_set_accept_backoff(struct mrpc_conn_set *set, unsigned ms)
{
if (set == NULL || ms == 0)
return EINVAL;
set_config(set, accept_backoff, ms);
return 0;
} | false | false | false | false | false | 0 |
parse_beforeafter(char *arg, uint64_t *before, uint64_t *after)
{
char *ptr;
char *before_str;
char *after_str;
ptr = strchr(optarg, ':');
if (!ptr || !(*(ptr + 1))) {
fprintf(stderr, "invalid input '%s'\n", arg);
return -1;
}
(*ptr) = '\0';
before_str = arg;
after_str = ptr + 1;
(*before) = strtoull(be... | false | false | false | false | false | 0 |
UpdateIFCP (void)
{
char cmdLine[256];
printf ("Updating iFCP Node.\n");
ISNSCreateHdr (ISNS_REG_DEV_ATTR_REQ, &cmd, sizeof (cmd),
0);
/* Get iFCP Node */
if (0 != GetHexInput (cmdLine, "iFCP Node WWPN", NULL, sizeof (cmdLine)))
{
ISNSAppendAttr (&cmd, ISNS_PORT_NAME, 8, cmdL... | false | false | false | false | false | 0 |
SetValuesByRadii(const char *spheroidname, double eq_radius, double p_radius)
{
spheroid_name = CPLStrdup(spheroidname);
equitorial_radius=eq_radius;
polar_radius=p_radius;
inverse_flattening=(eq_radius == polar_radius) ? 0 : eq_radius/(eq_radius - polar_radius);
} | false | false | false | false | false | 0 |
declare_user(void)
{
char *id = queue_remove(id_queue), *dest_id = NULL;
user_datum_t *user = NULL, *dest_user = NULL;
int retval;
uint32_t value = 0;
if (id == NULL) {
yyerror("no user name");
return NULL;
}
if ((user = (user_datum_t *) malloc(sizeof(*user))) == NULL) {
yyerror("Out of memory!");
free(... | false | false | false | false | false | 0 |
rmque(fd_struct **link, fdque *que)
{
fd_struct *res;
res = *link;
*link = res->next;
if (res->next == NULL)
que->lastp = link;
que->count--;
return (res);
} | false | false | false | false | false | 0 |
computeexonscore(Exonnode *node)
{
unsigned long i, maxlength = 0;
GthDbl maxscore = DBL_MIN;
Exonscoreinfo *exonscoreinfo;
/* compute maximal length */
for (i = 0; i < gt_array_size(node->exonscores); i++) {
exonscoreinfo = gt_array_get(node->exonscores, i);
if (exonscoreinfo->lengthofscoringexon > ... | false | false | false | false | false | 0 |
freePGconn(PGconn *conn)
{
if (conn->pghost)
free(conn->pghost);
if (conn->pghostaddr)
free(conn->pghostaddr);
if (conn->pgport)
free(conn->pgport);
if (conn->pgunixsocket)
free(conn->pgunixsocket);
if (conn->pgtty)
free(conn->pgtty);
if (conn->connect_timeout)
free(conn->connect_timeout);
if (conn->... | false | false | false | false | false | 0 |
GenerateArguments(ZoneList<Expression*>* args) {
ASSERT(args->length() == 1);
// ArgumentsAccessStub expects the key in rdx and the formal
// parameter count in rax.
Load(args->at(0));
Result key = frame_->Pop();
// Explicitly create a constant result.
Result count(Handle<Smi>(Smi::FromInt(scope()->num_p... | false | false | false | false | false | 0 |
queryAuthInfo(KIO::AuthInfo &info, const QString &errorMsg,
qlonglong windowId, qlonglong seqNr,
qlonglong usertime)
{
kDebug(7019) << "window-id=" << windowId;
// special handling for kioslaves which aren't QCoreApplications
if ... | false | false | false | false | false | 0 |
usart_init_iso7816(Usart *p_usart,
const usart_iso7816_opt_t *p_usart_opt, uint32_t ul_mck)
{
static uint32_t ul_reg_val;
/* Reset the USART and shut down TX and RX. */
usart_reset(p_usart);
ul_reg_val = 0;
/* Check whether the input values are legal. */
if (!p_usart_opt || ((p_usart_opt->parity_type != US_M... | false | false | false | false | false | 0 |
vars_stdized_send_event (GGobiData * d, ggobid * gg)
{
if (gg->sphere_ui.stdized_entry != NULL &&
GTK_IS_WIDGET (gg->sphere_ui.stdized_entry) &&
GTK_WIDGET_VISIBLE (gg->sphere_ui.stdized_entry)) {
gboolean rval = false;
g_signal_emit_by_name (G_OBJECT (gg->sphere_ui.stdized_entry),
... | false | false | false | false | false | 0 |
client3_1_stat_cbk (struct rpc_req *req, struct iovec *iov, int count,
void *myframe)
{
gfs3_stat_rsp rsp = {0,};
call_frame_t *frame = NULL;
struct iatt iatt = {0,};
int ret = 0;
xlator_t *this = NULL;
this = THIS;
frame = m... | false | false | false | false | false | 0 |
AcpiDecodePldBuffer (
UINT8 *InBuffer,
ACPI_SIZE Length,
ACPI_PLD_INFO **ReturnBuffer)
{
ACPI_PLD_INFO *PldInfo;
UINT32 *Buffer = ACPI_CAST_PTR (UINT32, InBuffer);
UINT32 Dword;
/* Parameter validation */... | false | false | false | false | false | 0 |
DirExists( const string& aDir )
{
char buf[2048];
bool bValid = true;
// Get and save actual working directory.
if( pal_getcwd(buf,2048) )
{
// Attempt changing directory.
bValid = pal_chdir(aDir.c_str()) == 0;
// restore previous working directory.
pal_chdir(buf);
}
return bValid;
} | false | false | false | false | false | 0 |
UpdateWith(const wxSheetCellAttr& other)
{
wxCHECK_MSG(Ok() && other.Ok(), false, wxT("this or Attr to UpdateWith from is not created"));
if ( other.HasForegoundColour() )
SetForegroundColour(other.GetForegroundColour());
if ( other.HasBackgroundColour() )
SetBackgroundColour(other.GetBac... | false | false | false | false | false | 0 |
ripper_filename(VALUE self)
{
struct parser_params *parser;
TypedData_Get_Struct(self, struct parser_params, &parser_data_type, parser);
if (!ripper_initialized_p(parser)) {
rb_raise(rb_eArgError, "method called for uninitialized object");
}
return parser->parser_ruby_sourcefile_string;
} | false | false | false | false | false | 0 |
first_cls(BooleanClause *clause)
{
BCArray *bca = ALLOC_AND_ZERO(BCArray);
bca->capa = BCA_INIT_CAPA;
bca->clauses = ALLOC_N(BooleanClause *, BCA_INIT_CAPA);
if (clause) {
bca_add_clause(bca, clause);
}
return bca;
} | false | false | false | false | false | 0 |
print_side (t_2d_array& print_bin, int x, int y, char c) {
bool err = print_bin[x][y] != ' ';
print_bin[x][y] = err ? '*' : c;
return !err;
} | false | false | false | false | false | 0 |
fill_input_buffer (apr_socket_t * socket)
{
input_buffer_t * buffer;
apr_size_t length;
RELAY_ERROR (get_input_buffer (socket, (&buffer)));
RELAY_ERROR
(((length = (sizeof (buffer->data))),
(apr_socket_recv (socket, (buffer->data), (&length)))));
(buffer->start) = (buffer->data);
(buffer->end) = ... | false | false | false | false | false | 0 |
debug_mutex_free_waiter(struct mutex_waiter *waiter)
{
DEBUG_LOCKS_WARN_ON(!list_empty(&waiter->list));
memset(waiter, MUTEX_DEBUG_FREE, sizeof(*waiter));
} | false | false | false | false | false | 0 |
has_any_coincidence(struct isl_sched_graph *graph)
{
int i;
for (i = 0; i < graph->n_edge; ++i)
if (graph->edge[i].coincidence)
return 1;
return 0;
} | false | false | false | false | false | 0 |
IsValidTop(Isolate* isolate,
Address low_bound, Address high_bound) {
ThreadLocalTop* top = isolate->thread_local_top();
Address fp = Isolate::c_entry_fp(top);
ExitFrameValidator validator(low_bound, high_bound);
if (!validator.IsValidFP(fp)) return false;
return Isolat... | false | false | false | false | false | 0 |
write_gif_comments( FILE * fp,
const char * str )
{
char s[ 256 ];
const char *p = str;
int len,
k = strlen( str );
for ( len = 0; p < str + k; p += len )
{
size_t dummy;
strncpy( s, p, 255 );
s[ 255 ] = '\0';
len = strlen( s );
... | true | true | false | false | false | 1 |
storvsc_get_chs(struct scsi_device *sdev, struct block_device * bdev,
sector_t capacity, int *info)
{
sector_t nsect = capacity;
sector_t cylinders = nsect;
int heads, sectors_pt;
/*
* We are making up these values; let us keep it simple.
*/
heads = 0xff;
sectors_pt = 0x3f; /* Sectors per track */... | false | false | false | false | false | 0 |
verify_halted(struct usbtest_dev *tdev, int ep, struct urb *urb)
{
int retval;
u16 status;
/* should look and act halted */
retval = usb_get_status(urb->dev, USB_RECIP_ENDPOINT, ep, &status);
if (retval < 0) {
ERROR(tdev, "ep %02x couldn't get halt status, %d\n",
ep, retval);
return retval;
}
if (status... | false | false | false | false | false | 0 |
CleanBodies()
{
edict_t *ptr;
int i;
ptr = g_edicts + game.maxclients + 1;
i = 0;
while (i < BODY_QUEUE_SIZE) {
gi.unlinkentity(ptr);
ptr->solid = SOLID_NOT;
ptr->movetype = MOVETYPE_NOCLIP;
ptr->svflags |= SVF_NOCLIENT;
ptr++;
i++;
}
} | false | false | false | false | false | 0 |
lrs_getnextbasis (lrs_dic ** D_p, lrs_dat * Q, long backtrack)
/* gets next reverse search tree basis, FALSE if none */
/* switches to estimator if maxdepth set */
/* backtrack TRUE means backtrack from here */
{
/* assign local variables to structures */
long i = 0L, j = 0L;
long... | false | false | false | false | false | 0 |
init_codec(struct chd_file *chd)
{
int err = CHDERR_NONE;
/* now decompress based on the compression method */
switch (chd->header.compression)
{
case CHDCOMPRESSION_NONE:
/* nothing to do */
break;
case CHDCOMPRESSION_ZLIB:
case CHDCOMPRESSION_ZLIB_PLUS:
{
struct zlib_codec_data *d... | false | false | false | false | false | 0 |
cli_unrar_scanmetadata(int desc, unrar_metadata_t *metadata, cli_ctx *ctx, unsigned int files, uint32_t* sfx_check)
{
int ret = CL_SUCCESS;
if(files == 1 && sfx_check) {
if(*sfx_check == metadata->crc)
return CL_BREAK;/* break extract loop */
else
*sfx_check = metadata->crc;
}
cli_dbgmsg("RAR... | false | false | false | false | false | 0 |
go_plugins_init (GOCmdContext *context,
GSList const *known_states,
GSList const *active_plugins,
GSList *plugin_dirs,
gboolean activate_new_plugins,
GType default_loader_type)
{
GSList *error_list = NULL;
GOErrorInfo *error;
GSList *plugin_list;
go_default_loader_type = default_loader_type;
go_pl... | false | false | false | false | false | 0 |
stmt_could_throw_1_p (gimple stmt)
{
enum tree_code code = gimple_expr_code (stmt);
bool honor_nans = false;
bool honor_snans = false;
bool fp_operation = false;
bool honor_trapv = false;
tree t;
size_t i;
bool handled, ret;
if (TREE_CODE_CLASS (code) == tcc_comparison
|| TREE_CODE_CLASS (code)... | false | false | false | false | false | 0 |
findstr(char * haystack, int hlen, char * needle, int nlen)
{
int i;
if (hlen < nlen)
return NULL;
for (i = 0; i <= hlen - nlen; i++) {
if (!strncmp(haystack + i, needle, nlen))
return haystack + i;
}
return NULL;
} | false | false | false | false | false | 0 |
rs_start_results(void* vparams,
kdtree_t* ytree, int ynode) {
rs_params* p = (rs_params*)vparams;
p->ydone += 1 + kdtree_right(ytree, ynode) - kdtree_left(ytree, ynode);
if (p->user_progress)
p->user_progress(p->user_progress_param, p->ydone);
} | false | false | false | false | false | 0 |
init_node(NODE * node, int idx, int offset)
{
register long *count;
register int i;
count = node->count = (long *)G_calloc(i = NCATS, sizeof(long));
while (i--)
*count++ = 0;
node->idx = idx;
node->count[offset] = 1;
node->left = 0;
return 0;
} | false | false | false | false | false | 0 |
zd_usb_ioread16v(struct zd_usb *usb, u16 *values,
const zd_addr_t *addresses, unsigned int count)
{
int r, i, req_len, actual_req_len, try_count = 0;
struct usb_device *udev;
struct usb_req_read_regs *req = NULL;
unsigned long timeout;
bool retry = false;
if (count < 1) {
dev_dbg_f(zd_usb_dev(usb... | false | false | false | false | false | 0 |
ntru_trailing(NtruBitStr *a, int num_bits, NtruBitStr *b) {
b->num_bytes = (num_bits+7) / 8;
memcpy(&b->buf, &a->buf, sizeof b->buf);
b->last_byte_bits = num_bits % 8;
if (b->last_byte_bits == 0)
b->last_byte_bits = 8;
else {
int s = b->last_byte_bits;
b->buf[b->num_bytes-1]... | false | false | false | false | false | 0 |
OnDirectSocketSend(const char *data, const BitSize_t bitsUsed, SystemAddress remoteSystemAddress)
{
if (logDirectMessages==false)
return;
char str[256];
FormatLine(str, "Snd", "Raw", 0, 0, data[0], bitsUsed, RakNet::GetTimeMS(), rakPeerInterface->GetExternalID(remoteSystemAddress), remoteSystemAddress, (uns... | false | false | false | false | false | 0 |
start_lingering_close_blocking(event_conn_state_t *cs)
{
if (ap_start_lingering_close(cs->c)) {
apr_pool_clear(cs->p);
ap_push_pool(worker_queue_info, cs->p);
return 0;
}
return start_lingering_close_common(cs);
} | false | false | false | false | false | 0 |
insert_utf8(const char *name, uint8_t *bytes, int len)
{
int n;
fprintf(out, "_%s:\n", name);
fprintf(out, " db \"");
for (n = 0; n < len; n++)
{
if (bytes[n] == '\n')
{
fprintf(out, "\\n");
}
else
if (bytes[n] == '\"')
{
fprintf(out, "\\\"");
}
else
{
... | false | false | false | false | false | 0 |
purge_files_from_jobs(UAContext *ua, char *jobs)
{
POOL_MEM query(PM_MESSAGE);
Mmsg(query, "DELETE FROM File WHERE JobId IN (%s)", jobs);
db_sql_query(ua->db, query.c_str(), NULL, (void *)NULL);
Dmsg1(050, "Delete File sql=%s\n", query.c_str());
Mmsg(query, "DELETE FROM BaseFiles WHERE JobId IN (%s)", ... | false | false | false | false | false | 0 |
qh_settruncate (setT *set, int size) {
if (size < 0 || size > (int)set->maxsize) qhull_fatal(19);
set->e[set->maxsize]= (void *) (size+1); /* maybe overwritten */
set->e[size]= NULL;
} | false | false | false | true | false | 1 |
parallel_master(int child_pid) {
char buf[MSG_CHANNEL_SIZE];
int exit_status;
while (1) {
boinc_sleep(TIMER_PERIOD);
interrupt_count++;
if (app_client_shm) {
handle_heartbeat_msg();
if (app_client_shm->shm->process_control_request.get_msg(buf)) {
... | false | false | false | false | false | 0 |
hash_search( struct hash * hp, unsigned int keyval,
OBJECT * keydata, ITEM * * previous )
{
ITEM * i = *hash_bucket( hp, keyval );
ITEM * p = 0;
for ( ; i; i = i->next )
{
if ( object_equal( hash_item_key( i ), keydata ) )
{
if ( previous )
*previous = p;
... | false | false | false | false | false | 0 |
_rtl92ee_phy_set_sw_chnl_cmdarray(struct swchnlcmd *cmdtable,
u32 cmdtableidx, u32 cmdtablesz,
enum swchnlcmd_id cmdid,
u32 para1, u32 para2, u32 msdelay)
{
struct swchnlcmd *pcmd;
if (cmdtable == NULL) {
RT_ASSERT(false, "cmdtable cannot be NULL.\n");
return false;
}
if (cmdt... | false | false | false | false | false | 0 |
setupConfig()
{
int i;
for (i = N(strings)-1; i >= 0; i--)
(*this).*strings[i].p = (strings[i].def ? strings[i].def : "");
for (i = N(atcmds)-1; i >= 0; i--)
(*this).*atcmds[i].p = (atcmds[i].def ? atcmds[i].def : "");
for (i = N(numbers)-1; i >= 0; i--)
(*this).*numbers[i].p = numbers[i].def;
} | false | false | false | false | false | 0 |
format(const Formattable& obj,
UnicodeString& appendTo,
FieldPosition& pos,
UErrorCode& status) const
{
if (U_FAILURE(status)) {
return appendTo;
}
if (obj.getType() == Formattable::kString) {
return format(obj.getString(status), appen... | false | false | false | false | false | 0 |
commands_free(struct cmd_node *root)
{
struct cmd_node *subcmd, *subcmd_next;
for (subcmd = TAILQ_FIRST(&root->subentries); subcmd != NULL;
subcmd = subcmd_next) {
subcmd_next = TAILQ_NEXT(subcmd, next);
TAILQ_REMOVE(&root->subentries, subcmd, next);
commands_free(subcmd);
}
free(root);
} | false | false | false | false | false | 0 |
_nc_meta(SCREEN *sp, bool flag)
{
int result = ERR;
/* Ok, we stay relaxed and don't signal an error if win is NULL */
if (SP != 0) {
SP->_use_meta = flag;
if (flag) {
_nc_putp("meta_on", meta_on);
} else {
_nc_putp("meta_off", meta_off);
}
result = OK;
}
return result;
} | false | false | false | false | false | 0 |
get( const char *key, float &value, float defaultValue ) {
const char *v = node->get( key );
value = v ? (float)atof( v ) : defaultValue;
return ( v != 0 );
} | false | false | false | false | false | 0 |
hmacmd5_chap(const unsigned char *challenge, int challen,
const char *passwd, unsigned char *response)
{
void *hmacmd5_ctx;
int pwlen;
hmacmd5_ctx = hmacmd5_make_context();
pwlen = strlen(passwd);
if (pwlen>64) {
unsigned char md5buf[16];
MD5Simple(passwd, pwlen, md5buf);
hmacmd5_key(hmacmd... | true | true | false | false | false | 1 |
jobscmd(UAContext *ua, const char *cmd)
{
JOB *job;
uint32_t type = 0;
int pos;
if ((pos = find_arg_with_value(ua, "type")) >= 0) {
type = ua->argv[pos][0];
}
LockRes();
foreach_res(job, R_JOB) {
if (!type || type == job->JobType) {
if (acl_access_ok(ua, Job_ACL, job->name())) ... | false | false | false | false | false | 0 |
print_title (const char* text)
{
sstring underline (strlen(text), '-');
options_help_text << text << "\n" << underline << "\n";
} | false | false | false | false | false | 0 |
compute_flow_union_map(
__isl_take isl_union_access_info *access)
{
struct isl_compute_flow_data data;
access = isl_union_access_info_align_params(access);
access = isl_union_access_info_introduce_schedule(access);
if (!access)
return NULL;
data.must_source = access->must_source;
data.may_source = access->ma... | false | false | false | false | false | 0 |
cli_initchansess(struct Channel *channel) {
cli_init_stdpipe_sess(channel);
if (cli_opts.wantpty) {
send_chansess_pty_req(channel);
}
send_chansess_shell_req(channel);
if (cli_opts.wantpty) {
cli_tty_setup();
}
return 0; /* Success */
} | false | false | false | false | false | 0 |
dump_rta(struct rtattr *buf, int len)
{
struct rtattr *rta;
for (rta = buf; RTA_OK(rta, len); rta = RTA_NEXT(rta, len)) {
switch (rta->rta_type) {
default:
printf(" Got an unknown attribute of length %ld.\n",
(long) RTA_PAYLOAD(rta));
break;
}
}
printf(" %d leftover attribute bytes.\n", len);
... | false | false | false | false | false | 0 |
clutter_timeout_pool_prepare (GSource *source,
gint *next_timeout)
{
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
GList *l = pool->timeouts;
/* the pool is ready if the first timeout is ready */
if (l && l->data)
{
ClutterTimeout *timeout = l->data;
... | false | false | false | false | false | 0 |
newVertex ( void )
{
#ifdef FPP_DEBUG_TRI_RELATION
std::cerr << "New vertex " << last << "\n";
#endif
// make existing arrays bigger
for ( unsigned int i = 0; i < last; ++i )
{
M[i].push_back(false);
MStar[i].push_back(false);
MMinus[i].push_back(false);
# ifndef FPP_NO_DELETE_EDGE
N[i].push_back(0);
# end... | false | false | false | false | false | 0 |
PromptAndLoad(wxWindow *parent)
{
wxFileDialog dlg(parent, _W("Load Photo..."), _T(""), _T(""),
m_file_filter,
wxFD_OPEN | wxFD_PREVIEW);
if( dlg.ShowModal() != wxID_OK )
return false;
// Load image in whatever format it's in
wxImage image;
if( !image.LoadFile(dlg.GetPath()) ) {
wxMessageBox(_W("Unable to... | false | false | false | false | false | 0 |
ocfs2_refcount_rec_adjacent(struct ocfs2_refcount_block *rb,
int index)
{
if ((rb->rf_records.rl_recs[index].r_refcount ==
rb->rf_records.rl_recs[index + 1].r_refcount) &&
(le64_to_cpu(rb->rf_records.rl_recs[index].r_cpos) +
le32_to_cpu(rb->rf_records.rl_recs[index].r_clusters) ==
le64_to_c... | false | false | false | false | false | 0 |
get_global_button_name(Button::ID id)
{
GlobalButtonsInfo::iterator it;
it = _global_buttons.find (id);
if (it == _global_buttons.end ()) {
_global_button_name = "";
return _global_button_name;
} else {
return it->second.label;
}
} | false | false | false | false | false | 0 |
putfilename(char *srcfile)
{
/* check for file system out of space */
/* note: dbputc is not used to avoid lint complaint */
if (putc(NEWFILE, newrefs) == EOF) {
cannotwrite(newreffile);
/* NOTREACHED */
}
++dboffset;
if (invertedindex == YES) {
srcoffset[nsrcoffset++] = dboffset;
}
dbfputs(srcfile);
fcn... | false | false | false | false | false | 0 |
cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
struct dst_entry **dst)
{
#if IS_ENABLED(CONFIG_IPV6)
struct flowi6 fl6;
memset(&fl6, 0, sizeof(fl6));
fl6.daddr = dst_addr->sin6_addr;
if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
fl6.flowi6_oif = dst_addr->sin6_scope_id;
*dst = ip6_route_outpu... | false | false | false | false | false | 0 |
repeated(int max, int * satur_degree, int vertex_num, int found) {
int i;
for(i = 0; i < vertex_num; i++) {
if (max == satur_degree[i] && i != found)
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
update_inven_subwindow(game_event_type type, game_event_data *data,
void *user)
{
term *old = Term;
term *inv_term = user;
/* Activate */
Term_activate(inv_term);
if (!flip_inven)
show_inven(OLIST_WINDOW | OLIST_WEIGHT | OLIST_QUIVER);
else
show_equip(OLIST_WINDOW | OLIST_WEIGHT);
Term_fresh();... | false | false | false | false | false | 0 |
nilfs_segctor_notify(struct nilfs_sc_info *sci, int mode, int err)
{
/* Clear requests (even when the construction failed) */
spin_lock(&sci->sc_state_lock);
if (mode == SC_LSEG_SR) {
sci->sc_state &= ~NILFS_SEGCTOR_COMMIT;
sci->sc_seq_done = sci->sc_seq_accepted;
nilfs_segctor_wakeup(sci, err);
sci->sc_flu... | false | false | false | false | false | 0 |
Finished(void)
{
std::list < PuzzlePieceSprite * >::iterator it;
int g = -1;
for (it = puzzlePieces.begin(); it != puzzlePieces.end(); it++)
{
if (g == -1)
g = (*it)->group;
if (fabs((*it)->angle) > 0.00001)
{
return false;
}
if ((*it)->group != g)
{
return false;
}
}
return true;
} | false | false | false | false | false | 0 |
bytearray_fromhex(PyObject *cls, PyObject *args)
{
PyObject *newbytes;
char *buf;
char *hex;
Py_ssize_t hexlen, byteslen, i, j;
int top, bot;
if (!PyArg_ParseTuple(args, "s#:fromhex", &hex, &hexlen))
return NULL;
byteslen = hexlen/2; /* This overestimates if there are spaces */
... | false | false | false | false | false | 0 |
coord_statement(coord *co, axisdesc& xa, axisdesc& ya, axis log) {
coord *c;
if (co) c = co;
else c = defcoord;
if ( xa.which != none ) {
c->xmin = xa.min;
c->xmax = xa.max;
c->xautoscale = 0;
}
if ( ya.which != none ) {
c->ymin = ya.min;
c->ymax = ya.max;
c->yautoscale = 0;
... | false | false | false | false | false | 0 |
arizona_micsupp_check_cp(struct work_struct *work)
{
struct arizona_micsupp *micsupp =
container_of(work, struct arizona_micsupp, check_cp_work);
struct snd_soc_dapm_context *dapm = micsupp->arizona->dapm;
struct arizona *arizona = micsupp->arizona;
struct regmap *regmap = arizona->regmap;
unsigned int reg;
int... | false | false | false | false | false | 0 |
scm_c_environment_fold (SCM env, scm_environment_folder proc, SCM data, SCM init)
{
SCM_ASSERT (SCM_ENVIRONMENT_P (env), env, SCM_ARG1, "scm_c_environment_fold");
return SCM_ENVIRONMENT_FOLD (env, proc, data, init);
} | false | false | false | false | false | 0 |
mailinfo(FILE *in, FILE *out, int ks, const char *encoding,
const char *msg, const char *patch)
{
keep_subject = ks;
metainfo_charset = encoding;
fin = in;
fout = out;
cmitmsg = fopen(msg, "w");
if (!cmitmsg) {
perror(msg);
return -1;
}
patchfile = fopen(patch, "w");
if (!patchfile) {
perror(patch... | false | false | false | false | true | 1 |
TerminalSpecialChars (int c)
{
if (c == termIntChar)
{
intp ();
return 0;
}
else if (c == termQuitChar)
{
#ifdef KLUDGELINEMODE
if (kludgelinemode)
sendbrk ();
else
#endif
sendabort ();
return 0;
}
else if (c == termEofChar)
{
if (my_want_state_is_will (TE... | false | false | false | false | false | 0 |
moveDemon(LiveMonster * live_monster)
{
int j;
// move sideways until you hit a wall or an edge
j = 1 + (int) (10.0 * rand() / (RAND_MAX));
if(j > 7) {
// increment the face to display
live_monster->face++;
if(live_monster->face >=
live_monster->monster->image_count * live_monster->monster->... | false | false | false | false | false | 0 |
ghod_hitsu(struct monst *priest)
{
int x, y, ax, ay, roomno = (int)temple_occupied(u.urooms);
struct mkroom *troom;
if (!roomno || !has_shrine(priest))
return;
ax = x = EPRI(priest)->shrpos.x;
ay = y = EPRI(priest)->shrpos.y;
troom = &rooms[roomno - ROOMOFFSET];
if((u.ux == x ... | false | false | false | false | false | 0 |
solid_macosx(int restore) {
char tmp[] = "/tmp/macosx_solid_background.XXXXXX";
pid_t pid, parent = getpid();
if (restore) {
rfbLog("restore pid: %d\n", (int) solid_macosx_pid);
if (solid_macosx_pid > 0) {
#if 0
int i, status;
#endif
rfbLog("kill -TERM macosx_solid_background helper pid: %d\n", (int) soli... | false | false | false | false | false | 0 |
parse_name(char **cmdlinep, dns_message_t *msg, dns_name_t **namep) {
isc_result_t result;
char *word;
isc_buffer_t *namebuf = NULL;
isc_buffer_t source;
word = nsu_strsep(cmdlinep, " \t\r\n");
if (word == NULL || *word == 0) {
fprintf(stderr, "could not read owner name\n");
return (STATUS_SYNTAX);
}
resu... | false | false | false | false | false | 0 |
unfilter2(unsigned char *prev, unsigned char *curr)
{
unsigned int pos;
for (pos = 1; pos < step; pos++)
curr[pos] += prev[pos];
} | false | false | false | false | true | 1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.