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 |
|---|---|---|---|---|---|---|
vb2_ioctl_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *p)
{
struct video_device *vdev = video_devdata(file);
int res = vb2_verify_memory_type(vdev->queue, p->memory, p->type);
if (res)
return res;
if (vb2_queue_is_busy(vdev, file))
return -EBUSY;
res = vb2_core_reqbufs(vdev->queue, ... | false | false | false | false | false | 0 |
ewmh_set_net_client_list(ScreenInfo *s) {
Window *windows = alloc_window_array();
struct list *iter;
int i = 0;
for (iter = clients_mapping_order; iter; iter = iter->next) {
Client *c = iter->data;
if (c->screen == s) {
windows[i++] = c->window;
}
}
XChangeProperty(dpy, s->root, xa_net_client_list,
XA... | false | false | false | false | false | 0 |
SetSizeCX(double cReal, double cImag,
double xReal, double xImag)
{
int axis;
int idx;
int d;
double *s = this->GetSizeCX();
if (s[0] == cReal && s[1] == cImag && s[2] == xReal && s[3] == xImag)
{
return;
}
this->Modified();
// Set this because inform... | false | false | false | false | false | 0 |
print_node_record(ib_node_record_t * node_record)
{
ib_node_info_t *p_ni = &node_record->node_info;
ib_node_desc_t *p_nd = &node_record->node_desc;
char *name;
switch (node_print_desc) {
case LID_ONLY:
case UNIQUE_LID_ONLY:
printf("%d\n", cl_ntoh16(node_record->lid));
return;
case GUID_ONLY:
printf("0x%01... | false | false | false | false | false | 0 |
flickcurl_free_group(flickcurl_group *group)
{
FLICKCURL_ASSERT_OBJECT_POINTER_RETURN(group, flickcurl_group);
if(group->nsid)
free(group->nsid);
if(group->name)
free(group->name);
if(group->description)
free(group->description);
if(group->lang)
free(group->lang);
if(group->thro... | false | false | false | false | false | 0 |
loadFilter()
{
// Prompt for a file.
QString path = QFileDialog::getOpenFileName(this, tr("Load Filter"));
if (path.isEmpty())
return;
// Open the file.
QFile file(path);
if (!file.open(QIODevice::ReadOnly)) {
QString msg = tr("Failed to open '%1'").arg(path);
QMessageBox::critical(this, tr("File Error"), ... | false | false | false | false | false | 0 |
gregorio_set_score_transcription_date (gregorio_score *score,
char *transcription_date)
{
if (!score)
{
gregorio_message (_("function called with NULL argument"),
"gregorio_set_score_transcription_date", WARNING,
0);
return;
}
score->si.transcription_date = transcription_date;
} | false | false | false | false | false | 0 |
_PrintExtraToc(ArchiveHandle *AH, TocEntry *te)
{
lclTocEntry *ctx = (lclTocEntry *) te->formatData;
if (AH->public.verbose && ctx->filename != NULL)
ahprintf(AH, "-- File: %s\n", ctx->filename);
} | false | false | false | false | false | 0 |
sinfo_parse_cpl_input_badnorm(cpl_parameterlist * cpl_cfg,
cpl_frameset* sof,
const char* procatg,
cpl_frameset** raw)
{
bad_config * cfg ;
int status = 0;
/* Removed check on ini_file *... | false | false | false | false | false | 0 |
SPF_i_done(SPF_response_t *spf_response,
SPF_result_t result, SPF_reason_t reason, SPF_errcode_t err)
{
SPF_request_t *spf_request;
SPF_server_t *spf_server;
SPF_ASSERT_NOTNULL(spf_response);
spf_request = spf_response->spf_request;
SPF_ASSERT_NOTNULL(spf_request);
spf_server = spf_request->spf_server;
SPF_ASS... | false | false | false | false | false | 0 |
radeon_legacy_tmds_int_commit(struct drm_encoder *encoder)
{
struct radeon_device *rdev = encoder->dev->dev_private;
radeon_legacy_tmds_int_dpms(encoder, DRM_MODE_DPMS_ON);
if (rdev->is_atom_bios)
radeon_atom_output_lock(encoder, true);
else
radeon_combios_output_lock(encoder, true);
} | false | false | false | false | false | 0 |
xadc_zynq_read_adc_reg(struct xadc *xadc, unsigned int reg,
uint16_t *val)
{
uint32_t cmd[2];
uint32_t resp, tmp;
int ret;
cmd[0] = XADC_ZYNQ_CMD(XADC_ZYNQ_CMD_READ, reg, 0);
cmd[1] = XADC_ZYNQ_CMD(XADC_ZYNQ_CMD_NOP, 0, 0);
spin_lock_irq(&xadc->lock);
xadc_zynq_update_intmsk(xadc, XADC_ZYNQ_INT_DFIFO_GTH,
... | false | false | false | false | false | 0 |
ossl_cipher_name(VALUE self)
{
EVP_CIPHER_CTX *ctx;
GetCipher(self, ctx);
return rb_str_new2(EVP_CIPHER_name(EVP_CIPHER_CTX_cipher(ctx)));
} | false | false | false | false | false | 0 |
slist_delete(slist_head *head, slist_node *node)
{
slist_node *last = &head->head;
slist_node *cur;
bool found PG_USED_FOR_ASSERTS_ONLY = false;
while ((cur = last->next) != NULL)
{
if (cur == node)
{
last->next = cur->next;
#ifdef USE_ASSERT_CHECKING
found = true;
#endif
break;
}
last = cur;
}
... | false | false | false | false | false | 0 |
dict_del (dict_t *this, char *key)
{
if (!this || !key) {
gf_log_callingfn ("dict", GF_LOG_WARNING,
"!this || key=%s", key);
return;
}
LOCK (&this->lock);
int hashval = SuperFastHash (key, strlen (key)) % this->hash_size... | false | false | false | false | false | 0 |
place8ballnrs( BallsType * balls )
{
int i,j,act;
int ok=1;
do{
for(i=0;i<balls->nr;i++){
if(i==0){
balls->ball[i].nr=0;
}else if(i==5){
balls->ball[i].nr=8;
}else{
int ok;
act = rand() ... | false | false | false | false | false | 0 |
sys_fscanf_compiletf(PLI_BYTE8 *name)
{
vpiHandle callh = vpi_handle(vpiSysTfCall, 0);
vpiHandle argv = vpi_iterate(vpiArgument, callh);
/* Check that there are arguments. */
if (argv == 0) {
vpi_printf("ERROR: %s:%d: ", vpi_get_str(vpiFile, callh),
(int)vpi_get(vpiLineNo, callh... | false | false | false | false | false | 0 |
desktop_directory_file_cancel_call_when_ready (NautilusFile *file,
NautilusFileCallback callback,
gpointer callback_data)
{
NautilusDesktopDirectoryFile *desktop_file;
DesktopCallback search_key, *desktop_callback;
desktop_file = NAUTILUS_DESKTOP_DIRECTORY_FILE (file);
/* Find the entry in... | false | false | false | false | false | 0 |
initMap(USystemTimeZoneType type, int32_t& len, UErrorCode& ec) {
len = 0;
if (U_FAILURE(ec)) {
return NULL;
}
int32_t *result = NULL;
UResourceBundle *res = ures_openDirect(0, kZONEINFO, &ec);
res = ures_getByKey(res, kNAMES, res, &ec); // dereference Zones... | false | false | false | false | false | 0 |
drawLine(QScriptContext *ctx, QScriptEngine *eng)
{
DECLARE_SELF(QPainter, drawLine);
if (ctx->argumentCount() == 4) {
// x1, y1, x2, y2
self->drawLine(ctx->argument(0).toInt32(),
ctx->argument(1).toInt32(),
ctx->argument(2).toInt32(),
... | false | false | false | false | false | 0 |
document_scintilla_get_current_position(Documentable *doc)
{
g_return_val_if_fail(doc, -1);
Document_ScintillaDetails *docdet = DOCUMENT_SCINTILLA_GET_PRIVATE(doc);
return gtk_scintilla_get_current_pos(GTK_SCINTILLA(docdet->scintilla));
} | false | false | false | false | false | 0 |
change_reviewer_list(change::pointer cp, string_list_ty &result)
{
trace(("change_reviewer_list(cp = %08lX, result = &%08lX)\n{\n",
(long)cp, (long)&result));
//
// Recapitulate the change's history, tracking review passes,
// rescinds and failures.
//
cstate_ty *cstate_data = cp->cstate_get();... | false | false | false | false | false | 0 |
generateArc(const Vector& center,const Vector& start,
const Vector& end,Winding winding,
DynamicArray<float>* points)
{
Vector realStart = start;
Vector realEnd = end;
inversePathTransform_.transform(realStart);
inversePat... | false | false | false | false | false | 0 |
chat_io_sendto(
chat_io_event_q_t q,
int sock,
chat_byte_t * buffer,
int buffer_length,
const char * to_ip,
int port,
chat_io_event_c... | false | false | false | false | false | 0 |
BloadObjectPatterns(
void *theEnv)
{
UNLN space;
GenReadBinary(theEnv,(void *) &space,(UNLN) sizeof(UNLN));
if (space == 0L)
return;
/* ================================================
Read in the alpha and intermediate pattern nodes
================================================ */... | false | false | false | false | false | 0 |
dump_ipmi(struct s_hardware *hardware, ZZJSON_CONFIG *config, ZZJSON **item) {
if (hardware->dmi.ipmi.filled == false) {
CREATE_NEW_OBJECT;
add_s("dmi.warning","no IPMI structure found");
FLUSH_OBJECT;
return;
}
char spec_ver[16]={0};
char i2c[16]={0};
char base[16]={0};
snprintf(spec_ver,sizeof(spec_ve... | false | false | false | false | false | 0 |
add_sub_line(subtitles_t* l, subtitle_line_t* sl)
{
if (l->allocated <= (l->count + 1))
{
l->allocated += 200;
//printf("Realloc %p %d\n", l->subtitle, sizeof(*sl) * l->allocated);
l->subtitle = (subtitle_line_t*) realloc(l->subtitle, sizeof(*sl) * l->allocated);
}
if (l->subtitle)
{
if (l->... | false | true | false | false | false | 1 |
dec_wall_timeout(int t)
{
err_when( !had_wall() );
if( (extra_para -= t) <= 0)
{
remove_wall_timeout();
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
replace(const nstring &lhs, const nstring &rhs, int maximum)
const
{
static nstring_accumulator sa;
sa.clear();
//
// Deal with some trivial cases.
//
if (lhs.size() == 0 || maximum == 0)
return *this;
//
// Default the number of times, if necessary.
//
if (maximum < 0)
m... | false | false | false | false | false | 0 |
makePropList(const KEYCharacterStylePtr_t &style, const KEYStyleContext &context)
{
WPXPropertyList props;
// Even if there is no character style for the span, there might still
// be attributes inherited from the paragraph style through context.
// We use an empty style so these can be picked up.
fillCharPr... | false | false | false | false | false | 0 |
constructg(BLOCKAGE * block,BOX * frame){
// start to construct the graph
mark_forbidden(block,frame);
int b_i,b_j;
int cor_i,cor_j;
// for each corner of each blockage,
// determine what corners it can each
// (in the sense of manhattan distance) : 4 for-loop
NODE *nodei,*nodej;
BOX * boxi,*boxj;
for(b_i=0... | false | false | false | false | false | 0 |
matches_any_index(RestrictInfo *rinfo, RelOptInfo *rel, Relids outer_relids)
{
ListCell *l;
Assert(IsA(rinfo, RestrictInfo));
if (restriction_is_or_clause(rinfo))
{
foreach(l, ((BoolExpr *) rinfo->orclause)->args)
{
Node *orarg = (Node *) lfirst(l);
/* OR arguments should be ANDs or sub-RestrictIn... | false | false | false | false | false | 0 |
cb_emit_allocate (cb_tree target1, cb_tree target2, cb_tree size, cb_tree initialize)
{
cb_tree x;
char buff[32];
if (cb_validate_one (target1)) {
return;
}
if (cb_validate_one (target2)) {
return;
}
if (cb_validate_one (size)) {
return;
}
if (target1) {
if (!(CB_REFERENCE_P(target1) &&
cb_fie... | true | true | false | false | false | 1 |
amd_gpio_get_value(struct gpio_chip *gc, unsigned offset)
{
u32 pin_reg;
unsigned long flags;
struct amd_gpio *gpio_dev = to_amd_gpio(gc);
spin_lock_irqsave(&gpio_dev->lock, flags);
pin_reg = readl(gpio_dev->base + offset * 4);
spin_unlock_irqrestore(&gpio_dev->lock, flags);
return !!(pin_reg & BIT(PIN_STS_OFF... | false | false | false | false | false | 0 |
free_insn_recog_data (lra_insn_recog_data_t data)
{
if (data->operand_loc != NULL)
free (data->operand_loc);
if (data->dup_loc != NULL)
free (data->dup_loc);
if (data->arg_hard_regs != NULL)
free (data->arg_hard_regs);
if (HAVE_ATTR_enabled && data->alternative_enabled_p != NULL)
free (data->alt... | false | false | false | false | false | 0 |
values_unexpire(uint64 dbkey)
{
const void *key;
if (hset_contains_extended(expired, &dbkey, &key)) {
const uint64 *dbatom = key;
hset_remove(expired, &dbkey);
atom_uint64_free(dbatom);
if (GNET_PROPERTY(dht_storage_debug) > 2)
g_debug("DHT value DB-key %s un-expired", uint64_to_string(dbkey));
}
} | false | false | false | false | false | 0 |
getCompileUnitForOffset(uint32_t offset) {
if (CUs.empty())
parseCompileUnits();
DWARFCompileUnit *i = std::lower_bound(CUs.begin(), CUs.end(), offset,
OffsetComparator());
if (i != CUs.end())
return &*i;
return 0;
} | false | false | false | false | false | 0 |
print_tagid(struct ifd_entry *entry_ptr,int indent,int ifdtype)
{
char *nameoftag;
int chpr = 0;
if(entry_ptr && (PRINT_ENTRY))
{
if(PRINT_TAGNAME || !(PRINT_TAGNO))
{
switch(ifdtype)
{
case GPS_IFD:
nameoftag = gps_tagname(ent... | false | false | false | false | false | 0 |
tio_keyrep(key)
int key;
{
static char rep[8];
int i;
if (key < 0x100) {
if (key <= 0x1f) {
rep[0] = '^';
rep[1] = (char)(key + '@');
rep[2] = 0;
return rep;
}
if (tio_isprint(key)) {
rep[0] = (char)key;
rep[1] = 0;
return rep;
}
}
for (i = 0; t_key... | false | false | false | false | false | 0 |
ark3116_update_msr(struct usb_serial_port *port, __u8 msr)
{
struct ark3116_private *priv = usb_get_serial_port_data(port);
unsigned long flags;
spin_lock_irqsave(&priv->status_lock, flags);
priv->msr = msr;
spin_unlock_irqrestore(&priv->status_lock, flags);
if (msr & UART_MSR_ANY_DELTA) {
/* update input lin... | false | false | false | false | false | 0 |
free_firmware(struct firmware *f) {
free(f->name);
if(f->desc) {
unsigned int i = 0;
for(i = 0; i < f->nr_desc; ++ i) {
free(f->desc[i].data);
}
}
free(f->desc);
free(f);
} | false | false | false | false | false | 0 |
sxgbe_dma_init(void __iomem *ioaddr, int fix_burst, int burst_map)
{
u32 reg_val;
reg_val = readl(ioaddr + SXGBE_DMA_SYSBUS_MODE_REG);
/* if fix_burst = 0, Set UNDEF = 1 of DMA_Sys_Mode Register.
* if fix_burst = 1, Set UNDEF = 0 of DMA_Sys_Mode Register.
* burst_map is bitmap for BLEN[4, 8, 16, 32, 64, 128 a... | false | false | false | false | false | 0 |
gda_tree_manager_init (GdaTreeManager *manager, G_GNUC_UNUSED GdaTreeManagerClass *klass)
{
g_return_if_fail (GDA_IS_TREE_MANAGER (manager));
manager->priv = g_new0 (GdaTreeManagerPrivate, 1);
manager->priv->sub_managers = NULL;
manager->priv->ref_managers = NULL;
manager->priv->added_attributes = NULL;
} | false | false | false | false | false | 0 |
rightSplit(char chr, String &initial, String &rem) const
{
int pivot = findCharBwd(chr);
if (pivot < 0) {
initial = *this;
rem.clear();
return false;
}
subString(0, pivot, initial);
subString(pivot+1, length(), rem);
return true;
} | false | false | false | false | false | 0 |
gf_sc_uri_is_hardcoded_proto(GF_Compositor *compositor, const char *uri)
{
/*check proto modules*/
if (compositor && compositor->proto_modules ) {
u32 j = 0;
GF_HardcodedProto *ifce;
while ( (ifce = (GF_HardcodedProto *)gf_list_enum(compositor->proto_modules, &j) )) {
if ( ifce->can_load_proto(uri)) {
re... | false | false | false | false | false | 0 |
rtl8821ae_dm_txpower_track_adjust(struct ieee80211_hw *hw,
u8 type, u8 *pdirection,
u32 *poutwrite_val)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct rtl_dm *rtldm = rtl_dm(rtl_priv(hw));
u8 pwr_val = 0;
if (type == 0) {
if (rtlpriv->dm.swing_idx_ofdm[RF90_PATH_A] <=
rtlpriv->dm.swin... | false | false | false | false | false | 0 |
valid_xline(struct Client *source_p, const char *gecos, const char *reason)
{
if(EmptyString(reason))
{
sendto_one(source_p, form_str(ERR_NEEDMOREPARAMS),
get_id(&me, source_p), get_id(source_p, source_p), "XLINE");
return 0;
}
if(!valid_wild_card_simple(gecos))
{
sendto_one_notice(source_p,
":P... | false | false | false | false | false | 0 |
lookup_session_specific (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE_PTR key)
{
Session *sess;
g_assert (key);
*key = 0;
G_LOCK (wrap_layer);
if (wrap_sessions) {
sess = g_hash_table_lookup (wrap_sessions, GINT_TO_POINTER ((gint)handle));
if (sess == NULL)
g_warning ("sessions out of sync with lower l... | false | false | false | false | false | 0 |
goNextWord(io::IReadFile* file) const
{
u8 c;
while(file->getPos() != file->getSize())
{
file->read(&c, 1);
// found it, so leave
if (!core::isspace(c))
{
file->seek(-1, true);
break;
}
}
} | false | false | false | false | false | 0 |
raw_keys(void)
{
int key;
printf("[raw]");
for (;;) {
key = getc(stdin);
if (key == 0x03) {
printf("[done]\n");
exit(0);
} else if (key == '!')
return;
if (key != EOF)
printf("<%02x>", key);
}
} | false | true | false | false | true | 1 |
gvir_config_domain_filesys_set_type(GVirConfigDomainFilesys *filesys,
GVirConfigDomainFilesysType type)
{
g_return_if_fail(GVIR_CONFIG_IS_DOMAIN_FILESYS(filesys));
gvir_config_object_set_attribute_with_type(GVIR_CONFIG_OBJECT(filesys),
... | false | false | false | false | false | 0 |
netapp_prio(const char *dev, int fd)
{
unsigned char results[RESULTS_MAX];
int results_size=RESULTS_MAX;
int rc;
int is_proxy;
int is_iscsi_software;
int is_iscsi_hardware;
int tot_len;
is_iscsi_software = is_iscsi_hardware = is_proxy = 0;
memset(&results, 0, sizeof (results));
rc = send_gva(dev, fd, 0x41, ... | false | false | false | false | false | 0 |
ndp_rx_neighbour_advertisement_ll_target ( struct net_device *netdev,
struct sockaddr_in6 *sin6_src
__unused,
union ndp_header *ndp,
union ndp_option *option,
size_t len ) {
struct ndp_neighbour_header *neigh = &ndp->neigh;
struct ndp_ll_addr_option *ll_addr_opt = &option->ll_... | false | false | false | false | false | 0 |
plD_line_ljii(PLStream *pls, short x1a, short y1a, short x2a, short y2a)
{
PLDev *dev = (PLDev *) pls->dev;
int i;
int xx1 = x1a, yy1 = y1a, xx2 = x2a, yy2 = y2a;
PLINT x1b, y1b, x2b, y2b;
PLFLT length, fx, fy, dx, dy;
/* Take mirror image, since PCL expects (0,0) to be at top left */
yy1 = de... | false | false | false | false | false | 0 |
mmio32read__read_file(struct b43_wldev *dev,
char *buf, size_t bufsize)
{
ssize_t count = 0;
unsigned int addr;
u32 val;
addr = dev->dfsentry->mmio32read_next;
if (addr > B43_MAX_MMIO_ACCESS)
return -EDESTADDRREQ;
val = b43_read32(dev, addr);
fappend("0x%08X\n", val);
return count;
} | false | false | false | false | false | 0 |
update_nft_five(triangle nft[], int numnft, EDGE *ref,
triangle newnft[], int *newnumnft)
/* Make new list of non-facial triangles after a five-extension. */
{
EDGE *refmin,*amin,*e,*elast,*ee;
int i,k,w,j;
refmin = ref->min;
amin = ref->next->next->min;
/* Remove triangles that inc... | false | false | false | false | false | 0 |
qlcnic_sriov_vf_handle_dev_ready(struct qlcnic_adapter *adapter)
{
struct qlcnic_hardware_context *ahw = adapter->ahw;
struct device *dev = &adapter->pdev->dev;
struct qlc_83xx_idc *idc = &ahw->idc;
u8 func = ahw->pci_func;
u32 state;
if ((idc->prev_state == QLC_83XX_IDC_DEV_NEED_RESET) ||
(idc->prev_state ... | false | false | false | false | false | 0 |
fits (zmq_msg_t *msg_)
{
// Check whether whole binary representation of the message
// fits into the swap.
size_t msg_size = zmq_msg_size (msg_);
if (buffer_space () <= (int64_t) (sizeof msg_size + 1 + msg_size))
return false;
return true;
} | false | false | false | false | false | 0 |
execute(void)
{
struct _Address Source,Destination;
unsigned long Result, SValue, DValue;
SUBX_Instr Instr;
Memory_RetrWordFromPC(&Instr.Code);
TRACE("Source:\n");
if(!EA_GetFromPC(&Source, 32, 0, Instr.Bits.RegisterDy)) return;
TRACE("Destination:\n");
if(!EA_GetFromPC(&Destination, 32, 0, Instr.Bits.Registe... | false | false | false | false | false | 0 |
close_rtp_connection(ooCallData *call)
{
struct ooh323_pvt *p = NULL;
if(gH323Debug)
ast_verb(0, "--- close_rtp_connection\n");
p = find_call(call);
if (!p) {
ast_log(LOG_ERROR, "Couldn't find matching call to close rtp "
"connection\n");
return;
}
ast_mutex_lock(&p->lock)... | false | false | false | false | false | 0 |
categoryNeedsUpdate(CategoryItem *category)
{
// we are inside a transaction
int id = -1;
bool isDirty = category->isDirty();
if ((category->data(CategoryItem::DbOnly_Id).isNull() || category->id()==-1) &&
(!category->uuid().isEmpty())) {
// try to find the category using the uuid
... | false | false | false | false | false | 0 |
buildin_setcell(struct script_state *st)
{
int m,x,y,type;
char *str;
str = conv_str(st,& (st->stack->stack_data[st->start+2]));
x = conv_num(st,& (st->stack->stack_data[st->start+3]));
y = conv_num(st,& (st->stack->stack_data[st->start+4]));
type = conv_num(st,& (st->stack->stack_data[st->start+5]));
m... | false | false | false | false | false | 0 |
bfa_attach(struct bfa_s *bfa, void *bfad, struct bfa_iocfc_cfg_s *cfg,
struct bfa_meminfo_s *meminfo, struct bfa_pcidev_s *pcidev)
{
int i;
struct bfa_mem_dma_s *dma_info, *dma_elem;
struct bfa_mem_kva_s *kva_info, *kva_elem;
struct list_head *dm_qe, *km_qe;
bfa->fcs = BFA_FALSE;
WARN_ON((cfg == NULL) |... | false | false | false | true | false | 1 |
Unregister (Component* comp) {
UMapElem* elem = FindId((void*) comp);
if (elem != nil) {
UMap::Unregister(elem);
delete elem;
}
} | false | false | false | false | false | 0 |
calc(double dt) {
// Logger::log("PID::calc:", pv, sp, Logger::LOGLEVEL_INFO);
// Logger::log("PID::calc:", bias, Kc, Logger::LOGLEVEL_INFO);
// Logger::log("PID::calc:", Ti, Td, Logger::LOGLEVEL_INFO);
err = sp - pv;
dpv = pv - pv_m1; // XXX: we regulate on dpv rather than on
// XXX: der... | false | false | false | false | false | 0 |
prepare_glk_args(char *proto, dispatch_splot_t *splot)
{
static gluniversal_t *garglist = NULL;
static int garglist_size = 0;
int ix;
int numwanted, numvargswanted, maxargs;
char *cx;
cx = proto;
numwanted = 0;
while (*cx >= '0' && *cx <= '9') {
numwanted = 10 * numwanted + (*cx - '0');
cx++;
... | false | false | false | false | false | 0 |
sdb_DestroyObject(SDB *sdb, CK_OBJECT_HANDLE object_id)
{
SDBPrivate *sdb_p = sdb->private;
sqlite3 *sqlDB = NULL;
sqlite3_stmt *stmt = NULL;
char *newStr = NULL;
int sqlerr = SQLITE_OK;
CK_RV error = CKR_OK;
int retry = 0;
if ((sdb->sdb_flags & SDB_RDONLY) != 0) {
return CKR_TOKEN_WR... | false | false | false | false | false | 0 |
setup_me(aClient *mp)
{
struct passwd *p;
p = getpwuid(getuid());
strncpyzt(mp->username, (p) ? p->pw_name : "unknown",
sizeof(mp->username));
(void)get_my_name(mp, mp->sockhost, sizeof(mp->sockhost)-1);
/* I think we need no hostp, especially fake one --B. */
mp->hostp = NULL;
if (mp->serv->namebuf[0] == ... | false | true | false | false | false | 1 |
loadconfig(ns_server_t *server) {
isc_result_t result;
start_reserved_dispatches(server);
result = load_configuration(ns_g_lwresdonly ?
lwresd_g_conffile : ns_g_conffile,
server, ISC_FALSE);
if (result == ISC_R_SUCCESS) {
end_reserved_dispatches(server, ISC_FALSE);
isc_log_write(ns_g_lctx, NS_LO... | false | false | false | false | false | 0 |
total_alliance_military()
{
int totalPower = military_rank_rating();
for( int i=nation_array.size() ; i>0 ; i-- )
{
if( nation_array.is_deleted(i) || i==nation_recno )
continue;
switch( get_relation_status(i) )
{
case NATION_ALLIANCE:
totalPower += nation_array[i]->military_rank_rating() * 3 / 4; /... | false | false | false | false | false | 0 |
select_previous(GtkWidget *widget __attribute__((unused)),
gpointer user_data __attribute__((unused))){
if(smcdata.neidx>1) {
smcdata.neidx--; showcircdesc(); }
} | false | false | false | false | false | 0 |
sbft_appendChars(UtilStringBuffer * sb, const char *chars)
{
int sl;
char *ns;
if (chars == NULL)
return;
if ((sl = strlen(chars)) + sb->len + 1 >= sb->max) {
if (sb->max == 0)
sb->max = 8;
while (sl + sb->len + 1 >= sb->max)
sb->max *= 2;
ns = (char *) realloc(sb-... | false | true | false | false | false | 1 |
resize(String *str, const char *file, int line)
{
if (!str->resizable) {
internal_error2(file, line, str->file, str->line, "");
core("resize: data not resizable", file, line, 0);
}
if (str->size < 0) {
internal_error2(file, line, str->file, str->line, "");
core("resize freed ... | false | false | false | false | false | 0 |
MergePunts( nd )
nptr nd;
{
register hptr h, p, nx;
/* skip past any punted events already in the history */
for( nx = nd->curr; nx->next->punt; nx = nx->next );
p = nd->t.punts;
do
{
h = p;
p = p->next;
if( QPTIME( h ) < cur_delta ) /* in the past, free it */
{
h->next = free... | false | false | false | false | false | 0 |
store_external_address(instruction_operand op) {
code_block* compiled = op.compiled;
array* parameters =
(to_boolean(compiled->parameters) ? untag<array>(compiled->parameters)
: NULL);
cell index = op.index;
switch (op.rel_type()) {
case RT_DLSYM:
op.stor... | false | false | false | false | false | 0 |
md_register_default (void)
{
gcry_err_code_t err = 0;
int i;
for (i = 0; !err && digest_table[i].digest; i++)
{
if ( fips_mode ())
{
if (!digest_table[i].fips_allowed)
continue;
if (digest_table[i].algorithm == GCRY_MD_MD5
&& _gcry_enforced_fips_mod... | false | false | false | false | false | 0 |
_eina_hash_key_rbtree_cmp_key_data(const Eina_Hash_Element *hash_element,
const Eina_Hash_Tuple *tuple,
__UNUSED__ unsigned int key_length,
Eina_Key_Cmp cmp)
{
int result;
result = cmp(hash_element->tuple.key... | false | false | false | false | false | 0 |
format(std::ostream& ostr) const
{
ostr << "usage: " << _command;
if (!_usage.empty())
{
ostr << ' ';
formatText(ostr, _usage, (int) _command.length() + 1);
}
ostr << '\n';
if (!_header.empty())
{
formatText(ostr, _header, 0);
ostr << "\n\n";
}
formatOptions(ostr);
if (!_footer.empty())
{
ostr << '... | false | false | false | false | false | 0 |
start(int argc, char **argv, struct vtwin *parent, int pgno, int subno)
{
static int valid_vbi_name = 1;
if (!valid_vbi_name)
return parent;
if (vbi == 0)
vbi = vbi_open(vbi_name, cache_open(), fine_tune, newbttv, progname, txtpid);
if (vbi == 0)
{
if (vbi_name)
error("cannot open device: ... | false | false | false | false | false | 0 |
I_UpdateJoystick(void)
{
if (joystick != NULL)
{
event_t ev;
ev.type = ev_joystick;
ev.data1 = GetButtonState();
ev.data2 = GetAxisState(joystick_x_axis, joystick_x_invert);
ev.data3 = GetAxisState(joystick_y_axis, joystick_y_invert);
D_PostEvent(&ev);
}
} | false | false | false | false | false | 0 |
Itk_ConfigBodyCmd(dummy, interp, objc, objv)
ClientData dummy; /* unused */
Tcl_Interp *interp; /* current interpreter */
int objc; /* number of arguments */
Tcl_Obj *CONST objv[]; /* argument objects */
{
int result = TCL_OK;
char *token, *head, *tail;
ItclClas... | false | false | false | false | false | 0 |
L4()
{register object *base=vs_base;
register object *sup=base+VM4; VC4
vs_check;
{object V16;
object V17;
V16=(base[0]);
V17=(base[1]);
vs_top=sup;
goto TTL;
TTL:;
{object V19;
V19= ((V17))->v.v_self[(long)17];
base[2]= CMPcar((V19));
base[3]= (V16);
base[4]= CMPcdr((V19));
vs_top=(vs_base=base+3)+2;
su... | false | false | false | false | false | 0 |
scArrayRemove(const CFunctionsScopePtr &c, void *data) {
CScriptVarPtr obj = c->getArgument("obj");
CScriptVarPtr arr = c->getArgument("this");
int i;
vector<int> removedIndices;
int l = arr->getArrayLength();
CScriptVarPtr equal = c->constScriptVar(Undefined);
for (i=0;i<l;i++) {
equal = obj->mathsO... | false | false | false | false | false | 0 |
abort_quote( fwtoken tok)
{
bool retval = FALSE;
if ( tok == ABORTTXT )
{
if ( ! enable_abort_quote )
{
/* ABORT" is not enabled; we'd better consume the string */
char *save_statbuf;
signed long wlen;
save_statbuf = strdup( (char *)statbuf);
wlen = get_string( FALSE);
strcp... | false | true | false | false | false | 1 |
bus_message_eos_cb (GstBus *bus,
GstMessage *message,
ClutterGstPlayer *player)
{
ClutterGstPlayerPrivate *priv = PLAYER_GET_PRIVATE (player);
GstState state, pending;
priv->in_eos = TRUE;
gst_element_set_state (priv->pipeline, GST_STATE_READY);
g_sig... | false | false | false | false | false | 0 |
ajPhyloPropTrace(const AjPPhyloProp thys)
{
ajint i;
ajDebug("ajPhyloPropTrace\n");
ajDebug("================\n");
ajDebug(" Len: %d Size: %d IsWeight: %B IsFactor: %B\n",
thys->Len, thys->Size, thys->IsWeight, thys->IsFactor);
for(i=0; i < thys->Size; i++)
{
ajDebug("%3d: '%S'",i, t... | false | false | false | false | false | 0 |
affs_error(struct super_block *sb, const char *function, const char *fmt, ...)
{
struct va_format vaf;
va_list args;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
pr_crit("error (device %s): %s(): %pV\n", sb->s_id, function, &vaf);
if (!(sb->s_flags & MS_RDONLY))
pr_warn("Remounting filesystem read-only... | false | false | false | false | false | 0 |
isModified() const
{
if (m_Text->m_Line)
return m_OriginalValue != m_Text->m_Line->text();
else if (m_Text->m_Text)
return m_OriginalValue != m_Text->m_Text->toPlainText();
return true;
} | false | false | false | false | false | 0 |
mouseMoveEvent(QMouseEvent *event)
{
if (mousePressed == true) {
//scroll if necessary to continue selection
scrollArea->ensureVisible(event->x(), event->y());
int column = (event->x() / boxWidth);
secondColumn = column;
update();
return;
}
QWidget::mouseMov... | false | false | false | false | false | 0 |
search_complete_idle (GladeInspector *inspector)
{
GladeInspectorPrivate *priv = inspector->priv;
const gchar *str;
gchar *completed = NULL;
GList *list;
gsize length;
str = gtk_entry_get_text (GTK_ENTRY (priv->entry));
list = g_completion_complete (pr... | false | false | false | false | false | 0 |
breakpoint_destroy(b)
struct breakpoint *b;
{
if (b->file) Tcl_DecrRefCount(b->file);
if (b->pat) Tcl_DecrRefCount(b->pat);
if (b->cmd) Tcl_DecrRefCount(b->cmd);
if (b->expr) Tcl_DecrRefCount(b->expr);
/* unlink from chain */
if ((b->previous == 0) && (b->next == 0)) {
break_base = 0;
} else if (b->previous =... | false | false | false | false | false | 0 |
ensure_alloc(strarray_t *sa, int newalloc)
{
if (newalloc)
newalloc++;
if (newalloc <= sa->alloc)
return;
newalloc = ((newalloc + QUANTUM-1) / QUANTUM) * QUANTUM;
sa->data = xrealloc(sa->data, sizeof(char *) * newalloc);
memset(sa->data+sa->alloc, 0, sizeof(char *) * (newalloc-sa->alloc));
sa-... | false | false | false | false | false | 0 |
embPatBYPInit(const AjPStr pat, ajuint len, EmbPPatBYPNode offset,
ajint *buf)
{
ajuint i;
ajuint j;
const char *p;
EmbPPatBYPNode op;
p = ajStrGetPtr(pat);
for(i=0;i<AJALPHA;++i)
{
offset[i].offset = -1;
offset[i].next = NULL;
buf[i] = len;
}
for(i=0,j=AJALPHA>>1;i<len... | false | false | false | false | false | 0 |
memblock_find_in_range(phys_addr_t start,
phys_addr_t end, phys_addr_t size,
phys_addr_t align)
{
phys_addr_t ret;
ulong flags = choose_memblock_flags();
again:
ret = memblock_find_in_range_node(size, align, start, end,
NUMA_NO_NODE, flags);
if (!ret && (flags & MEMBLOCK_MIRROR)) {
pr_warn("C... | false | false | false | false | false | 0 |
ompfbe_print_one_indent(const fsbe_context *cx)
{
int i;
for(i = 0; i < INDENT_SIZE; i++)
fprintf((FILE *)cx->out_ptr," ");
} | false | false | false | false | false | 0 |
tty_ldisc_hangup(struct tty_struct *tty, bool reinit)
{
struct tty_ldisc *ld;
tty_ldisc_debug(tty, "%p: hangup\n", tty->ldisc);
ld = tty_ldisc_ref(tty);
if (ld != NULL) {
if (ld->ops->flush_buffer)
ld->ops->flush_buffer(tty);
tty_driver_flush_buffer(tty);
if ((test_bit(TTY_DO_WRITE_WAKEUP, &tty->flags)) ... | false | false | false | false | false | 0 |
escape(const char* text, char *bf, int len)
{
char *bfp = bf;
int multiline = strchr(text, '\n') != NULL;
int eol = 0;
int textlen = strlen(text);
if ((textlen > 0) && (text[textlen-1] == '\n'))
eol = 1;
*bfp++ = '"';
--len;
if (multiline) {
*bfp++ = '"';
*bfp++ = '\n';
*bfp++ = '"';
len -= 3;
}
... | false | false | false | false | false | 0 |
cvar_list_find(cvar_t_list *list, const char *name)
{
cvar_t *iter;
CVAR_LIST_FOREACH (list, iter) {
if (cvar_match_name(iter, name))
return iter;
}
return NULL;
} | false | false | false | false | false | 0 |
cb_enumerate_macros (gpointer key, ExcelFunc *efunc, ExcelWriteState *ewb)
{
if (efunc->macro_name != NULL)
efunc->idx = ++ewb->tmp_counter;
} | false | false | false | false | false | 0 |
parse_command_line (int a_argc, char **a_argv, struct Options *a_options)
{
int i = 0;
g_return_if_fail (a_options);
memset (a_options, 0, sizeof (struct Options));
for (i = 1; i < a_argc; i++) {
if (a_argv[i][0] != '-')
break;
... | 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.