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 |
|---|---|---|---|---|---|---|
main(int argc, char **argv) {
int screen_num = 0;
std::string displayname;
bool withdraw = false;
std::string resourcefile("~/.fluxbox/fbpager");
bool show_resources = false;
int layer = -1;
for (int arg = 1; arg < argc; ++arg) {
string sarg = argv[arg];
// if argument starts... | false | false | false | false | false | 0 |
fl_add_xyplot_text( FL_OBJECT * ob,
double x,
double y,
const char * text,
int al,
FL_COLOR col )
{
FLI_XYPLOT_SPEC *sp;
int i;
#if FL_DEBUG >= ML_ERR
if ( ! IsValidClass( ob, FL_XY... | false | false | false | false | false | 0 |
handle_simu_canvas( FL_OBJECT * ob,
int event,
FL_Coord mx FL_UNUSED_ARG,
FL_Coord my FL_UNUSED_ARG,
int key FL_UNUSED_ARG,
void * ev FL_UNUSED_ARG )
{
int ftype;
switch ( event... | false | false | false | false | false | 0 |
recogIdentifyPixa(L_RECOG *recog,
PIXA *pixa,
NUMA *naid,
PIX **ppixdb)
{
char *text;
l_int32 i, n, doit, index, depth;
l_float32 score;
NUMA *naidt;
PIX *pix1, *pix2, *pix3;
PIXA *pixa1;
L_RCH *rch;
PROCNAME("recogIden... | false | false | false | false | false | 0 |
up_device_get_id (UpDevice *device)
{
GString *string;
gchar *id = NULL;
/* line power */
if (device->priv->type == UP_DEVICE_KIND_LINE_POWER) {
goto out;
/* batteries */
} else if (device->priv->type == UP_DEVICE_KIND_BATTERY) {
/* we don't have an ID if we are not present */
if (!device->priv->is_presen... | false | false | false | false | false | 0 |
xsh_frameset_crh_single(cpl_frameset* raws,xsh_remove_crh_single_param * crh_single_par,
xsh_instrument* instrument,const char* prefix,const char* spec)
{
/* remove crh on frame */
cpl_frameset* clean=NULL;
cpl_frame* frm=NULL;
int nraws=0;
int i=0;
char ftag[256];
char fname[256];
char arm_str[16] ;
cpl_f... | true | true | false | false | false | 1 |
norm_kkindex (SQUARE x, SQUARE y, /*@out@*/ SQUARE *pi, /*@out@*/ SQUARE *pj)
{
unsigned int rowx, rowy, colx, coly;
assert (x < 64);
assert (y < 64);
if (getcol(x) > 3) {
x = flipWE (x); /* x = x ^ 07 */
y = flipWE (y);
}
if (getrow(x) > 3) {
x = flipNS (x); /* x = x ^ 070 */
y = flipNS (y); ... | false | false | false | false | false | 0 |
decrease_reservation(unsigned long nr_pages, gfp_t gfp)
{
enum bp_state state = BP_DONE;
unsigned long i;
struct page *page, *tmp;
int ret;
struct xen_memory_reservation reservation = {
.address_bits = 0,
.extent_order = EXTENT_ORDER,
.domid = DOMID_SELF
};
LIST_HEAD(pages);
if (nr_pages > ARRAY_S... | false | false | false | false | false | 0 |
b_slist_append(b_slist_t *l, void *data)
{
b_slist_t *node = malloc(sizeof(b_slist_t));
if (node == NULL) {
l = NULL;
return l;
}
node->data = data;
node->next = NULL;
if (l == NULL)
l = node;
else {
b_slist_t *tmp;
for (tmp = l; tmp->next != NULL; tmp... | false | false | false | false | false | 0 |
knh_Array_add_(CTX ctx, kArray *a, kObject *value)
{
size_t capacity = a->dim->capacity;
if(a->size == capacity) {
knh_Array_grow(ctx, a, k_grow(capacity), a->size + 1);
}
KNH_INITv(a->list[a->size], value);
a->size++;
} | false | false | false | false | false | 0 |
arp_find_entry ( struct ll_protocol *ll_protocol,
struct net_protocol *net_protocol,
const void *net_addr ) {
struct arp_entry *arp;
for ( arp = arp_table ; arp < arp_table_end ; arp++ ) {
if ( ( arp->ll_protocol == ll_protocol ) &&
( arp->net_protocol == net_protocol ) &&
( memcmp ( arp->net_a... | false | false | false | false | false | 0 |
operator int() const
{
if (data_ == "NaN") return 0L;
if (data_ == "Inf" && sign_ == '+') return 0x7fffffff;
else if (data_ == "Inf") return -0x7fffffff - 1;
int l = 0;
for (long i=0; i<long(data_.length())+exp_; ++i) { l *= 10; if (i<long(data_.length())) l += (data_.c_str()[i]-'0'); } // might overflow!!!
... | false | false | false | false | false | 0 |
ReadPCT( unsigned char pct[768] )
{
PCIDSKBuffer seg_data;
seg_data.SetSize( 768*4 );
ReadFromFile( seg_data.buffer, 0, 768*4 );
int i;
for( i = 0; i < 256; i++ )
{
pct[ 0+i] = (unsigned char) seg_data.GetInt( 0+i*4, 4 );
pct[256+i] = (unsigned char) seg_data.GetInt(1024+i... | false | false | false | false | false | 0 |
alac_entropy_coder(AlacEncodeContext *s)
{
unsigned int history = s->rc.initial_history;
int sign_modifier = 0, i, k;
int32_t *samples = s->predictor_buf;
for(i=0;i < s->avctx->frame_size;) {
int x;
k = av_log2((history >> 9) + 3);
x = -2*(*samples)-1;
x ^= (x>>31);
... | false | false | false | false | false | 0 |
gdpy_fragment_delete(struct gdpy_fragment_t* self)
{
dtrace("%p", self);
Py_XDECREF(self->dirfile);
dreturnvoid();
} | false | false | false | false | false | 0 |
create_sspostscript(const ESL_GETOPTS *go)
{
int status;
SSPostscript_t *ps;
ESL_ALLOC(ps, sizeof(SSPostscript_t));
ps->npage = 0;
ps->modelname = NULL;
ps->modeA = NULL;
ps->descA = NULL;
ps->headerx = 0.;
ps->headery = 0.;
ps->headerx_desc = 0.;
ps->headerx_charsize = 0.;
ps->headery_char... | false | false | false | false | false | 0 |
showNum( double number )
{
QString text;
text.setNum( number );
const int cursorPos = d_data->valueEdit->cursorPosition();
d_data->valueEdit->setText( text );
d_data->valueEdit->setCursorPosition( cursorPos );
} | false | false | false | false | false | 0 |
xtables_option_tpcall(unsigned int c, char **argv, bool invert,
struct xtables_target *t, void *fw)
{
struct xt_option_call cb;
if (t->x6_parse == NULL) {
if (t->parse != NULL)
t->parse(c - t->option_offset, argv, invert,
&t->tflags, fw, &t->t);
return;
}
c -= t->option_offset;
cb.entry = xtabl... | false | false | false | false | false | 0 |
asn1c_copy_over(arg_t *arg, char *path) {
char *fname;
#ifdef _WIN32
int use_real_copy = 1;
#else
int use_real_copy = !(arg->flags & A1C_LINK_SKELETONS);
#endif
fname = a1c_basename(path);
if(!fname
|| (use_real_copy ? real_copy(path, fname) : symlink(path, fname))
) {
if(errno == EEXIST) {
struct stat sb1... | false | false | false | false | false | 0 |
jsm_get_mstat(struct jsm_channel *ch)
{
unsigned char mstat;
unsigned result;
jsm_dbg(IOCTL, &ch->ch_bd->pci_dev, "start\n");
mstat = (ch->ch_mostat | ch->ch_mistat);
result = 0;
if (mstat & UART_MCR_DTR)
result |= TIOCM_DTR;
if (mstat & UART_MCR_RTS)
result |= TIOCM_RTS;
if (mstat & UART_MSR_CTS)
res... | false | false | false | false | false | 0 |
specific_items_manager_figure_out_positioning (SpecificItemsManager* self) {
gint result = 0;
gint _result_ = 0;
gint _tmp0_ = 0;
gint _tmp22_ = 0;
gint _tmp23_ = 0;
g_return_val_if_fail (self != NULL, 0);
_result_ = 0;
_tmp0_ = self->priv->of_type;
if (_tmp0_ == ((gint) SPECIFIC_ITEMS_MANAGER_CATEGORY_TRACK))... | false | false | false | false | false | 0 |
process_buffer_back(OUTPUTHISTORY *h, long nof_zucs_chars)
{
z_ucs *current_index = h->z_history_buffer_front_index;
TRACE_LOG("Advancing buffer end from %p by %ld chars.\n",
current_index,
(long int)nof_zucs_chars);
do
{
TRACE_LOG("current-index: %p.\n", current_index);
if (*current_inde... | false | false | false | false | false | 0 |
deleteValue(Value *PtrVal) {
// Notify the alias analysis implementation that this value is gone.
AA.deleteValue(PtrVal);
// If this is a call instruction, remove the callsite from the appropriate
// AliasSet (if present).
if (Instruction *Inst = dyn_cast<Instruction>(PtrVal)) {
if (Inst->mayReadOrWriteM... | false | false | false | false | false | 0 |
usm_remove_user_from_list(struct usmUser *user,
struct usmUser **ppuserList)
{
struct usmUser *nptr, *pptr;
/*
* NULL pointers aren't allowed
*/
if (ppuserList == NULL)
return NULL;
if (*ppuserList == NULL)
return NULL;
/*
* find the user ... | false | false | false | false | false | 0 |
ddf_MatrixSubmatrix(ddf_MatrixPtr M, ddf_rowset delset) /* 092 */
{
ddf_MatrixPtr Msub=NULL;
ddf_rowrange i,isub=1, m,msub;
ddf_colrange d;
m= M->rowsize;
d= M->colsize;
msub=m;
if (m >=0 && d >=0){
for (i=1; i<=m; i++) {
if (set_member(i,delset)) msub-=1;
}
Msub=ddf_CreateMatrix(msub... | false | false | false | false | false | 0 |
UpdateAI(const uint32 uiDiff) override
{
if (!m_creature->SelectHostileTarget() || !m_creature->getVictim())
{
return;
}
if (m_uiDetonationTimer)
{
if (m_uiDetonationTimer <= uiDiff)
{
if (DoCastSpellIfCan(m_creature, SPELL... | false | false | false | false | false | 0 |
GetNextFeature()
{
if (m_nFeatureCount < 0) {
m_poReader->ReadDataRecords(this);
}
if (m_bGeometryPerBlock && !m_bGeometry) {
LoadGeometry();
}
if (m_iNextFeature < 0)
ResetReading();
if (m_iNextFeature < 0 || m_iNextFeature >= m_nFeatureCount)
return N... | false | false | false | false | false | 0 |
output_message(::aflibDebug::Level level, const char *msg) {
char buff[1024];
/* default to text output if no message app is defined or if it is a debug message. */
if (messageAppName == 0 || !strcmp(messageAppName, "") || (level == ::aflibDebug::lDebug))
{
fprintf(stderr, "%s\n", msg);
return;
}
switch... | false | false | false | false | false | 0 |
server_callback (SoupServer *server, SoupMessage *msg,
const char *path, GHashTable *query,
SoupClientContext *context, gpointer data)
{
soup_message_headers_append (msg->response_headers,
"X-Handled-By", "server_callback");
if (!strcmp (path, "*")) {
debug_printf (1, " default server_callback go... | false | false | false | false | false | 0 |
pcm_encode_init(AVCodecContext *avctx)
{
avctx->frame_size = 1;
switch(avctx->codec->id) {
case CODEC_ID_PCM_ALAW:
build_xlaw_table(linear_to_alaw, alaw2linear, 0xd5);
break;
case CODEC_ID_PCM_MULAW:
build_xlaw_table(linear_to_ulaw, ulaw2linear, 0xff);
break;
default:... | false | false | false | false | false | 0 |
gnc_counter_end_handler(gpointer data_for_children,
GSList* data_from_children, GSList* sibling_data,
gpointer parent_data, gpointer global_data,
gpointer *result, const gchar *tag)
{
char *strval;
gint64 val;
char *type;
xmlNodePtr... | false | false | false | false | false | 0 |
MPD_ChannelGetSLP(GF_InputService *plug, LPNETCHANNEL channel, char **out_data_ptr, u32 *out_data_size, GF_SLHeader *out_sl_hdr, Bool *sl_compressed, GF_Err *out_reception_status, Bool *is_new_data)
{
GF_MPD_In *mpdin = (GF_MPD_In*) plug->priv;
GF_InputService *segment_ifce = MPD_GetInputServiceForChannel(mpdin, c... | false | false | false | false | false | 0 |
X86SelectStore(const Instruction *I) {
// Atomic stores need special handling.
const StoreInst *S = cast<StoreInst>(I);
if (S->isAtomic())
return false;
unsigned SABIAlignment =
TD.getABITypeAlignment(S->getValueOperand()->getType());
if (S->getAlignment() != 0 && S->getAlignment() < SABIAlignment)
... | false | false | false | false | false | 0 |
EnsureCompiledIrregexp(Handle<JSRegExp> re, bool is_ascii) {
Object* compiled_code = re->DataAt(JSRegExp::code_index(is_ascii));
#ifdef V8_NATIVE_REGEXP
if (compiled_code->IsCode()) return true;
#else // ! V8_NATIVE_REGEXP (RegExp interpreter code)
if (compiled_code->IsByteArray()) return true;
#endif
return C... | false | false | false | false | false | 0 |
cpalloc(const void *p, size_t size)
{
void *n = io_malloc(size);
if(p) memcpy(n, p, size);
return n;
} | false | false | false | false | false | 0 |
Reserve(int new_size) {
if (total_size_ >= new_size) return;
void** old_elements = elements_;
total_size_ = max(total_size_ * 2, new_size);
elements_ = new void*[total_size_];
memcpy(elements_, old_elements, allocated_size_ * sizeof(elements_[0]));
if (old_elements != initial_space_) {
delete [] old_el... | false | false | false | false | false | 0 |
rpc_hook_add_header(struct evhttp_request *req,
struct evbuffer *evbuf, void *arg)
{
const char *hook_type = arg;
if (strcmp("input", hook_type) == 0)
evhttp_add_header(req->input_headers, "X-Hook", hook_type);
else
evhttp_add_header(req->output_headers, "X-Hook", hook_type);
return (0);
} | false | false | false | false | false | 0 |
acpi_ibm_smbus_match(acpi_handle handle)
{
char node_name[ACPI_PATH_SEGMENT_LENGTH];
struct acpi_buffer path = { sizeof(node_name), node_name };
if (!dmi_name_in_vendors("IBM"))
return false;
/* Look for SMBS object */
if (ACPI_FAILURE(acpi_get_name(handle, ACPI_SINGLE_NAME, &path)) ||
strcmp("SMBS", path... | false | false | false | false | false | 0 |
get_limit ()
{
int size = hexchat_pluginpref_get_int (ph, "limit");
if (size <= -1 || size >= INT_MAX)
{
return DEFAULT_LIMIT;
}
else
{
return size;
}
} | false | false | false | false | false | 0 |
setopmode_hdl(struct adapter *padapter, u8 *pbuf)
{
u8 type;
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
struct mlme_ext_info *pmlmeinfo = &(pmlmeext->mlmext_info);
struct setopmode_parm *psetop = (struct setopmode_parm *)pbuf;
if (psetop->mode == Ndis802_11APMode) {
pmlmeinfo->state = WIFI_FW_AP_S... | false | false | false | false | false | 0 |
PrintOperation(Operation* op, ostream& os, vtkIndent indent)
{
os << indent << "Id: " << op->Id << endl;
os << indent << "Type: " << op->OperationType << endl;
os << indent << "Field type: " << op->FieldType << endl;
if ( op->FieldName)
{
os << indent << "Field name: " << op->FieldName << endl;
}
... | false | false | false | false | false | 0 |
CleanSurface()
{
if(!picture)
return;
int x = 0, y = 0;
Uint32 pix = SDL_MapRGB(picture->format, 255, 0, 255);
while(x < picture->w)
{
y = 0;
if(SoFontGetPixel(picture, x, y) == pix)
SoFontSetPixel(picture, x, y, background);
x++;
}
} | false | false | false | false | false | 0 |
canon_get_delay(canon_privdata_t* privdata,char color){
int i=0;
int delay = 0;
const canon_delay_t* delaylist = privdata->mode->delay;
while(delaylist && delaylist[i].color){
if(delaylist[i].color == color){
delay = delaylist[i].delay;
break;
}
++i;
}
... | false | false | false | false | false | 0 |
sm_dereference(seg_manager_t *self, reg_t pointer, int *size)
{
mem_obj_t *mobj;
byte *base = NULL;
int count;
if (!pointer.segment
|| (pointer.segment >= self->heap_size)
|| !self->heap[pointer.segment]) {
sciprintf("Error: Attempt to dereference invalid pointer "PREG"!\n",
PRINT_REG(pointer));
... | false | false | false | false | false | 0 |
corkscrew_probe1(int ioaddr, int irq, int product_index __unused,
struct nic *nic)
{
unsigned int eeprom[0x40], checksum = 0; /* EEPROM contents */
int i;
printf("3Com %s at 0x%hX, ", vp->product_name, ioaddr);
/* Read the station address from the EEPROM. */
EL3WINDOW(0);
for (i = 0; i < 0x18; i++) {
short... | false | false | false | false | false | 0 |
IfThen (int NbArg,long *TabArg)
{
char *arg[10];
int i,j;
int CurrArg=0;
int IdFuncComp = 0;
/* Verification de la condition */
for (j=0; j<NbArg-2; j++)
{
if (TabArg[j] > 100000) /* Cas du codage d'un nombre */
{
i = (int)TabArg[j] - 200000;
arg[CurrArg] = (char*)safecalloc(1,siz... | false | false | false | false | false | 0 |
irmo_object_internal_set(IrmoObject *object,
IrmoClassVar *variable,
IrmoValue *value,
int update_binding)
{
IrmoValue *obj_value;
obj_value = &object->variables[variable->index];
// Set the variable
switch (v... | false | false | false | false | false | 0 |
reset_idle_watch (GsmPresence *presence)
{
if (presence->priv->idle_watch_id > 0) {
g_debug ("GsmPresence: removing idle watch (%i)", presence->priv->idle_watch_id);
gnome_idle_monitor_remove_watch (presence->priv->idle_monitor,
p... | false | false | false | false | false | 0 |
call_pcm_capture_hook(struct hda_pcm_stream *hinfo,
struct hda_codec *codec,
struct snd_pcm_substream *substream,
int action)
{
struct hda_gen_spec *spec = codec->spec;
if (spec->pcm_capture_hook)
spec->pcm_capture_hook(hinfo, codec, substream, action);
} | false | false | false | false | false | 0 |
ncp_update_known_namespace(struct ncp_server *server, __u8 volume, int *ret_ns)
{
int ns = ncp_get_known_namespace(server, volume);
if (ret_ns)
*ret_ns = ns;
ncp_dbg(1, "namespace[%d] = %d\n", volume, server->name_space[volume]);
if (server->name_space[volume] == ns)
return 0;
server->name_space[volume] = n... | false | false | false | false | false | 0 |
CreateCabinet()
/*
* FUNCTION: Create cabinet
*/
{
ULONG Status;
Status = Load(FileName);
if (Status != CAB_STATUS_SUCCESS)
{
printf("Specified directive file could not be found: %s.\n", FileName);
return false;
}
Status = Parse();
return (Status == CAB_STATUS_SUCCESS ? ... | false | false | false | false | false | 0 |
insertNewInterpretation(GATEWAY_EVENT * e, DUL_NETWORKKEY ** network,
DMAN_HANDLE ** d, FIS_HANDLE ** f, char *local, char *remote)
{
CONDITION cond,
rtnCond = 1;
FIS_INTERPRETATIONRECORD *interpretationPtr,
interpretation;
interpretationPtr = &(e->r.interpretation);
if (logLeve... | false | false | false | false | false | 0 |
GAM_QueryInfo_create(Sequence *query, GAM *gam){
register GAM_QueryInfo *gqi = g_new(GAM_QueryInfo, 1);
register gint i, j;
register Match *match;
register Match_Score th;
gqi->query_id = g_strdup(query->id);
gqi->threshold = 0;
/* Calculate best threshold for each query match */
for(i =... | false | false | false | false | false | 0 |
Scm_Openpty(ScmObj slaveterm)
{
int master, slave;
struct termios *term = NULL;
if (SCM_SYS_TERMIOS_P(slaveterm)) {
term = &SCM_SYS_TERMIOS(slaveterm)->term;
}
if (openpty(&master, &slave, NULL, term, NULL) < 0) {
Scm_SysError("openpty failed");
}
return Scm_Values2(SCM_MAKE... | false | false | false | false | false | 0 |
set_par_from_dar (MPEGSeqHdr * hdr, guint8 asr_code)
{
/* Pixel_width = DAR_width * display_vertical_size */
/* Pixel_height = DAR_height * display_horizontal_size */
switch (asr_code) {
case 0x02: /* 3:4 DAR = 4:3 pixels */
hdr->par_w = 4 * hdr->height;
hdr->par_h = 3 * hdr->width... | false | false | false | false | false | 0 |
__socket_ssl_readv (rpc_transport_t *this, struct iovec *opvector, int opcount)
{
socket_private_t *priv = NULL;
int sock = -1;
int ret = -1;
priv = this->private;
sock = priv->sock;
if (priv->use_ssl) {
ret = ssl_read_one (this, opvector->iov_base, opvector->iov_len);
} ... | false | false | false | false | false | 0 |
install_first_update (GtkSourceContextEngine *ce)
{
if (ce->priv->first_update == 0)
{
if (ce->priv->incremental_update != 0)
{
g_source_remove (ce->priv->incremental_update);
ce->priv->incremental_update = 0;
}
ce->priv->first_update =
gdk_threads_add_idle_full (FIRST_UPDATE_PRIORITY,
... | false | false | false | false | false | 0 |
sp_open_helper (call_frame_t *frame, xlator_t *this, loc_t *loc, int32_t flags,
fd_t *fd, int32_t wbflags)
{
uint64_t value = 0;
sp_inode_ctx_t *inode_ctx = NULL;
int32_t ret = 0, op_ret = -1, op_errno = EINVAL;
GF_ASSERT (frame);
GF_VALI... | false | false | false | true | true | 1 |
init_wires(void)
{
int32 ii;
__wire_init = TRUE;
/* go through list of 1 inst. corresponding to each top level module */
/* ignore all delays in propagating from lhs's to rhs's */
__nchg_futend = __nchg_futhdr = NULL;
__initalw_thrd_hdr = NULL;
/* SJM - 05/24/00 - must not process var changes until 0 normal #0... | false | false | false | false | false | 0 |
hkt_fetch_kvno(krb5_context context, HDB * db, krb5_const_principal principal,
unsigned flags, krb5_kvno kvno, hdb_entry_ex * entry)
{
hdb_keytab k = (hdb_keytab)db->hdb_db;
krb5_error_code ret;
krb5_keytab_entry ktentry;
if (!(flags & HDB_F_KVNO_SPECIFIED)) {
/* Preserve previous behaviou... | false | false | false | false | false | 0 |
save_to_document()
{
if(get_userlevel() == AppState::USERLEVEL_DEVELOPER)
{
//Save the hidden tables. TODO_usermode: Only if we are in developer mode.
Document::type_listTableInfo listTables;
Document* document = get_document();
for(Gtk::TreeModel::iterator iter = m_AddDel.get_model()->children().... | false | false | false | false | false | 0 |
esl_tree_SetTaxonlabels(ESL_TREE *T, char **names)
{
int i;
int status;
if (T->taxonlabel != NULL) esl_Free2D((void **) T->taxonlabel, T->N);
ESL_ALLOC(T->taxonlabel, sizeof(char **) * T->nalloc);
for (i = 0; i < T->nalloc; i++) T->taxonlabel[i] = NULL;
if (names != NULL)
{
for (i = 0; i < T-... | false | true | false | false | true | 1 |
text_editor_get_num_bookmarks(TextEditor* te)
{
gint nLineNo = -1 ;
gint nMarkers = 0 ;
g_return_val_if_fail (te != NULL, 0 );
while( ( nLineNo = text_editor_get_bookmark_line( te, nLineNo ) ) >= 0 )
{
//printf( "Line %d\n", nLineNo );
nMarkers++;
}
//printf( "out Line %d\n", nLineNo );
return nMarkers ;
... | false | false | false | false | false | 0 |
scpiLex_CharacterProgramData(lex_state_t * state, scpi_token_t * token) {
token->ptr = state->pos;
if (!iseos(state) && isalpha(state->pos[0])) {
state->pos++;
while (!iseos(state) && (isalnum(state->pos[0]) || ischr(state, '_'))) {
state->pos++;
}
}
token->len = st... | false | false | false | false | false | 0 |
setup_unlock_keyring_other (GkmWrapPrompt *self,
const gchar *label)
{
GcrPrompt *prompt;
const gchar *choice;
gchar *text;
g_assert (GKM_IS_WRAP_PROMPT (self));
prompt = GCR_PROMPT (self);
gcr_prompt_set_title (prompt, _("Unlock Keyring"));
text = g_markup_printf_escaped (_("Enter... | false | false | false | false | false | 0 |
tidy_fallthru_edge (e, b, c)
edge e;
basic_block b, c;
{
rtx q;
/* ??? In a late-running flow pass, other folks may have deleted basic
blocks by nopping out blocks, leaving multiple BARRIERs between here
and the target label. They ought to be chastized and fixed.
We can also wind up with ... | false | false | false | false | false | 0 |
rearrange_for_call(CSARG **args)
{
CSARG *larg = NULL;
CSARG *carg = *args;
CSARG *vargs = NULL;
int nargs = 0;
/* multiple argument case, we have to walk the args and reverse
* them. Also handles single arg case since its the same as the
* last arg */
while (carg)
{
nargs++;
if (carg->op_t... | true | true | false | false | true | 1 |
zlenCommand(redisClient *c) {
robj *o;
zset *zs;
o = lookupKeyRead(c->db,c->argv[1]);
if (o == NULL) {
addReply(c,shared.czero);
return;
} else {
if (o->type != REDIS_ZSET) {
addReply(c,shared.wrongtypeerr);
} else {
zs = o->ptr;
... | false | false | false | false | false | 0 |
isHTMLTag ( const char * tag )
{
if ( !tag || !strlen(tag) )
return false ;
if ( !g_ascii_strcasecmp ( tag, AP_CLIPBOARD_TXT_HTML ) ||
!g_ascii_strcasecmp ( tag, AP_CLIPBOARD_APPLICATION_XHTML ) )
return true ;
return false ;
} | false | false | false | false | false | 0 |
mwifiex_cmd_issue_chan_report_request(struct mwifiex_private *priv,
struct host_cmd_ds_command *cmd,
void *data_buf)
{
struct host_cmd_ds_chan_rpt_req *cr_req = &cmd->params.chan_rpt_req;
struct mwifiex_radar_params *radar_params = (void *)data_buf;
cmd->command = cpu_to_le16(HostCmd_CMD_CHAN_REPORT_R... | false | false | false | false | false | 0 |
Stage3end_chrpos_low_trim (T this) {
if (this->plusp == true) {
return Substring_alignstart_trim(this->substring_low) - Substring_chroffset(this->substring_low);
} else {
return Substring_alignend_trim(this->substring_low) - Substring_chroffset(this->substring_low);
}
} | false | false | false | false | false | 0 |
user_arpspoof_test(struct arp_spoof_info *asi)
{
char mac_buf[64];
int retval;
if ((retval = find_asi_dst_mac(asi, "dst mac isn't known - cannot do test\n")) < 0)
return retval;
if (arpspoof_test(asi) == 0)
return 0;
sprintf_eth_mac(mac_buf, asi->src_fake_mac);
set_tty_color(COLOR_BRIGHTRED);
printf("ARP s... | false | false | false | false | false | 0 |
hda_call_codec_resume(struct hda_codec *codec)
{
atomic_inc(&codec->core.in_pm);
if (codec->core.regmap)
regcache_mark_dirty(codec->core.regmap);
codec->power_jiffies = jiffies;
hda_set_power_state(codec, AC_PWRST_D0);
restore_shutup_pins(codec);
hda_exec_init_verbs(codec);
snd_hda_jack_set_dirty_all(codec)... | false | false | false | false | false | 0 |
getResourceStrList(const string& resource_path, list<string> &res)
{
xmlNodePtr node = XMLTools::getXmlNodeByPath(root, resource_path.c_str());
if (node)
{
xmlNodePtr c;
for(c=node->xmlChildrenNode; c; c=c->next)
{
if ( xmlIsBlankNode(c) ) continue;
res.push_... | false | false | false | false | false | 0 |
unitProp(const std::vector<Theorem>& thms,
const Theorem& clause,
unsigned i) {
Expr e(clause.getExpr());
if(CHECK_PROOFS) {
// Soundness check: first, check the form of the 'clause' theorem
CHECK_SOUND(e.isOr() && e.arity() > (int)... | false | false | false | false | false | 0 |
GMT_draw_z_scale (double x0, double y0, double length, double zscale, GMT_LONG gave_xy, char *units)
{
double dy, off, xx[4], yy[4];
char txt[GMT_LONG_TEXT];
GMT_setpen (&gmtdefs.tick_pen);
if (!gave_xy) {
GMT_geo_to_xy (x0, y0, &xx[0], &yy[0]);
x0 = xx[0]; y0 = yy[0];
}
if (units)
sprintf (txt, "%g %s",... | true | true | false | false | false | 1 |
pushbuf_flush(struct nouveau_pushbuf *push)
{
struct nouveau_pushbuf_priv *nvpb = nouveau_pushbuf(push);
struct nouveau_pushbuf_krec *krec = nvpb->krec;
struct drm_nouveau_gem_pushbuf_bo *kref;
struct nouveau_bufctx *bctx, *btmp;
struct nouveau_bo *bo;
int ret = 0, i;
if (push->channel) {
ret = pushbuf_submit... | false | false | false | false | false | 0 |
add_execute_checkbox_with_label (NautilusPropertiesWindow *window,
GtkGrid *grid,
GtkWidget *sibling,
const char *label,
guint32 permission_to_check,
GtkLabel *label_for,
gboolean is_folder)
{
GtkWidget *check_button;
gboolean a11y_enabled;
check_button = gtk_check_button_new_with_mne... | false | false | false | false | false | 0 |
gst_camera_bin_finish_video_file (GstCameraBin2 * camerabin)
{
/* make sure the file is closed */
gst_element_set_state (camerabin->videosink, GST_STATE_NULL);
gst_video_capture_bin_post_video_done (camerabin);
GST_CAMERA_BIN2_PROCESSING_DEC (camerabin);
} | false | false | false | false | false | 0 |
dummy_urb_enqueue(
struct usb_hcd *hcd,
struct urb *urb,
gfp_t mem_flags
) {
struct dummy_hcd *dum_hcd;
struct urbp *urbp;
unsigned long flags;
int rc;
urbp = kmalloc(sizeof *urbp, mem_flags);
if (!urbp)
return -ENOMEM;
urbp->urb = urb;
urbp->miter_started = 0;
dum_hcd = hcd_to_dummy_hcd(hcd);
... | false | false | false | false | false | 0 |
i40e_mac_filter_entry_clone(
struct i40e_mac_filter *src)
{
struct i40e_mac_filter *f;
f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (!f)
return NULL;
*f = *src;
INIT_LIST_HEAD(&f->list);
return f;
} | false | false | false | false | false | 0 |
do_put_one_dir(const char *hostport, const char *source_file, const char *target_file, int mode, time_t stoptime)
{
char new_source_file[CHIRP_PATH_MAX];
char new_target_file[CHIRP_PATH_MAX];
struct list *work_list;
const char *name;
INT64_T result;
INT64_T total = 0;
struct dirent *d;
DIR *dir;
work_list = ... | true | true | true | false | false | 1 |
ndarray_tobytes(PyObject *self, PyObject *dummy)
{
ndbuf_t *ndbuf = ((NDArrayObject *)self)->head;
Py_buffer *src = &ndbuf->base;
Py_buffer dest;
PyObject *ret = NULL;
char *mem;
if (ND_C_CONTIGUOUS(ndbuf->flags))
return PyBytes_FromStringAndSize(src->buf, src->len);
assert(src->sh... | false | false | false | false | false | 0 |
gst_sdi_mux_sink_event (GstPad * pad, GstEvent * event)
{
gboolean res;
GstSdiMux *sdimux;
sdimux = GST_SDI_MUX (gst_pad_get_parent (pad));
GST_DEBUG_OBJECT (sdimux, "event");
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_FLUSH_START:
res = gst_pad_push_event (sdimux->srcpad, event);
bre... | false | false | false | false | false | 0 |
contentDocument() const
{
QWidget* widget = childWidget();
if( widget && qobject_cast<KHTMLView*>( widget ) )
return static_cast<KHTMLView*>( widget )->part()->xmlDocImpl();
return 0;
} | false | false | false | false | false | 0 |
menu_frame_shutdown(gboolean reconfig)
{
RrAppearanceFree(a_sep);
if (reconfig) return;
client_remove_destroy_notify(client_dest);
g_hash_table_destroy(menu_frame_map);
} | false | false | false | false | false | 0 |
counter_free_res(struct mlx4_dev *dev, int slave, int op, int cmd,
u64 in_param, u64 *out_param)
{
int index;
int err;
if (op != RES_OP_RESERVE)
return -EINVAL;
index = get_param_l(&in_param);
if (index == MLX4_SINK_COUNTER_INDEX(dev))
return 0;
err = rem_res_range(dev, slave, index, 1, RES_COUNTER,... | false | false | false | false | false | 0 |
nvbios_rammapEm(struct nvkm_bios *bios, u16 mhz,
u8 *ver, u8 *hdr, u8 *cnt, u8 *len, struct nvbios_ramcfg *info)
{
int idx = 0;
u32 data;
while ((data = nvbios_rammapEp(bios, idx++, ver, hdr, cnt, len, info))) {
if (mhz >= info->rammap_min && mhz <= info->rammap_max)
break;
}
return data;
} | false | false | false | false | false | 0 |
gt_bsGetNonUniformUInt64Array(
constBitString str, BitOffset offset, size_t numValues,
BitOffset numBitsTotal, unsigned numBitsList[], uint64_t val[])
{
/* idea: read as much as possible from str in each iteration,
* accumulate if bitsLeft < numBits */
size_t j = 0;
BitOffset totalBitsLeft = numBitsTotal;
... | false | false | false | false | false | 0 |
df_free_ref (df_ref ref)
{
struct df_scan_problem_data *problem_data
= (struct df_scan_problem_data *) df_scan->problem_data;
switch (DF_REF_CLASS (ref))
{
case DF_REF_BASE:
pool_free (problem_data->ref_base_pool, ref);
break;
case DF_REF_ARTIFICIAL:
pool_free (problem_data->ref_... | false | false | false | false | false | 0 |
find_obj(void *start, void *end, int is_certain, int is_aligned)
{
void **p;
int offset;
offset = 0;
do {
for (p = (void **)start + offset; p < (void **)end; p++) {
if (*p == findee) {
found = TRUE;
return;
}
}
offset += AL... | false | false | false | false | false | 0 |
CbcTestFile(const std::string name)
{
FILE *fp = fopen(name.c_str(), "r");
if (fp) {
fclose(fp);
return true;
}
return false;
} | false | false | false | false | false | 0 |
snd_pcm_ladspa_check_connect(snd_pcm_ladspa_plugin_t *plugin,
snd_pcm_ladspa_plugin_io_t *io,
snd_pcm_ladspa_eps_t *eps,
unsigned int depth)
{
unsigned int idx, midx;
int err = 0;
fo... | false | false | false | false | false | 0 |
bnxt_get_ethtool_stats(struct net_device *dev,
struct ethtool_stats *stats, u64 *buf)
{
u32 i, j = 0;
struct bnxt *bp = netdev_priv(dev);
int buf_size = bnxt_get_num_stats(bp) * sizeof(u64);
u32 stat_fields = sizeof(struct ctx_hw_stats) / 8;
memset(buf, 0, buf_size);
if (!bp->bnapi)
return;
for (i = ... | false | false | false | false | false | 0 |
k_ip2ip(struct sample *smp, union stktable_key_data *kdata, size_t *len)
{
if (smp->type == SMP_T_IPV6) {
v6tov4(&kdata->ip, &smp->data.ipv6);
return (void *)&kdata->ip.s_addr;
}
else {
return (void *)&smp->data.ipv4.s_addr;
}
} | false | false | false | false | false | 0 |
enumerateDecks(void)
{
uint8_t nDecks = 0;
int i;
bool noError = true;
uint32_t usedPeriph = 0;
uint32_t usedGpio = 0;
owInit();
if (owScan(&nDecks))
{
DEBUG_PRINT("Found %d deck memor%s.\n", nDecks, nDecks>1?"ies":"y");
} else {
DEBUG_PRINT("Error scanning for deck memories, "
... | false | false | false | false | false | 0 |
IMGfogRemap16x16(char* imageBuf, int pitch, int x, int y, char**colorTableArray, unsigned char a, unsigned char b, unsigned char c, unsigned char d)
{
uint8_t *buf = reinterpret_cast<uint8_t *>(imageBuf);
int c1 = 16*a; // C1(0)
int c2 = 16*b; // C2(0)
int bxy; // B uses fixed point 24.8 arithmetic
int C2subC1... | false | false | false | false | false | 0 |
read_pri(uint *pri, const char *buf, char **end)
{
char *tend;
uint tpri;
errno = 0;
while (buf[0] == ' ') buf++;
if (!isdigit(buf[0])) return -1;
tpri = strtoul(buf, &tend, 10);
if (tend == buf) return -1;
if (errno && errno != ERANGE) return -1;
if (!end && tend[0] != '\0') return... | false | false | false | false | false | 0 |
pixmap(const MSPixmap &pixmap_)
{
if(showState()==ShowLabel)
showState(ShowBoth);
else
showState(ShowPixmap);
MSPixmap *tmp=_pixmap;
if (pixmap_.server()==server())
_pixmap=new MSPixmap(pixmap_);
else
{
MSMessageLog::warningMessage("Warning : Pixmap supplied for MSMenuItem is invalid, usin... | false | false | false | false | false | 0 |
AllocNewBlock()
{
// Try to reuse garbage blocks first
if (GetFirstGarbageBlock() > 0)
return PopGarbageBlock();
// ... or alloc a new block at EOF
if (m_nLastAllocatedBlock==-1)
m_nLastAllocatedBlock = 0;
else
m_nLastAllocatedBlock+=m_nBlockSize;
return m_nLastAllocate... | 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.