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 |
|---|---|---|---|---|---|---|
saa7134_hw_enable2(struct saa7134_dev *dev)
{
unsigned int irq2_mask;
/* enable IRQ's */
irq2_mask =
SAA7134_IRQ2_INTE_DEC3 |
SAA7134_IRQ2_INTE_DEC2 |
SAA7134_IRQ2_INTE_DEC1 |
SAA7134_IRQ2_INTE_DEC0 |
SAA7134_IRQ2_INTE_PE |
SAA7134_IRQ2_INTE_AR;
if (dev->has_remote == SAA7134_REMOTE_... | false | false | false | false | false | 0 |
event_rest(decorators,n,m,type)
int n, m, type;
int decorators[DECSIZE];
{
struct fract newlen;
inmusic = 1;
if( type == 1) emit_string("x");
else emit_string("z");
newlen.num = n * lenfactor.num;
newlen.denom = m * lenfactor.denom;
reduce(&newlen.num, &newlen.denom);
printlen(newlen.num, newlen.denom)... | false | false | false | false | false | 0 |
path_put_conditional(struct path *path, struct nameidata *nd)
{
dput(path->dentry);
if (path->mnt != nd->path.mnt)
mntput(path->mnt);
} | false | false | false | false | false | 0 |
kepler(gdouble M, gdouble e)
{
gint n = 0;
gdouble E, Eold, eps = 1.0e-8;
E = M + e * sin(M);
do {
Eold = E;
E = Eold + (M - Eold + e * sin(Eold))
/ (1.0 - e * cos(Eold));
++n;
} while ((fabs(E - Eold) > eps) && (n < 100));
return (E);
} | false | false | false | false | false | 0 |
getDiscretizationData(int& nof_components, linDeltaType*& types, double*& valuesU, double*& valuesV, bool*& useFixedN)
{
nof_components = data.nofEmfComponents;
types = new linDeltaType[nof_components];
valuesU = new double[nof_components];
useFixedN = new bool[nof_components];
for (int i = 0; i < nof_compo... | false | false | false | false | false | 0 |
seek(long int offset, int origin)
{
if (origin == SEEK_SET) {
streamPos = offset;
} else if (origin == SEEK_CUR) {
streamPos += offset;
} else {
streamPos = length + offset;
}
if (streamPos > length) {
streamPos = 0;
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
wlc_phy_reapply_txcal_coeffs_nphy(struct brcms_phy *pi)
{
u16 tbl_buf[7];
if ((pi->nphy_txiqlocal_chanspec == pi->radio_chanspec) &&
(pi->nphy_txiqlocal_coeffsvalid)) {
wlc_phy_table_read_nphy(pi, NPHY_TBL_ID_IQLOCAL,
ARRAY_SIZE(tbl_buf), 80, 16, tbl_buf);
if ((pi->nphy_txiqlocal_bestc[0] != tbl_buf[0... | false | false | false | false | false | 0 |
entry_allocate( void )
{
Bqueue *tmp;
if( bcache.count > 0 )
{
pthread_mutex_lock( &bcache.lock );
if( bcache.count <= 0 )
{
pthread_mutex_unlock( &bcache.lock );
goto dalloc;
}
tmp = bcache.list;
bcache.list = bcache.list->next;
bcache.count--;
pthread_mutex_unlock( &bcache.lock );
memset... | false | false | false | false | false | 0 |
decl_count(void* buffer)
{
// atomic if(--*(_msgpack_atomic_counter_t*)buffer == 0) { free(buffer); }
if(_msgpack_sync_decr_and_fetch((volatile _msgpack_atomic_counter_t*)buffer) == 0) {
free(buffer);
}
} | false | false | false | false | false | 0 |
pie_get_cal_info (Pie_Device * dev, int sfd)
{
size_t size;
SANE_Status status;
unsigned char *data;
unsigned char buffer[280];
DBG (DBG_proc, "get_cal_info\n");
if (!(dev->inquiry_scan_capability & INQ_CAP_EXT_CAL))
return;
size = 6;
set_write_length (swrite.cmd, size);
memcp... | false | false | false | false | false | 0 |
vs_scanline_merge_4tap_AYUV64 (uint16_t * dest, uint16_t * src1,
uint16_t * src2, uint16_t * src3, uint16_t * src4, int n, int acc)
{
int i;
int y;
int off;
int a, b, c, d;
acc = (acc >> 8) & 0xff;
a = vs_4tap_taps[acc][0];
b = vs_4tap_taps[acc][1];
c = vs_4tap_taps[acc][2];
d = vs_4tap_taps[acc]... | false | false | false | false | false | 0 |
addBookmark( const QString & text, const KUrl & url, const QString & icon )
{
if (isNull())
return KBookmark();
QDomDocument doc = element.ownerDocument();
QDomElement elem = doc.createElement( "bookmark" );
elem.setAttribute( "href", url.url() ); // gives us utf8
QDomElement textElem = doc... | false | false | false | false | false | 0 |
d(double x, PDFType type,
vector<double const *> const &par, bool give_log) const
{
if (type == PDF_PRIOR) {
//Avoid expensive evaluation of the beta function
if (x < 0 || x > 1) {
return give_log ? JAGS_NEGINF : 0;
}
else if (x == 0) {
//Density at 0 defined by continuity
return xlog0(*par[0] ... | false | false | false | false | false | 0 |
checkValue(const OFString &vm,
const OFBool /*oldFormat*/)
{
OFString strVal;
/* get "raw value" without any modifications (if possible) */
OFCondition l_error = getStringValue(strVal);
if (l_error.good())
l_error = DcmIntegerString::checkStringValue(strV... | false | false | false | false | false | 0 |
description_load_from_file (const char *filename,
GError **error)
{
char *contents;
gsize len;
NodeInfo *nodes;
contents = NULL;
if (!g_file_get_contents (filename, &contents, &len, error))
return NULL;
nodes = description_load_from_string (contents, len, e... | false | false | false | false | false | 0 |
picolcd_raw_keypad(struct picolcd_data *data,
struct hid_report *report, u8 *raw_data, int size)
{
/*
* Keypad event
* First and second data bytes list currently pressed keys,
* 0x00 means no key and at most 2 keys may be pressed at same time
*/
int i, j;
/* determine newly pressed keys */
for (i = 0; i ... | false | false | false | false | false | 0 |
resizeEvent( QResizeEvent* ev )
{
kDebug() << "Size" << ev->size();
m_renderer.setBackgroundSize( ev->size() );
QRectF rect( 0, 0, ev->size().width(), ev->size().height() );
m_scene.setSceneRect( rect );
QSize boardSize( sceneRect().width() - MIN_MARGIN,
sceneRect().height()... | false | false | false | false | false | 0 |
svg_traverse_text_block(GF_Node *node, SVGAllAttributes *atts, GF_TraverseState *tr_state, GF_List *spans)
{
GF_ChildNodeItem *child;
Bool is_switch = 0;
switch (gf_node_get_tag(node)) {
case TAG_DOMText:
svg_traverse_domtext(node, atts, tr_state, spans, NULL);
break;
case TAG_SVG_tspan:
/*mark tspan as di... | false | false | false | false | false | 0 |
SaveAll(std::ostream &s){
tConfItemMap & confmap = ConfItemMap();
for(tConfItemMap::iterator iter = confmap.begin(); iter != confmap.end() ; ++iter)
{
tConfItemBase * ci = (*iter).second;
if (ci->Save()){
s << std::setw(28) << ci->title << " ";
ci->WriteVal(s);
... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__ListBox_NotifyChanged__00000014(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * listBox, struct __ecereNameSpace__ecere__com__Instance * row)
{
struct NamedStringsBox * __ecerePointer_NamedStringsBox = (struct ... | false | false | false | false | false | 0 |
initio_msgout_abort_targ(struct initio_host * host)
{
outb(((inb(host->addr + TUL_SSignal) & (TSC_SET_ACK | 7)) | TSC_SET_ATN), host->addr + TUL_SSignal);
if (initio_msgin_accept(host) == -1)
return -1;
if (host->phase != MSG_OUT)
return initio_bad_seq(host);
outb(MSG_ABORT, host->addr + TUL_SFifo);
outb(TSC... | false | false | false | false | false | 0 |
iscsi_boot_create_host_kset(unsigned int hostno)
{
struct iscsi_boot_kset *boot_kset;
char *set_name;
set_name = kasprintf(GFP_KERNEL, "iscsi_boot%u", hostno);
if (!set_name)
return NULL;
boot_kset = iscsi_boot_create_kset(set_name);
kfree(set_name);
return boot_kset;
} | false | false | false | false | false | 0 |
lock_strings(hx509_lock lock, getarg_strings *pass)
{
int i;
for (i = 0; i < pass->num_strings; i++) {
int ret = hx509_lock_command_string(lock, pass->strings[i]);
if (ret)
errx(1, "hx509_lock_command_string: %s: %d",
pass->strings[i], ret);
}
} | false | false | false | false | false | 0 |
gt_pch_nx_cgraph_node (void *x_p)
{
struct cgraph_node * x = (struct cgraph_node *)x_p;
struct cgraph_node * xlimit = x;
while (gt_pch_note_object (xlimit, xlimit, gt_pch_p_11cgraph_node, gt_ggc_e_11cgraph_node))
xlimit = ((*xlimit).next);
if (x != xlimit)
for (;;)
{
struct cgraph_node * co... | false | false | false | true | false | 1 |
error_with_position(const expr_position_ty *pp, sub_context_ty *scp,
char *fmt)
{
string_ty *s;
int need_to_delete;
if (scp)
need_to_delete = 0;
else
{
scp = sub_context_new();
need_to_delete = 1;
}
s = subst_intl(scp, fmt);
/* re-use the ... | false | false | false | false | false | 0 |
emitCSpecificHandlerTable(const MachineFunction *MF) {
auto &OS = *Asm->OutStreamer;
MCContext &Ctx = Asm->OutContext;
WinEHFuncInfo &FuncInfo = MMI->getWinEHFuncInfo(MF->getFunction());
// Use the assembler to compute the number of table entries through label
// difference and division.
MCSymbol *TableBeg... | false | false | false | false | false | 0 |
gog_axis_set_atype (GogAxis *axis, GogAxisType new_type)
{
if (axis->type == new_type)
return FALSE;
axis->type = new_type;
gog_axis_figure_subclass (axis);
if (new_type == GOG_AXIS_PSEUDO_3D)
g_object_set (G_OBJECT (axis),
"major-tick-labeled", FALSE,
"major-tick-in", FALSE,
"major-... | false | false | false | false | false | 0 |
rtl88e_dm_cck_packet_detection_thresh(struct ieee80211_hw *hw)
{
struct rtl_priv *rtlpriv = rtl_priv(hw);
struct dig_t *dm_dig = &rtlpriv->dm_digtable;
u8 cur_cck_cca_thresh;
if (dm_dig->cur_sta_cstate == DIG_STA_CONNECT) {
dm_dig->rssi_val_min = rtl88e_dm_initial_gain_min_pwdb(hw);
if (dm_dig->rssi_val_min > ... | false | false | false | false | false | 0 |
correct_tm(int islocal, const time_t *timep, struct tm *resultbuf,
struct tm *r)
{
const char *outcome;
if (PREDICT_LIKELY(r)) {
if (r->tm_year > 8099) { /* We can't strftime dates after 9999 CE. */
r->tm_year = 8099;
r->tm_mon = 11;
r->tm_mday = 31;
r->tm_yday = 365;
r... | false | false | false | false | false | 0 |
dump_lattice_value (FILE *outf, const char *prefix, prop_value_t val)
{
switch (val.lattice_val)
{
case UNINITIALIZED:
fprintf (outf, "%sUNINITIALIZED", prefix);
break;
case UNDEFINED:
fprintf (outf, "%sUNDEFINED", prefix);
break;
case VARYING:
fprintf (outf, "%sVARYING",... | false | false | false | false | false | 0 |
apply(ScheduleDAGMI *DAG) {
// Map DAG NodeNum to store chain ID.
DenseMap<unsigned, unsigned> StoreChainIDs;
// Map each store chain to a set of dependent loads.
SmallVector<SmallVector<SUnit*,4>, 32> StoreChainDependents;
for (unsigned Idx = 0, End = DAG->SUnits.size(); Idx != End; ++Idx) {
SUnit *SU = ... | false | false | false | false | false | 0 |
socket_io_filter (MonoObject *target, MonoObject *state)
{
gint op;
MonoSocketAsyncResult *sock_res;
MonoClass *klass;
MonoDomain *domain;
if (target == NULL || state == NULL)
return FALSE;
domain = target->vtable->domain;
klass = target->vtable->klass;
if (socket_async_call_klass == NULL && is_socketasyncc... | false | false | false | false | false | 0 |
emit_network_data_changed (GeoclueGsmlocOfono *ofono)
{
GeoclueGsmlocOfonoPrivate *priv = GET_PRIVATE (ofono);
const char *mcc, *mnc, *lac, *cid;
GList *modems, *netops;
mcc = mnc = lac = cid = NULL;
/* find the first complete cell data we have */
for (modems = priv->modems; modems; modems = modems->next) {
... | false | false | false | false | false | 0 |
ast_channel_internal_alertpipe_init(struct ast_channel *chan)
{
if (pipe(chan->alertpipe)) {
ast_log(LOG_WARNING, "Channel allocation failed: Can't create alert pipe! Try increasing max file descriptors with ulimit -n\n");
return -1;
} else {
int flags = fcntl(chan->alertpipe[0], F_GETFL);
if (fcntl(chan->ale... | false | false | false | false | false | 0 |
iWcWidth(ULONG ucs)
{
/* Test for 8-bit control characters */
if (ucs == 0) {
return 0;
}
if (ucs < 0x20 || (ucs >= 0x7f && ucs < 0xa0)) {
NO_DBG_HEX(ucs);
return -1;
}
/* Binary search in table of non-spacing characters */
if (bIsZeroWidthChar(ucs)) {
return 0;
}
/* Ucs is not a combining or C0/C1 c... | false | false | false | false | false | 0 |
multiplexer_at_command (Multiplexer* self, const gchar* command) {
gboolean result = FALSE;
FsoFrameworkLogger* _tmp0_ = NULL;
const gchar* _tmp1_ = NULL;
gchar* _tmp2_ = NULL;
gchar* _tmp3_ = NULL;
gboolean _tmp4_ = FALSE;
gchar* response = NULL;
gchar* _tmp5_ = NULL;
gint response_length1 = 0;
gint _respons... | false | false | false | false | false | 0 |
HeapPop(HistoHeap* const histo_heap) {
HistogramPair* const heap = histo_heap->heap - 1;
int* const positions = histo_heap->positions;
const int heap_size = histo_heap->size;
const int max_index = histo_heap->max_index;
int v = 1;
if (heap[v].idx1 >= 0) {
positions[heap[v].idx1 * max_index + heap[v].idx... | false | false | false | false | false | 0 |
ptys_get_supported_port(struct mlx4_ptys_reg *ptys_reg)
{
u32 eth_proto = be32_to_cpu(ptys_reg->eth_proto_cap);
if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_T)
| MLX4_PROT_MASK(MLX4_1000BASE_T)
| MLX4_PROT_MASK(MLX4_100BASE_TX))) {
return SUPPORTED_TP;
}
if (eth_proto & (MLX4_PROT_MASK(MLX4_10GBASE_CR)... | false | false | false | false | false | 0 |
ufshcd_compose_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
{
u32 upiu_flags;
int ret = 0;
switch (lrbp->command_type) {
case UTP_CMD_TYPE_SCSI:
if (likely(lrbp->cmd)) {
ufshcd_prepare_req_desc_hdr(lrbp, &upiu_flags,
lrbp->cmd->sc_data_direction);
ufshcd_prepare_utp_scsi_cmd_upiu(lrbp, upiu_flag... | false | false | false | false | false | 0 |
xdr_nulltype(XDR *xdrs, void **objp, xdrproc_t proc)
{
bool_t null;
switch (xdrs->x_op) {
case XDR_DECODE:
if (!xdr_bool(xdrs, &null))
return FALSE;
if (null) {
*objp = NULL;
return TRUE;
}
return (*proc)(xdrs, objp);
case XDR_ENCODE:
if (*objp == NULL)
... | false | false | false | false | false | 0 |
pluto_irq(int irq, void *dev_id)
{
struct pluto *pluto = dev_id;
u32 tscr;
/* check whether an interrupt occurred on this device */
tscr = pluto_readreg(pluto, REG_TSCR);
if (!(tscr & (TSCR_DE | TSCR_OVR)))
return IRQ_NONE;
if (tscr == 0xffffffff) {
if (pluto->dead == 0)
dev_err(&pluto->pdev->dev, "card ... | false | false | false | false | false | 0 |
fc_setup_exch_mgr(void)
{
fc_em_cachep = kmem_cache_create("libfc_em", sizeof(struct fc_exch),
0, SLAB_HWCACHE_ALIGN, NULL);
if (!fc_em_cachep)
return -ENOMEM;
/*
* Initialize fc_cpu_mask and fc_cpu_order. The
* fc_cpu_mask is set for nr_cpu_ids rounded up
* to order of 2's * power and order is stored... | false | false | false | false | false | 0 |
set_dis_or_dtc(t30_state_t *s)
{
/* Whether we use a DIS or a DTC is determined by whether we have received a DIS.
We just need to edit the prebuilt message. */
s->local_dis_dtc_frame[2] = (uint8_t) (T30_DIS | s->dis_received);
/* If we have a file name to receive into, then we are receive capable */... | false | false | false | false | false | 0 |
ffcase(cell val, char *labelname, int newtable)
{
if (newtable)
{
stgwrite("\tcasetbl\n");
code_idx += opcodes(1);
} /* if */
stgwrite("\tcase ");
outval(val, FALSE);
stgwrite(" ");
stgwrite(labelname);
stgwrite("\n");
code_idx += opcodes(0) + opargs(2);
} | false | false | false | false | false | 0 |
handleRead(int rpipe, unsigned int &result)
{
char type = 0;
if (read(rpipe, &type, 1) <= 0) {
if (errno == EAGAIN)
return 0;
return -1;
}
if (type != REPORT_OUT && type != REPORT_ERROR && type != REPORT_INFO && type != CHILD_END) {
std::cerr << "#### You found a bu... | false | false | false | false | false | 0 |
init_def_list (tree type)
{
tree expr;
struct imp_entry *impent;
location_t loc;
vec<constructor_elt, va_gc> *v = NULL;
if (imp_count)
for (impent = imp_list; impent; impent = impent->next)
{
if (TREE_CODE (impent->imp_context) == CLASS_IMPLEMENTATION_TYPE)
{
loc = DECL_SOURCE_LOCATION (im... | false | false | false | false | false | 0 |
evergreen_surface_check(struct radeon_cs_parser *p,
struct eg_surface *surf,
const char *prefix)
{
/* some common value computed here */
surf->bpe = r600_fmt_get_blocksize(surf->format);
switch (surf->mode) {
case ARRAY_LINEAR_GENERAL:
return evergreen_surface_check_linear(p, surf, prefix);
case A... | false | false | false | false | false | 0 |
addLines(int num)
{
int len;
char buf[USERSIZE + 1];
while (1) {
/* Returns:
* -1 on read errors or EOF, or on bare Ctrl-D.
* 0 on ctrl-C,
* >0 length of input string, including terminating '\n'
*/
len = read_line_input("", buf, sizeof(buf), NULL);
if (len <= 0) {
/* Previously, ctrl-C was exi... | true | true | false | false | false | 1 |
fa_readlink(const std::string& path, std::string& linkpath) {
RETRYLOOP {
STARTHEADER(CMD_READLINK,sizeof(int)+path.length());
if(!swrite_string(*file_access_,path)) ABORTALL;
int res = 0;
int l = 0;
header_t header;
if(!sread(*file_access_,&header,sizeof(header))) ABORTALL;
if((header.c... | false | false | false | false | false | 0 |
intToStr(int i)
{
std::ostringstream os;
os << i << std::ends;
return os.str();
} | false | false | false | false | false | 0 |
tracker_class_add_delete_event (TrackerClass *class,
gint graph_id,
gint subject_id,
gint pred_id,
gint object_id)
{
TrackerClassPrivate *priv;
g_return_... | false | false | false | false | false | 0 |
most_register_aim(struct most_aim *aim)
{
struct most_aim_obj *aim_obj;
if (!aim) {
pr_err("Bad driver\n");
return -EINVAL;
}
aim_obj = create_most_aim_obj(aim->name);
if (!aim_obj) {
pr_info("failed to alloc driver object\n");
return -ENOMEM;
}
aim_obj->driver = aim;
aim->context = aim_obj;
pr_info("... | false | false | false | false | false | 0 |
iso_clip(int v, int vmin, int vmax){
if(v > vmax || v < vmin) return vmin;
else return v;
} | false | false | false | false | false | 0 |
garbage_collection(CELL gen,
bool growing_data_heap_,
CELL requested_bytes)
{
if(gc_off)
{
critical_error("GC disabled",gen);
return;
}
GC_PRINT(GC_REQUESTED,growing_data_heap_,requested_bytes);
s64 start = current_millis();
performing_gc = true;
growing_data_heap = growing_data_heap_;
collecting_gen =... | false | false | false | false | false | 0 |
output_path(pf_state_t *p, state_t *s)
/* Stores the final path in newly allocated dynmem
** Parameters: (pf_state_t *) p: The pathfinding state
** (state_t *) s: The game state
** Returns : (reg_t) Pointer to dynmem containing path
*/
{
int path_len = 0;
byte *oref;
reg_t output;
vertex_t *vertex = p... | false | false | false | false | false | 0 |
mastermind_getmove
(Pos *pos, int x, int y, GtkboardEventType type, Player to_play, byte **movp, int ** rmovep)
{
static int rmove[7];
int *rp = rmove;
int tmp;
int i, found;
static byte move[7];
byte *mp = move;
if (type != GTKBOARD_BUTTON_RELEASE)
return 0;
tmp = MASTERMIND_GET_SELECTION(x,y);
if (tmp >... | false | false | false | false | false | 0 |
wil_cfg80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params,
u64 *cookie)
{
const u8 *buf = params->buf;
size_t len = params->len;
struct wil6210_priv *wil = wiphy_to_wil(wiphy);
int rc;
bool tx_status = false;
struct ieee80211_mgmt *mgmt_frame = (void *)buf... | false | false | false | false | false | 0 |
gameOver(ExtPatternMatcher &pm,GameResult gr,
int hasreason)
{
char reason[64];
ChessGame *refgame;
if (hasreason) {
g_strlcpy(reason,pm.getStarToken(0),64);
} else
strcpy(reason,"Game over"); // I can't think of anything better...
if ( (gr==BLACK_WIN && EngineW... | false | false | false | false | false | 0 |
Validate( const aiCamera* pCamera)
{
if (pCamera->mClipPlaneFar <= pCamera->mClipPlaneNear)
ReportError("aiCamera::mClipPlaneFar must be >= aiCamera::mClipPlaneNear");
// FIX: there are many 3ds files with invalid FOVs. No reason to
// reject them at all ... a warning is appropriate.
if (!pCamera->mHorizontalFOV... | false | false | false | false | false | 0 |
hi8435_debugfs_reg_access(struct iio_dev *idev,
unsigned reg, unsigned writeval,
unsigned *readval)
{
struct hi8435_priv *priv = iio_priv(idev);
int ret;
u8 val;
if (readval != NULL) {
ret = hi8435_readb(priv, reg, &val);
*readval = val;
} else {
val = (u8)writeval;
ret = hi8435_writeb(p... | false | false | false | false | false | 0 |
has_binary_keyword(const char* filename){
FILE* in;
char line[80];
int has_binary=0;
in = fopen(filename, "r");
if( in==0 ) return 2;
while( fgets(line, sizeof(line), in) ){
/* End of header? */
if( line[0]=='\n' || line[0]=='\r' ){
break;
}
/* Is this the "expand" field? */
#define... | true | true | false | false | true | 1 |
paste_clipboard_data (FMTreeView *view,
GtkSelectionData *selection_data,
char *destination_uri)
{
gboolean cut;
GList *item_uris;
cut = FALSE;
item_uris = nemo_clipboard_get_uri_list_from_selection_data (selection_data, &cut,
copied_files_atom);
if (item_uris == NULL|| destination_uri ... | false | false | false | false | false | 0 |
dns_ip6_packet_add(stralloc *out,char *buf,unsigned int len)
{
unsigned int pos;
char header[16];
uint16 numanswers;
uint16 datalen;
pos = dns_packet_copy(buf,len,0,header,12); if (!pos) return -1;
uint16_unpack_big(header + 6,&numanswers);
pos = dns_packet_skipname(buf,len,pos); if (!pos) return -1;
p... | false | false | false | false | false | 0 |
scpiLex_NondecimalNumericData(lex_state_t * state, scpi_token_t * token) {
token->ptr = state->pos;
int someNumbers = 0;
if (skipChr(state, '#')) {
if (!iseos(state)) {
if (isH(state->pos[0])) {
state->pos++;
someNumbers = skipHexNum(state);
... | false | false | false | false | false | 0 |
zcount(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
push(1);
make_int(op, ref_stack_count(&o_stack) - 1);
return 0;
} | false | false | false | false | false | 0 |
gamgi_mesa_render_polygons_color (int *loops,
double *points, int *paints, float *colors)
{
int i;
int n_loops, n_vertices;
double v1[3], v2[3], normal[3];
i = 0;
n_loops = loops[i++];
while (n_loops-- > 0)
{
/****************************
* change color: the paints *
* array is zero-terminated *
********... | false | false | false | false | false | 0 |
tcp_socket_timer(void *ctx)
{
rad_listen_t *listener = ctx;
listen_socket_t *sock = listener->data;
struct timeval end, now;
char buffer[256];
fr_event_now(el, &now);
/*
* If we enforce a lifetime, do it now.
*/
if (sock->home->lifetime) {
end.tv_sec = sock->opened + sock->home->lifetime;
end.tv_usec =... | true | true | false | false | false | 1 |
addRenderable(Pass* pass, Renderable* rend)
{
// ascending and descending sort both set bit 1
if (mOrganisationMode & OM_SORT_DESCENDING)
{
mSortedDescending.push_back(RenderablePass(rend, pass));
}
if (mOrganisationMode & OM_PASS_GROUP)
{
Pas... | false | false | false | false | false | 0 |
PointInSelMargin(Point pt) {
// Really means: "Point in a margin"
if (vs.fixedColumnWidth > 0) { // There is a margin
PRectangle rcSelMargin = GetClientRectangle();
rcSelMargin.right = vs.fixedColumnWidth - vs.leftMarginWidth;
return rcSelMargin.Contains(pt);
} else {
return false;
}
} | false | false | false | false | false | 0 |
ldbm_instance_attrcrypt_enable(struct attrinfo *ai, int cipher)
{
attrcrypt_private *priv = NULL;
if (NULL == ai->ai_attrcrypt) {
/* No existing private structure, allocate one */
ai->ai_attrcrypt = (attrcrypt_private*) slapi_ch_calloc(1, sizeof(attrcrypt_private));
}
priv = ai->ai_attrcrypt;
priv->attrcrypt_c... | false | false | false | false | false | 0 |
status_cmd(void){
int vid;
db_must_be_within_tree();
/* 012345678901234 */
fossil_print("repository: %s\n", db_repository_filename());
fossil_print("local-root: %s\n", g.zLocalRoot);
if( g.zConfigDbName ){
fossil_print("config-db: %s\n", g.zConfigDbName);
}
vid = db_lget_int("checkout", ... | false | false | false | false | false | 0 |
prev_desktop_drag (ScreenInfo * s)
{
Client *t;
if (s)
{
if (current && (current->screen == s))
{
t = current;
t->desktop += (prefs.desktops - 1);
t->desktop %= prefs.desktops;
prev_desktop (s);
active (t);
if (t->isnotile)
raise_notile (s);
else
raise_tile (s, 0);
... | false | false | false | false | false | 0 |
do_fetch_unit (PrinterSetupState *state)
{
if (state->display_unit != state->pi->desired_display.top) {
state->pi->desired_display.top = state->display_unit;
state->pi->desired_display.bottom = state->display_unit;
state->pi->desired_display.header = state->display_unit;
state->pi->desired_display.footer = sta... | false | false | false | false | false | 0 |
ingenic_uart_serial_in(struct uart_port *p, int offset)
{
unsigned int value;
value = readb(p->membase + (offset << p->regshift));
/* Hide non-16550 compliant bits from higher levels */
switch (offset) {
case UART_FCR:
value &= ~UART_FCR_UME;
break;
case UART_MCR:
value &= ~(UART_MCR_MDCE | UART_MCR_FCM)... | false | false | false | false | false | 0 |
reset_output(audio_output_t *ao)
{
if(!param.usebuffer)
{
close_output(ao);
return open_output(ao);
}
else return 0;
} | false | false | false | false | false | 0 |
getTclObjValue(Tcl_Interp* interp, Tcl_Obj* value_obj, char& value)
{
if (value_obj == NULL) {
return;
}
int len = 0;
char* tmp = Tcl_GetStringFromObj(value_obj, &len);
if (len > 0) {
value = tmp[0];
}
} | false | false | false | false | false | 0 |
display()
{
CoverFoundItem *item = static_cast< CoverFoundItem* >( m_view->currentItem() );
const bool success = item->hasBigPix() ? true : fetchBigPix();
if( !success )
return;
const QImage &image = item->hasBigPix() ? item->bigPix() : item->thumb();
QWeakPointer<CoverViewDialog> dlg = new... | false | false | false | false | false | 0 |
cols_scoreNPrd(mat1,col1,mat2,col2)
MatType *mat1[], *mat2[] ;
int col1, col2 ;
{
double score = 0.0 ;
int aa ;
for (aa=0; aa<MATRIX_CMPRD_WIDTH; aa++)
if (mat1[aa][col1] > 0 && mat2[aa][col2] > 0)
score += mat1[aa][col1] * mat2[aa][col2] ;
/* normalize maximal score to 1.0 */
s... | false | false | false | false | false | 0 |
rtw_dequeue_xframe(struct xmit_priv *pxmitpriv, struct hw_xmit *phwxmit_i, int entry)
{
struct list_head *sta_plist, *sta_phead;
struct hw_xmit *phwxmit;
struct tx_servq *ptxservq = NULL;
struct __queue *pframe_queue = NULL;
struct xmit_frame *pxmitframe = NULL;
struct adapter *padapter = pxmitpriv->adapter;
str... | false | false | false | false | false | 0 |
nm_gconf_set_ip4_helper (GConfClient *client,
const char *path,
const char *key,
const char *setting,
guint32 tuple_len,
GPtrArray *value)
{
char *gc_key;
int i;
GSList *list = NULL;
gboolean... | false | false | false | false | false | 0 |
dump_vs(void *data)
{
virtual_server *vs = data;
if (vs->vsgname)
log_message(LOG_INFO, " VS GROUP = %s", vs->vsgname);
else if (vs->vfwmark)
log_message(LOG_INFO, " VS FWMARK = %d", vs->vfwmark);
else
log_message(LOG_INFO, " VIP = %s, VPORT = %d"
, inet_sockaddrtos(&vs->addr), ntohs(inet_sockaddrpor... | false | false | false | false | true | 1 |
dev_beginio (TrapContext *context)
{
uae_u32 request = m68k_areg (regs, 1);
uae_u8 flags = get_byte (request + 30);
int command = get_word (request + 28);
struct priv_devstruct *pdev = getpdevstruct (request);
struct devstruct *dev;
int canquick;
put_byte (request + 8, NT_MESSAGE);
if (!pdev) {
put_byte (req... | false | false | false | false | false | 0 |
igb_check_for_fiber_link_generic(struct e1000_hw *hw)
{
struct e1000_mac_info *mac = &hw->mac;
u32 rxcw;
u32 ctrl;
u32 status;
s32 ret_val = E1000_SUCCESS;
DEBUGFUNC("igb_check_for_fiber_link_generic");
ctrl = E1000_READ_REG(hw, E1000_CTRL);
status = E1000_READ_REG(hw, E1000_STATUS);
rxcw = E1000_READ_REG(hw... | false | false | false | false | false | 0 |
cmp(int pos, const char *s) {
int n;
n = (int)strlen(s);
if (pos < 0 || len < n || pos > len - n) {
return gFalse;
}
return !memcmp(buf + pos, s, n);
} | false | false | false | false | false | 0 |
sasl_authCheck(const QString &user, const QString &)
{
//#ifdef XMPP_DEBUG
// printf("authcheck: [%s], [%s]\n", user.latin1(), authzid.latin1());
//#endif
QString u = user;
int n = u.indexOf('@');
if(n != -1)
u.truncate(n);
d->srv.user = u;
d->sasl->continueAfterAuthCheck();
} | false | false | false | false | false | 0 |
twa_scsiop_execute_scsi_complete(TW_Device_Extension *tw_dev, int request_id)
{
struct scsi_cmnd *cmd = tw_dev->srb[request_id];
if (!twa_command_mapped(cmd) &&
(cmd->sc_data_direction == DMA_FROM_DEVICE ||
cmd->sc_data_direction == DMA_BIDIRECTIONAL)) {
if (scsi_sg_count(cmd) == 1) {
void *buf = tw_... | false | false | false | false | false | 0 |
diva_data_q_init(diva_um_idi_data_queue_t *q,
int max_length, int max_segments)
{
int i;
q->max_length = max_length;
q->segments = max_segments;
for (i = 0; i < q->segments; i++) {
q->data[i] = NULL;
q->length[i] = 0;
}
q->read = q->write = q->count = q->segment_pending = 0;
for (i = 0; i < q->segments... | false | false | false | false | false | 0 |
get_title_or_name(const Glib::ustring& locale) const
{
//Use the custom title (overriding the field's default title), if there is one:
//This may even be empty if the developer specifies that.
if(m_title_custom && m_title_custom->get_use_custom_title())
{
return m_title_custom->get_title(locale);
}
//U... | false | false | false | false | false | 0 |
operator==(const NFSubstitution& rhs) const
{
return NFSubstitution::operator==(rhs) &&
((const FractionalPartSubstitution*)&rhs)->byDigits == byDigits;
} | false | false | false | false | false | 0 |
ceph_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
dout("ioctl file %p cmd %u arg %lu\n", file, cmd, arg);
switch (cmd) {
case CEPH_IOC_GET_LAYOUT:
return ceph_ioctl_get_layout(file, (void __user *)arg);
case CEPH_IOC_SET_LAYOUT:
return ceph_ioctl_set_layout(file, (void __user *)arg);
case ... | false | false | false | false | false | 0 |
can_worker_capture(int captureNationRecno)
{
if( nation_recno == captureNationRecno ) // cannot capture its own firm
return 0;
//----- if this firm needs an overseer, can only capture it when the overseer is the spy ---//
if( firm_res[firm_id]->need_overseer )
{
return overseer_recno &&
unit_array[overs... | false | false | false | false | false | 0 |
CreateMenuBar()
// ----------------------------------------------------------------------------
{
// create a menu bar
wxMenuBar* mbar = new wxMenuBar();
wxMenu* fileMenu = new wxMenu(_T(""));
fileMenu->Append(idFileOpen, _("&Open...\tCtrl-O"), _("Open file"));
fileMenu->Append(idMenuQuit, _("&Quit\... | false | false | false | false | false | 0 |
dictionary_get(dictionary * d, char * key, char * def)
{
unsigned hash ;
int i ;
hash = dictionary_hash(key);
for (i=0 ; i<d->size ; i++) {
if (d->key[i]==NULL)
continue ;
/* Compare hash */
if (hash==d->hash[i]) {
/* Compare string, to avoid hash collisions */
... | false | false | false | false | false | 0 |
in_run_list(vector<RESULT*>& run_list, ACTIVE_TASK* atp) {
for (unsigned int i=0; i<run_list.size(); i++) {
if (atp->result == run_list[i]) return true;
}
return false;
} | false | false | false | false | false | 0 |
CompressStrip( unsigned char* buf, unsigned int tile_height ) throw (string)
{
JSAMPROW row[1];
int row_stride = width * channels;
dest->source = buf;
// JSAMPROW *array = new JSAMPROW[tile_height+1];
// for( int y=0; y < tile_height; y++ ){
// array[y] = &data[ y * row_stride ];
// }
// jpeg_write_... | false | false | false | false | false | 0 |
gvfs_udisks2_volume_monitor_update (GVfsUDisks2VolumeMonitor *monitor)
{
g_return_if_fail (GVFS_IS_UDISKS2_VOLUME_MONITOR (monitor));
udisks_client_settle (monitor->client);
update_all (monitor, TRUE, FALSE);
} | false | false | false | false | false | 0 |
main (int argc, char **argv)
{
int display_filenames = 1;
int retcode = 0;
/* Handle long options */
if ( is_in_list (argc, argv, "--help"))
usage (argv[0], 0);
if ( is_in_list (argc, argv, "--version"))
version();
for (;;)
{
switch (getopt (argc, argv, "hVb"))
{
case 'h':
usage (... | false | false | false | false | false | 0 |
fputdword(dw, fp)
long dw;
FILE *fp;
{
if (fputword((u_int)(dw & 0xffff), fp) < 0
|| fputword((u_int)((dw >> 16) & 0xffff), fp) < 0)
return(-1);
return(0);
} | false | false | false | false | false | 0 |
serverworks_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
static const u8 dma_mode[] = { 0x77, 0x21, 0x20 };
int offset = 1 + 2 * ap->port_no - adev->devno;
int devbits = 2 * ap->port_no + adev->devno;
u8 ultra;
u8 ultra_cfg;
struct pci_dev *pdev = to_pci_dev(ap->host->dev);
pci_read_config_byte(p... | false | false | false | false | false | 0 |
init_plugin (Plugin *p)
{
#define ANAME "find"
aname = _("detfind");
p->signature = ANAME VERSION;
p->menu_name = _("_Find..");
p->description = _("Find and list items, using detailed criteria");
p->icon = "plugin_find_"E2IP".png"; //use icon file pathname if appropriate
if (p->action == NULL)
{
//no need to... | 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.