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 |
|---|---|---|---|---|---|---|
find_rows_that_match (Sheet *sheet, int first_col, int first_row,
int last_col, int last_row,
GSList *criterias, gboolean unique_only)
{
GSList *rows = NULL;
GSList const *crit_ptr, *cond_ptr;
int row;
gboolean add_flag;
char const *t1, *t2;
GnmCell *test_cell;
for (row = first_r... | false | false | false | false | false | 0 |
setCookiesFromUrl(const QList<QNetworkCookie> &cookieList, const QUrl &url)
{
if (!d->isEnabled) {
return false;
}
QDBusInterface kcookiejar("org.kde.kded", "/modules/kcookiejar", "org.kde.KCookieServer");
Q_FOREACH(const QNetworkCookie &cookie, cookieList) {
QByteArray cookieHeader ("S... | false | false | false | false | false | 0 |
blogic_failure(struct blogic_adapter *adapter, char *msg)
{
blogic_announce_drvr(adapter);
if (adapter->adapter_bus_type == BLOGIC_PCI_BUS) {
blogic_err("While configuring BusLogic PCI Host Adapter at\n",
adapter);
blogic_err("Bus %d Device %d I/O Address 0x%X PCI Address 0x%X:\n", adapter, adapter->bus, adap... | false | false | false | false | false | 0 |
HPDF_Encrypt_CreateUserKey (HPDF_Encrypt attr)
{
HPDF_ARC4_Ctx_Rec ctx;
HPDF_PTRACE((" HPDF_Encrypt_CreateUserKey\n"));
/* Algorithm 3.4/5 step1 */
/* Algorithm 3.4 step2 */
ARC4Init(&ctx, attr->encryption_key, attr->key_len);
ARC4CryptBuf(&ctx, HPDF_PADDING_STRING, attr->user_key, HPDF_PAS... | false | false | false | false | true | 1 |
zxid_epr2str(zxid_conf* cf, zxid_epr* epr) {
if (!epr) {
ERR("NULL EPR. %p", epr);
return 0;
}
return zx_easy_enc_elem_sig(cf, &epr->gg);
} | false | false | false | false | false | 0 |
plugin_parse_line(char* line, int line_count, void* ptr_data)
{
struct hub_info* hub = (struct hub_info*) ptr_data;
struct uhub_plugins* handle = hub->plugins;
struct cfg_tokens* tokens = cfg_tokenize(line);
struct plugin_handle* plugin;
char *directive, *soname, *params;
if (cfg_token_count(tokens) == 0)
{
c... | false | false | false | false | false | 0 |
change_sysid(void)
{
int i, sys, origsys;
struct partition *p;
/* If sgi_label then don't use get_existing_partition,
let the user select a partition, since get_existing_partition()
only works for Linux like partition tables. */
if (!LABEL_IS_SGI) {
i = get_existing_partition(0, g_partitions);
} else {
... | false | false | false | false | false | 0 |
mca_pml_bfo_recv_request_get_frag( mca_pml_bfo_rdma_frag_t* frag )
{
mca_pml_bfo_recv_request_t* recvreq = (mca_pml_bfo_recv_request_t*)frag->rdma_req;
mca_bml_base_btl_t* bml_btl = frag->rdma_bml;
mca_btl_base_descriptor_t* descriptor;
size_t save_size = frag->rdma_length;
int rc;
/* prepare d... | false | false | false | false | false | 0 |
renderPosWindow() {
m_pos_window->resize(FbTk::BiDiString("0:00000 x 0:00000"));
m_pos_window->reconfigTheme();
} | false | false | false | false | false | 0 |
resetLinkstate() {
linkstates.cnt = 0;
for (int i = 0; i<MAX_LINK_STATE_CHANGES_AT_ONCE; i++)
linkstates.ifindex[i]=0; // ugly, but safe way of zeroing table
linkstateChange = 0;
} | false | false | false | false | false | 0 |
bfa_fruvpd_read(struct bfa_fru_s *fru, void *buf, u32 len, u32 offset,
bfa_cb_fru_t cbfn, void *cbarg)
{
bfa_trc(fru, BFI_FRUVPD_H2I_READ_REQ);
bfa_trc(fru, len);
bfa_trc(fru, offset);
if (fru->ioc->asic_gen != BFI_ASIC_GEN_CT2)
return BFA_STATUS_FRU_NOT_PRESENT;
if (fru->ioc->attr->card_type != BFA_MFG_TYPE... | false | false | false | false | false | 0 |
macro_record(void)
{
struct macro *new;
if (!macbuf)
macbuf = buffer_create(NULL);
new = allocate0(sizeof *new);
new->next = macros;
new->start = buffer_bytes(macbuf);
return macros = recording = new;
} | false | false | false | false | false | 0 |
ca_file_save_as (gchar *new_file_name)
{
gchar * initial_file = g_strdup(gnomint_current_opened_file);
GMappedFile *map = NULL;
ca_file_close ();
if (! (map = g_mapped_file_new (initial_file, FALSE, NULL))) {
ca_file_open (gnomint_current_opened_file, FALSE);
return FALSE;
}
if (! g_fi... | false | false | false | false | false | 0 |
gl846_init_regs_for_shading (Genesys_Device * dev)
{
SANE_Status status;
float move;
DBGSTART;
dev->calib_channels = 3;
/* initial calibration reg values */
memcpy (dev->calib_reg, dev->reg, GENESYS_GL846_MAX_REGS * sizeof (Genesys_Register_Set));
dev->calib_resolution = sanei_genesys_compute_dpihw(dev... | false | true | false | false | false | 1 |
SDendaccess(int32 id /* IN: dataset ID */)
{
NC *handle;
int32 ret_value = SUCCEED;
#ifdef SDDEBUG
fprintf(stderr, "SDendaccess: I've been called\n");
#endif
/* clear error stack */
HEclear();
/* get the handle */
handle = SDIhandle_from_id(id, SDSTYPE);
if(handle == NULL)
... | false | false | false | false | false | 0 |
NET_ReadTiccmdDiff(net_packet_t *packet, net_ticdiff_t *diff,
boolean lowres_turn)
{
unsigned int val;
signed int sval;
// Read header
if (!NET_ReadInt8(packet, &diff->diff))
return false;
// Read fields
if (diff->diff & NET_TICDIFF_FORWARD)
{
... | false | false | false | false | false | 0 |
set_button_attrib( FL_OBJECT * ob )
{
bt_attrib->vdata = edited = ob;
button_spec = get_superspec( ob );
info = button_spec->cspecv;
if ( ! info )
{
M_err( "ButtonAttrib", "internal error" );
return -1;
}
fl_show_object( bt_attrib->mbuttons_label );
fl_show_object( bt_... | false | false | false | false | false | 0 |
is_encrypted(char *scrambled_text)
{
uint encrypt_id;
memcpy(&encrypt_id, scrambled_text, 4);
if ( (encrypt_id == Encrypt_signature) || (encrypt_id == Encrypt_signature_8bit) || (encrypt_id == Encrypt_new_signature)) {
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
model_find_bay_path(int modelnum, char *bay_path_name)
{
int i;
polymodel *pm = model_get(modelnum);
if (pm->ship_bay == NULL)
return -1;
if (pm->ship_bay->num_paths <= 0)
return -1;
for (i = 0; i < pm->ship_bay->num_paths; i++)
{
if (!stricmp(pm->paths[pm->ship_bay->path_indexes[i]].name, bay_path_name)... | false | false | false | false | false | 0 |
gst_uvc_h264_src_start_capture (GstBaseCameraSrc * camerasrc)
{
GstUvcH264Src *self = GST_UVC_H264_SRC (camerasrc);
gboolean ret = TRUE;
GST_DEBUG_OBJECT (self, "start capture");
if (!self->started) {
self->started = TRUE;
if (GST_STATE (self) >= GST_STATE_READY) {
ret = gst_uvc_h264_src_constru... | false | false | false | false | false | 0 |
mbfl_memory_device_result(mbfl_memory_device *device, mbfl_string *result)
{
if (device && result) {
result->len = device->pos;
mbfl_memory_device_output4('\0', device);
result->val = device->buffer;
device->buffer = (unsigned char *)0;
device->length = 0;
device->pos= 0;
if (result->val == NULL) {
re... | false | false | false | false | false | 0 |
extract_struct_member_tbl(Var_table **var_head, Array_table **array_head, Boolean gbl_mode)
{
Var_table *v;
Array_table *a;
Op_entry struct_op_entry;
for (v = *var_head; v != NULL; v = v->next) {
if (v->members != NULL) {
continue;
}
if (!gbl_mode && v->is_global) {
co... | false | false | false | false | false | 0 |
cb_decal_button_press(GtkWidget *widget, GdkEventButton *ev, GkrellmPanel *p)
{
GList *list;
GkrellmDecalbutton *b;
gboolean stop_sig = FALSE;
if (ev->type != GDK_BUTTON_PRESS) /* I'm connected to "event" */
return FALSE;
for (list = p->button_list; list; list = list->next)
{
b = (GkrellmDecalbutton *... | false | false | false | false | false | 0 |
pushTN(mgNDctx *NDctx, TransformN *TN)
{
NDstuff *nds = (NDstuff *)NDctx;
TmNConcat(TN, nds->T, nds->T);
if (nds->Tc) {
TmNConcat(TN, nds->Tc, nds->Tc);
}
#if 0
compute_mg_factor(nds);
mgtransform(nds->MGFactor);
#endif
} | false | false | false | false | false | 0 |
directory_compare_directories (Directory* a, Directory* b) {
gint result = 0;
GCompareFunc _tmp0_;
Directory* _tmp1_;
const gchar* _tmp2_;
Directory* _tmp3_;
const gchar* _tmp4_;
gint _tmp5_ = 0;
g_return_val_if_fail (a != NULL, 0);
g_return_val_if_fail (b != NULL, 0);
_tmp0_ = g_strcmp0;
_tmp1_ = a;
_tmp2_... | false | false | false | false | false | 0 |
qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
{
if (_c == QMetaObject::InvokeMetaMethod) {
Q_ASSERT(staticMetaObject.cast(_o));
Gxxxiv *_t = static_cast<Gxxxiv *>(_o);
switch (_id) {
case 0: _t->about(); break;
case 1: _t->aide(); break;
ca... | false | false | false | false | false | 0 |
fso_framework_bin_builder_append_int64 (FsoFrameworkBinBuilder* self, gint64 v) {
guint64 uv = 0ULL;
gint64 _tmp0_ = 0LL;
guint64 _tmp1_ = 0ULL;
g_return_if_fail (self != NULL);
_tmp0_ = v;
_tmp1_ = fso_framework_bin_builder_uint64_convert (self, (guint64) _tmp0_);
uv = _tmp1_;
self->_data = g_list_reverse (sel... | false | false | false | false | false | 0 |
runThread(void *arg) {
//char buf[1024];
ArSZSeriesPacket *packet;
while (getRunning())
{
lockDevice();
if (myStartConnect)
{
myStartConnect = false;
myTryingToConnect = true;
unlockDevice();
blockingConnect();
lockDevice();
myTryingToConnect = false;
unlockDevice();
continue;
}
... | false | false | false | false | false | 0 |
NextSiblingElement( const char * _value ) const
{
const TiXmlNode* node;
for ( node = NextSibling( _value );
node;
node = node->NextSibling( _value ) )
{
if ( node->ToElement() )
return node->ToElement();
}
return 0;
} | false | false | false | false | false | 0 |
add_update_entry_operational_attributes(struct backentry *ep, ID pid)
{
struct berval bv;
struct berval *bvp[2];
char buf[40]; /* Enough for an EntryID */
bvp[0] = &bv;
bvp[1] = NULL;
/* parentid */
/* If the pid is 0, then the entry does not have a parent. It
* may be the case that the entry is a suffix. ... | false | false | false | false | false | 0 |
SaveStatistics()
{
int i;
int nSavedAllLayersCacheData = -1;
if( !bIsSpatiaLiteDB || !OGRSQLiteIsSpatialiteLoaded() || bLastSQLCommandIsUpdateLayerStatistics )
return;
for( i = 0; i < nLayers; i++ )
{
if( papoLayers[i]->IsTableLayer() )
{
OGRSQLiteTableLayer* po... | false | false | false | false | false | 0 |
IsFileSnippet (wxTreeItemId treeItemId )
// ----------------------------------------------------------------------------
{
wxTreeItemId itemId = treeItemId;
if ( itemId == (void*)0) itemId = GetSelection();
if (not itemId.IsOk()) return false;
if (not IsSnippet(itemId) ) return false;
wxString file... | false | false | false | false | false | 0 |
delete_viewhistory( const std::string& url )
{
#ifdef _DEBUG
std::cout << "History_Manager::delete_view_history : " << url << std::endl
<< "size = " << m_view_histories.size() << std::endl;
#endif
if( m_view_histories.size() ){
std::list< ViewHistory* >::iterator it = m_view_histories.beg... | false | false | false | false | false | 0 |
stripe_status(struct dm_target *ti, status_type_t type,
unsigned status_flags, char *result, unsigned maxlen)
{
struct stripe_c *sc = (struct stripe_c *) ti->private;
char buffer[sc->stripes + 1];
unsigned int sz = 0;
unsigned int i;
switch (type) {
case STATUSTYPE_INFO:
DMEMIT("%d ", sc->stripes);
for ... | false | false | false | false | false | 0 |
mov_write_hdlr_tag(ByteIOContext *pb, MOVTrack *track)
{
const char *hdlr, *descr = NULL, *hdlr_type = NULL;
int64_t pos = url_ftell(pb);
if (!track) { /* no media --> data handler */
hdlr = "dhlr";
hdlr_type = "url ";
descr = "DataHandler";
} else {
hdlr = (track->mode ... | false | false | false | false | false | 0 |
fill_cmd_set_system_boot_options_service_partition_scan (uint8_t parameter_valid,
uint8_t service_partition_discovered,
uint8_t service_partition_scan,
... | false | false | false | false | false | 0 |
transmitFrame(u_char fcf, bool lastFrame)
{
startTimeout(7550);
bool frameSent = useV34 ? true : atCmd(thCmd, AT_NOTHING, 0);
if (frameSent) frameSent = useV34 ? true : atResponse(rbuf, 0) == AT_CONNECT;
if (frameSent) frameSent = sendFrame(fcf, lastFrame);
else if (lastResponse == AT_ERROR) gotEOT ... | false | false | false | false | false | 0 |
check_required_startup_fields( const QString& msg, const KStartupInfoData& data_P,
int screen )
{
QString ret = msg;
if( data_P.name().isEmpty())
{
// kWarning( 172 ) << "NAME not specified in initial startup message";
QString name = data_P.bin();
if( name.isEmpty())
... | false | false | false | false | false | 0 |
nextBlank(FILE *input)
{
wstring result = L"";
while(true)
{
wint_t val = fgetwc(input);
if(feof(input))
{
return L"";
}
switch(val)
{
case L'\\':
fgetwc(input);
break;
case L'[':
result = restOfBlank(input);
return result;
... | false | false | false | false | false | 0 |
mcam_read_setup(struct mcam_camera *cam)
{
int ret;
unsigned long flags;
/*
* Configuration. If we still don't have DMA buffers,
* make one last, desperate attempt.
*/
if (cam->buffer_mode == B_vmalloc && cam->nbufs == 0 &&
mcam_alloc_dma_bufs(cam, 0))
return -ENOMEM;
if (mcam_needs_config(cam)) {
... | false | false | false | false | false | 0 |
FS_NextPath(const char *prevpath)
{
searchpath_t *s;
char *prev;
prev = NULL; // fs_gamedir is the first directory in the searchpath
for (s = fs_searchpaths; s; s = s->next) {
if (s->pack)
continue;
if (prevpath == prev)
return s->filename;
prev = s->filename;
}
return NULL;
} | false | false | false | false | false | 0 |
increment_adjustment (GtkAdjustment * adj, gdouble step, gdouble eps)
{
gdouble value = adj->value + step;
value = MAX (value, adj->lower);
value = MIN (value, adj->upper);
if (fabs (value - adj->value) > eps)
gtk_adjustment_set_value (adj, value);
} | false | false | false | false | false | 0 |
connect_fd (struct scanner *s)
{
SANE_Status ret = SANE_STATUS_GOOD;
int buffer_size = s->buffer_size;
DBG (10, "connect_fd: start\n");
if(s->fd > -1){
DBG (5, "connect_fd: already open\n");
ret = SANE_STATUS_GOOD;
}
else {
ret = sanei_scsi_open_extended (s->device_name, &(s->fd), sense_handle... | false | false | false | false | false | 0 |
calcDerivativesAtSteady()
{
Vector xx(nexog());
xx.zeros();
calcDerivatives(*ysteady, xx);
} | false | false | false | false | false | 0 |
draw_sprites( struct mame_bitmap *bitmap )
{
const struct rectangle *clip = &Machine->visible_area;
int scroll = mnchmobl_vreg[6];
int flags = mnchmobl_vreg[7]; /* XB?????? */
int xadjust = - 128-16 - ((flags&0x80)?1:0);
int bank = (flags&0x40)?1:0;
const struct GfxElement *gfx = Machine->gfx[2+bank]... | false | false | false | false | false | 0 |
ga_protocol_get_type (void)
{
static GType etype = 0;
if (etype == 0) {
static const GEnumValue values[] = {
{ GA_PROTOCOL_INET, "GA_PROTOCOL_INET", "GA_PROTOCOL_INET" },
{ GA_PROTOCOL_INET6, "GA_PROTOCOL_INET6", "GA_PROTOCOL_INET6" },
{ GA_PROTOCOL_UNSPEC, "GA_PROTOCOL_UNSPEC", "GA_PROTOCOL_U... | false | false | false | false | false | 0 |
firstraverse(node *q_, node *r, double *sum)
{ /* firsttraverse */
/* go through tree calculating branch lengths */
node *q;
long i, j, k;
node *u, *v;
q = q_;
if (q == NULL)
return;
q->sametime = false;
if (!q->tip) {
firstraverse(q->next->back, r,sum);
first... | false | false | false | false | false | 0 |
threefish_decrypt_block_words(struct threefish_key *key_ctx, u64 *in,
u64 *out)
{
switch (key_ctx->state_size) {
case THREEFISH_256:
threefish_decrypt_256(key_ctx, in, out);
break;
case THREEFISH_512:
threefish_decrypt_512(key_ctx, in, out);
break;
case THREEFISH_1024:
threefish_decrypt_1024(key_ct... | false | false | false | false | false | 0 |
lua_xmove(lua_State *from, lua_State *to, int n)
{
TValue *f, *t;
if (from == to) return;
api_checknelems(from, n);
api_check(from, G(from) == G(to));
lj_state_checkstack(to, (MSize)n);
f = from->top;
t = to->top = to->top + n;
while (--n >= 0) copyTV(to, --t, --f);
from->top = f;
} | false | false | false | false | false | 0 |
GetLOD(double &in,double &out,double &wid) const
{
if (!isValid()) return false;
in = switchIn;
out = switchOut;
wid = width;
return true;
} | false | false | false | false | false | 0 |
mergeEntries(Entry::List entries, Feed *feed, const Provider *provider)
{
for (Entry::List::Iterator it = entries.begin(); it != entries.end(); ++it) {
// TODO: find entry in entrycache, replace if needed
// don't forget marking as 'updateable'
Entry *e = (*it);
QString thisId = id(e... | false | false | false | false | false | 0 |
tdb_purge_dead(struct tdb_context *tdb, u32 hash)
{
int res = -1;
struct list_struct rec;
tdb_off_t rec_ptr;
if (tdb_lock(tdb, -1, F_WRLCK) == -1) {
return -1;
}
/* read in the hash top */
if (tdb_ofs_read(tdb, TDB_HASH_TOP(hash), &rec_ptr) == -1)
goto fail;
while (rec_ptr) {
tdb_off_t next;
if (tdb... | false | false | false | false | false | 0 |
plSelectDev(void) /* pmr: prototype */
{
int dev, i, count, length;
char response[80];
int tlen;
/* Device name already specified. See if it is valid. */
if (*(plsc->DevName) != '\0' && *(plsc->DevName) != '?') {
length = strlen(plsc->DevName);
for (i = 0; i < npldrivers; i++) {
if ((*pl... | false | false | false | false | false | 0 |
gst_shape_wipe_mask_sink_event (GstPad * pad, GstObject * parent,
GstEvent * event)
{
GstShapeWipe *self = GST_SHAPE_WIPE (parent);
GST_LOG_OBJECT (pad, "Got %s event", GST_EVENT_TYPE_NAME (event));
switch (GST_EVENT_TYPE (event)) {
case GST_EVENT_CAPS:
{
GstCaps *caps;
gst_event_parse_... | false | false | false | false | false | 0 |
redirect(const std::string& uri, HTTPStatus status)
{
poco_assert (!_pStream);
setContentLength(0);
setChunkedTransferEncoding(false);
setStatusAndReason(status);
set("Location", uri);
_pStream = new HTTPHeaderOutputStream(_session);
write(*_pStream);
} | false | false | false | false | false | 0 |
cpl_column_dump_structure(cpl_column *column)
{
cpl_errorstate prevstate = cpl_errorstate_get();
const char *name = cpl_column_get_name(column);
const char *unit = cpl_column_get_unit(column);
const char *format = cpl_column_get_format(column);
cpl_type type = cpl_column_get_type(column);
... | false | false | false | false | false | 0 |
_presence_in_router(mod_instance_t mi, pkt_t pkt) {
user_t user;
sess_t sess;
/* only check presence to users, pass presence to sm and probes */
if(!(pkt->type & pkt_PRESENCE) || pkt->to->node[0] == '\0' || pkt->type == pkt_PRESENCE_PROBE)
return mod_PASS;
/* get the user _without_ doing a... | false | false | false | false | false | 0 |
crmd_proxy_send(const char *session, xmlNode *msg)
{
remote_proxy_t *proxy = g_hash_table_lookup(proxy_table, session);
lrm_state_t *lrm_state = NULL;
if (!proxy) {
return;
}
lrm_state = lrm_state_find(proxy->node_name);
if (lrm_state) {
remote_proxy_relay_event(lrm_state->conn,... | false | false | false | false | false | 0 |
ev_desktop_names(FbEv *ev, gpointer p)
{
ENTER;
if (ev->desktop_names) {
g_strfreev (ev->desktop_names);
ev->desktop_names = NULL;
}
RET();
} | false | false | false | false | false | 0 |
pl3_file_browser_update_folder(void)
{
GtkTreeSelection *selec = gtk_tree_view_get_selection((GtkTreeView *) pl3_fb_dir_tree);
GtkTreeModel *model = GTK_TREE_MODEL(pl3_fb_dir_store);
GtkTreeIter iter;
if (!mpd_check_connected(connection))
{
return;
}
if (gtk_tree_selection_get_selected(selec, &model, &iter))
... | false | false | false | false | false | 0 |
GetParameterValue(const char *name)
{
for (int i = 0; i < this->NumberOfParameters; i++)
{
if (this->ParameterNames[i] && strcmp(name,this->ParameterNames[i]) == 0)
{
return this->ParameterValues[i];
}
}
vtkErrorMacro("GetParameterValue: no parameter named " << name);
return 0.0;
} | false | false | false | false | false | 0 |
truncate(IDL_UShort scale)
{
if (scale >= scale_)
return *this;
int cut = scale_ - scale;
int newscale = scale;
while (val_[cut] == 0 && newscale > 0) {
++cut;
--newscale;
}
return IDL_Fixed(val_ + cut, digits_ - cut, newscale, negative_);
} | false | false | false | false | false | 0 |
r8712_get_wpa2_cipher_suite(u8 *s)
{
if (!memcmp(s, (void *)RSN_CIPHER_SUITE_NONE, RSN_SELECTOR_LEN))
return WPA_CIPHER_NONE;
if (!memcmp(s, (void *)RSN_CIPHER_SUITE_WEP40, RSN_SELECTOR_LEN))
return WPA_CIPHER_WEP40;
if (!memcmp(s, (void *)RSN_CIPHER_SUITE_TKIP, RSN_SELECTOR_LEN))
return WPA_CIPHER_TKIP;
if (... | false | false | false | false | false | 0 |
get_primary_key_value_selected() const
{
type_mapValues::const_iterator iter = m_current_row_values.find(m_field_primary_key->get_name());
if(iter == m_current_row_values.end())
return Gnome::Gda::Value();
return iter->second;
} | false | false | false | false | false | 0 |
createEditMenu()
{
ActionContainer *menubar = menubarContainer();
Q_ASSERT(menubar);
// Edit Menu groups
ActionContainer *editmenu = actionManager()->createMenu(Constants::M_EDIT);
menubar->addMenu(editmenu, Constants::G_EDIT);
editmenu->setTranslations(Trans::Constants::M_EDIT_TEXT);
editm... | false | false | false | false | false | 0 |
locate_all_files(std::string directory, std::vector<std::string>& result)
{
CYG_REPORT_FUNCNAME("CdlInterpreter::locate_all_files");
CYG_REPORT_FUNCARG2XV(this, &result);
CYG_PRECONDITION_THISC();
CYG_PRECONDITIONC("" != directory);
std::vector<std::string> files;
std::vector<std::string>::cons... | false | false | false | false | false | 0 |
create_children (GNCGeneralSelect *gsl, GNCGeneralSelectType type)
{
gsl->entry = gtk_entry_new ();
gtk_editable_set_editable (GTK_EDITABLE (gsl->entry), FALSE);
gtk_box_pack_start (GTK_BOX (gsl), gsl->entry, TRUE, TRUE, 0);
gtk_widget_show (gsl->entry);
if (type == GNC_GENERAL_SELECT_TYPE_SELECT)
... | false | false | false | false | false | 0 |
printArgument(const Argument *Arg,
AttributeSet Attrs, unsigned Idx) {
// Output type...
TypePrinter.print(Arg->getType(), Out);
// Output parameter attributes list
if (Attrs.hasAttributes(Idx))
Out << ' ' << Attrs.getAsString(Idx);
// Output name, if available...
if... | false | false | false | false | false | 0 |
odm_EVMdbToPercentage(s8 Value)
{
/* -33dB~0dB to 0%~99% */
s8 ret_val;
ret_val = Value;
if (ret_val >= 0)
ret_val = 0;
if (ret_val <= -33)
ret_val = -33;
ret_val = 0 - ret_val;
ret_val *= 3;
if (ret_val == 99)
ret_val = 100;
return ret_val;
} | false | false | false | false | false | 0 |
calcFactorPerBand(int k_start, int k_stop, int num_bands)
{
/* Scaled bandfactor and step 1 bit right to avoid overflow
* use double data type */
FIXP_DBL bandfactor = FL2FXCONST_DBL(0.25f); /* Start value */
FIXP_DBL step = FL2FXCONST_DBL(0.125f); /* Initial increment for factor */
int direction = 1;
... | false | false | false | false | false | 0 |
add_FID(i_ctx_t *i_ctx_p, ref * fp /* t_dictionary */ , gs_font * pfont,
gs_ref_memory_t *imem)
{
ref fid;
make_tav(&fid, t_fontID,
a_readonly | imemory_space(imem) | imemory_new_mask(imem),
pstruct, (void *)pfont);
return (i_ctx_p ? idict_put_string(fp, "FID", &fid) :
... | false | false | false | false | false | 0 |
transportEnc_GetStaticBits( HANDLE_TRANSPORTENC hTp, int auBits )
{
INT nbits = 0, nPceBits = 0;
/* Write PCE within raw_data_block in transport lib. */
if (hTp->pceFrameCounter>=hTp->config.headerPeriod) {
nPceBits = transportEnc_GetPCEBits(hTp->config.channelMode, hTp->config.matrixMixdownA, 3); /* Conside... | false | false | false | false | false | 0 |
should_replace_address (rtx old_rtx, rtx new_rtx, enum machine_mode mode,
addr_space_t as, bool speed)
{
int gain;
if (rtx_equal_p (old_rtx, new_rtx)
|| !memory_address_addr_space_p (mode, new_rtx, as))
return false;
/* Copy propagation is always ok. */
if (REG_P (old_rtx) && REG_P (new_rtx))
... | false | false | false | false | false | 0 |
show_traces_open(struct inode *inode, struct file *file)
{
struct trace_array *tr = inode->i_private;
struct seq_file *m;
int ret;
if (tracing_disabled)
return -ENODEV;
ret = seq_open(file, &show_traces_seq_ops);
if (ret)
return ret;
m = file->private_data;
m->private = tr;
return 0;
} | false | false | false | false | false | 0 |
removeentry (Node *n) {
lua_assert(ttisnil(gval(n)));
if (valiswhite(gkey(n)))
setdeadvalue(wgkey(n)); /* unused and unmarked key; remove it */
} | false | false | false | false | false | 0 |
AlterTableNamespaceInternal(Relation rel, Oid oldNspOid, Oid nspOid,
ObjectAddresses *objsMoved)
{
Relation classRel;
Assert(objsMoved != NULL);
/* OK, modify the pg_class row and pg_depend entry */
classRel = heap_open(RelationRelationId, RowExclusiveLock);
AlterRelationNamespaceInternal(classRel, Relat... | false | false | false | false | false | 0 |
process(int key_in,int process_mouse)
{
UI_GADGET *tmp;
// only does stuff in non THREADED mode
os_poll();
if (process_mouse){
ui_mouse_process();
}
if (key_in == -1){
keypress = game_check_key();
} else {
keypress = key_in;
}
last_keypress = keypress;
do_dump_check();
if (mouse_captured_gadget && ... | false | false | false | false | false | 0 |
strokeAntiAlias( bool flag_ )
{
flag_ ? _drawInfo->stroke_antialias=MagickTrue : _drawInfo->stroke_antialias=MagickFalse;
} | false | false | false | false | false | 0 |
find_free_space(struct btrfs_free_space_ctl *ctl, u64 *offset, u64 *bytes,
unsigned long align, u64 *max_extent_size)
{
struct btrfs_free_space *entry;
struct rb_node *node;
u64 tmp;
u64 align_off;
int ret;
if (!ctl->free_space_offset.rb_node)
goto out;
entry = tree_search_offset(ctl, offset_to_bitmap(ctl,... | false | false | false | false | false | 0 |
asf_parse_read_object(asfint_object_t *obj, uint8_t *data)
{
asf_byteio_getGUID(&obj->guid, data);
obj->type = asf_guid_get_type(&obj->guid);
obj->size = asf_byteio_getQWLE(data + 16);
obj->full_data = data;
obj->datalen = 0;
obj->data = NULL;
obj->next = NULL;
if (obj->type == GUID_UNKNOWN) {
debug_printf("... | false | false | false | false | false | 0 |
giggle_git_save_remote (GiggleGit *git,
GiggleRemote*remote)
{
GiggleGitPriv *priv;
gchar *path;
g_return_if_fail (GIGGLE_IS_GIT (git));
g_return_if_fail (GIGGLE_IS_REMOTE (remote));
priv = git->priv;
path = g_build_filename (priv->git_dir, "remotes", giggle_remote_get_name (remote), NULL);
giggl... | false | false | false | false | false | 0 |
ip_is_valid_ipv6(const char* address)
{
unsigned char buf[16];
int ret = net_string_to_address(AF_INET6, address, buf);
if (ret <= 0) return 0;
return 1;
} | false | false | false | false | false | 0 |
GrabWord(string Word,WordList *List,unsigned char &Out)
{
for (unsigned int C = 0; List[C].Str != 0; C++)
{
if (strcasecmp(Word.c_str(),List[C].Str) == 0)
{
Out = List[C].Val;
return true;
}
}
return false;
} | false | false | false | false | false | 0 |
w_long(unsigned int fd, unsigned int cmd,
compat_ulong_t __user *argp)
{
mm_segment_t old_fs = get_fs();
int err;
unsigned long val;
set_fs (KERNEL_DS);
err = sys_ioctl(fd, cmd, (unsigned long)&val);
set_fs (old_fs);
if (!err && put_user(val, argp))
return -EFAULT;
return err;
} | false | false | false | false | false | 0 |
makefvec(FILE *f)
{
char **result, *ln;
int msize, rcnt, ch;
unsigned l;
LONG w;
if ((result = (char **) malloc((MALLINIT+1) * sizeof(char *))) == 0)
nomem();
msize = MALLINIT;
rcnt = 0;
while ((ch = getc(f)) != EOF) {
l = 1;
w = ftell(f) - 1;
while (ch != '\n' && ch != EOF) {
l++;
ch =... | false | false | false | true | true | 1 |
po2030n_probe(struct gspca_dev *gspca_dev)
{
struct sd *sd = (struct sd *) gspca_dev;
u16 val;
/* check gc0307 */
reg_w1(gspca_dev, 0x17, 0x62);
reg_w1(gspca_dev, 0x01, 0x08);
reg_w1(gspca_dev, 0x02, 0x22);
sd->i2c_addr = 0x21;
i2c_r(gspca_dev, 0x00, 1);
val = gspca_dev->usb_buf[4];
reg_w1(gspca_dev, 0x01, 0... | false | false | false | false | false | 0 |
opt_process_one(struct opt_entry *list, opt_flags *flg, char *opt)
{
char *param;
struct opt_entry *entry;
param = opt_find(list, opt, &entry);
if (!entry) return OPT_ERROR_UNKNOWN;
if (*flg & entry->flg_set & entry->flg_clr) return OPT_ERROR_COMB;
*flg &= ~entry->flg_clr;
*flg |= entry->flg_set;
if (entry-... | false | false | false | false | false | 0 |
setAccurate(bool accurate)
{
if (m_accurate != accurate) {
m_accurate = accurate;
m_dirty = true;
}
} | false | false | false | false | false | 0 |
gf_xml_get_namespace_qname(GF_DOMNode *elt, u32 ns)
{
GF_DOMAttribute *att = elt->attributes;
while (att) {
if (att->tag==TAG_DOM_ATT_any) {
GF_DOMFullAttribute *datt = (GF_DOMFullAttribute*)att;
if (datt->name && !strncmp(datt->name, "xmlns", 5) && (gf_xml_get_namespace_id(*(DOM_String *) datt->data)==ns)) ... | false | false | false | false | false | 0 |
st_delete_safe(register st_table *table, register st_data_t *key, st_data_t *value, st_data_t never)
{
st_index_t hash_val;
register st_table_entry *ptr;
if (table->entries_packed) {
st_index_t i;
for (i = 0; i < table->num_entries; i++) {
if ((st_data_t)table->bins[i*2] == *key) {
if (value != 0)... | false | false | false | false | false | 0 |
hkl_lattice_set(HklLattice *self,
double a, double b, double c,
double alpha, double beta, double gamma)
{
int res = HKL_FAIL;
if(!check_lattice_param(a, b, c, alpha, beta, gamma)) {
self->a->value = a;
self->b->value = b;
self->c->value = c;
self->alpha->value = alpha;
self->beta->value = beta... | false | false | false | false | false | 0 |
cp_bandwidth(const String &str, uint32_t *result)
{
int power = 0, factor = 1;
const char *after_unit = read_unit(str.begin(), str.end(), byte_bandwidth_units, sizeof(byte_bandwidth_units), byte_bandwidth_prefixes, &power, &factor);
if (!cp_real10(str.substring(str.begin(), after_unit), 0, power, result))
ret... | false | false | false | false | false | 0 |
maze_pop()
{
if(site_max == 0)
return 1;
int i = gamerand.get() % site_max;
site_max--;
if(i != site_max)
{
int tmpx = sitex[site_max];
int tmpy = sitey[site_max];
sitex[site_max] = sitex[i];
sitey[site_max] = sitey[i];
sitex[i] = tmpx;
sitey[i] = tmpy;
}
return 0;
} | false | false | false | false | false | 0 |
xmlwrite_entry_extra_anim (uint16_t type, uint8_t * info, rRCOFile * rco,
FILE * fp)
{
int numEntries = RCO_ANIM_EXTRA_LEN[type];
int i = 0, i2 = 0;
if (numEntries < 1)
return; // TODO: handle unknown object types?
for (i = 0, i2 = 0; i < numEntries; i++, i2++) { // i2 doesn't include
// the po... | false | false | false | false | false | 0 |
e_calendar_item_normalize_date (ECalendarItem *calitem,
gint *year,
gint *month)
{
if (*month >= 0) {
*year += *month / 12;
*month = *month % 12;
} else {
*year += *month / 12 - 1;
*month = *month % 12;
if (*month != 0)
*month += 12;
}
} | false | false | false | false | false | 0 |
_libssh2_base64_encode(LIBSSH2_SESSION *session,
const char *inp, size_t insize, char **outptr)
{
unsigned char ibuf[3];
unsigned char obuf[4];
int i;
int inputparts;
char *output;
char *base64data;
const char *indata = inp;
*outptr = NULL; /* set to NULL in case of failur... | false | false | false | false | false | 0 |
read_u16 (FILE *fp, size_t *rn)
{
int c;
if ( (c = getc (fp)) == EOF )
return -1;
*rn = c << 8;
if ( (c = getc (fp)) == EOF )
return -1;
*rn |= c;
return 0;
} | false | true | false | false | true | 1 |
DeleteExpandedAtoms(OBMol& mol)
{
//The atom that carries the AliasData object remains as an Xx atom with no charge;
//the others are deleted. All the attached hydrogens are also deleted.
for(unsigned i=0;i<_expandedatoms.size();++i)
{
OBAtom* at = mol.GetAtomById(_expandedatoms[i]);
if(!at)
conti... | false | false | false | false | false | 0 |
window_raise(struct view *view)
{
if (!display)
display = display_init();
display_get_geometry(display, &display_rows, &display_columns);
display_erase(display, 0, 0, display_rows, display_columns);
while (window_list && window_list->view != view)
window_destroy(window_list);
while (window_list && window_list-... | false | false | false | false | false | 0 |
afr_lock_recovery (call_frame_t *frame, xlator_t *this)
{
afr_local_t *local = NULL;
afr_private_t *priv = NULL;
fd_t *fd = NULL;
int ret = 0;
int32_t source_child = 0;
struct gf_flock flock = {0,};
... | 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.