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 |
|---|---|---|---|---|---|---|
cd_state_discrete_to_percent (guint discrete, guint steps)
{
/* check we are in range */
if (discrete > steps)
return 100;
if (steps == 0) {
g_warning ("steps is 0!");
return 0;
}
return ((gfloat) discrete * (100.0f / (gfloat) (steps)));
} | false | false | false | false | false | 0 |
commentDecl(CommentDeclEvent *event)
{
SGMLApplication::CommentDeclEvent appEvent;
appEvent.nComments = 0;
{
for (MarkupIter iter(event->markup()); iter.valid(); iter.advance())
if (iter.type() == Markup::comment)
appEvent.nComments++;
}
SGMLApplication::CharString *comments
= (SGMLApplication:... | false | false | false | false | false | 0 |
gtk_plot_canvas_text_new (const gchar *font, gint height, gint angle,
const GdkColor *fg, const GdkColor *bg,
gboolean transparent,
GtkJustification justification,
const gchar *real_text)
{
GtkPlotCanvasText *text;... | false | false | false | false | false | 0 |
protre_move(node **item, node **fork)
{
/* removes nodes item and its ancestor, fork, from the tree.
the new descendant of fork's ancestor is made to be
fork's second descendant (other than item). Also
returns pointers to the deleted nodes, item and fork */
node *p, *q, *other;
if ((*item)->back ... | false | false | false | false | false | 0 |
dc1394_external_trigger_get_source(dc1394camera_t *camera, dc1394trigger_source_t *source)
{
uint32_t value;
dc1394error_t err= dc1394_get_control_register(camera, REG_CAMERA_TRIGGER_MODE, &value);
DC1394_ERR_RTN(err, "Could not get trigger source");
*source= (uint32_t)( ((value >> 21) & 0x7UL) );
... | false | false | false | false | false | 0 |
destroy_PT_probeparts(PT_probeparts *obj){
if (obj->mh.parent) {
aisc_unlink((dllheader_ext*)obj);
if (aisc_server_error) return;
}
if(obj->mh.ident) free(obj->mh.ident);
if(obj->sequence) free(obj->sequence);
free((char *)obj);
} | false | false | false | false | false | 0 |
redraw(void)
{
if (mapped()==MSTrue)
{
drawBackground();
drawShadow();
drawText();
if (haveFocus()==MSTrue&&cursorOn()==MSTrue)
{ (editMode()==InsertMode)?drawInsertCursor():drawOverstrikeCursor(); }
}
} | false | false | false | false | false | 0 |
eel_canvas_item_realize (EelCanvasItem *item)
{
if (item->parent && !(item->parent->flags & EEL_CANVAS_ITEM_REALIZED))
(* EEL_CANVAS_ITEM_GET_CLASS (item->parent)->realize) (item->parent);
if (item->parent == NULL && !gtk_widget_get_realized (GTK_WIDGET (item->canvas)))
gtk_widget_realize (GTK_WIDGET (item->can... | false | false | false | false | false | 0 |
gameLoaded()
{
int i;
Game->initialiseRemovedTiles();
i = Game->TileNum;
// use the history of moves to put in the removed tiles area the correct tiles
while (i < Game->MaxTileNum) {
Game->setRemovedTilePair(Game->MoveListData(i), Game->MoveListData(i + 1));
i += 2;
}
popul... | false | false | false | false | false | 0 |
myqsort(realloc_t ** start, realloc_t ** end)
{
number_t med;
realloc_t **left = start, **right = end - 1;
while (1) {
/*Quite strange caluclation of median, but should be
*as good as Sedgewick middle of three method and is faster*/
med = ((*start)->price + (*(end - 1))->price) * 0.5;
/*Avoid one com... | false | false | false | false | false | 0 |
spanoq_to_s(Query *self, const char *field)
{
int i;
SpanOrQuery *soq = SpOQ(self);
char *res, *res_p;
char **q_strs = ALLOC_N(char *, soq->c_cnt);
int len = 50;
for (i = 0; i < soq->c_cnt; i++) {
Query *clause = soq->clauses[i];
q_strs[i] = clause->to_s(clause, field);
l... | false | false | false | false | false | 0 |
rspi_dma_transfer(struct rspi_data *rspi, struct sg_table *tx,
struct sg_table *rx)
{
struct dma_async_tx_descriptor *desc_tx = NULL, *desc_rx = NULL;
u8 irq_mask = 0;
unsigned int other_irq = 0;
dma_cookie_t cookie;
int ret;
/* First prepare and submit the DMA request(s), as this may fail */
if (rx) {
... | false | false | false | false | false | 0 |
style( KJS::ExecState *exec, KJS::JSObject *self, const KJS::List &args )
{
Q_UNUSED(args);
KJS::JSValue *result = KJS::jsNull();
KJSEmbed::VariantBinding *imp = KJSEmbed::extractBindingImp<KJSEmbed::VariantBinding>(exec, self);
if( !imp )
return KJS::throwError(exec, KJS::GeneralError, "N... | false | false | false | false | false | 0 |
updateGame(list<Position> &gamedata) {
list<Position>::iterator li;
Position startpos;
int hmn=-1;
moves.clear();
for(li=gamedata.begin();li!=gamedata.end();li++) {
Position p;
p = *li;
moves.push_back(p);
++hmn;
}
// should fix the adding of FEN fields on followed games
if (moves.emp... | false | false | false | false | false | 0 |
vim_strsave_escaped_ext(string, esc_chars, cc, bsl)
char_u *string;
char_u *esc_chars;
int cc;
int bsl;
{
char_u *p;
char_u *p2;
char_u *escaped_string;
unsigned length;
#ifdef FEAT_MBYTE
int l;
#endif
/*
* First count the number of backslashes required.
* Then allo... | false | false | false | false | false | 0 |
pdf_write_workbook (G_GNUC_UNUSED GOFileSaver const *fs,
G_GNUC_UNUSED GOIOContext *context,
WorkbookView const *wbv, GsfOutput *output)
{
Workbook const *wb = wb_view_get_workbook (wbv);
GPtrArray *sheets = g_object_get_data (G_OBJECT (wb), "pdf-sheets");
if (sheets) {
int i;
for (i = 0; i < workb... | false | false | false | false | false | 0 |
is_sorted(DArray *array)
{
int i = 0;
for(i = 0; i < DArray_count(array) - 1; i++) {
if(strcmp(DArray_get(array, i), DArray_get(array, i+1)) > 0) {
return 0;
}
}
return 1;
} | false | false | false | false | false | 0 |
status_get_atk_(struct block_list *bl)
{
struct map_session_data *sd = NULL;
nullpo_retr(0, bl);
if(bl->type == BL_PC && (sd = (struct map_session_data *)bl)) {
int atk = sd->watk_;
#ifdef PRE_RENEWAL
if(sd->sc.data[SC_CURSE].timer != -1)
atk -= atk*25/100;
#endif
return atk;
}
return 0;
} | false | false | false | false | false | 0 |
resolution_compare (const void *a, const void *b)
{
struct PicassoResolution *ma = (struct PicassoResolution *)a;
struct PicassoResolution *mb = (struct PicassoResolution *)b;
if (ma->res.width < mb->res.width)
return -1;
if (ma->res.width > mb->res.width)
return 1;
if (ma->res.heigh... | false | false | false | false | false | 0 |
merge_lits(int c[], int n)
{
int i, j, m;
m = n;
for (i = 0; i < m-1; i++)
if (c[i] == c[i+1]) {
for (j = i+1; j < m-1; j++)
c[j] = c[j+1];
m--;
i--;
}
return(m);
} | false | false | false | false | false | 0 |
radial_center_set_cb (ggobid *gg, gint index,
gint state, GGobiData *d, PluginInstance *inst)
{
glayoutd *gl = glayoutFromInst (inst);
GtkWidget *entry;
if (gl == NULL || gl->window == NULL)
return;
entry = (GtkWidget *) g_object_get_data(G_OBJECT(gl->window),
"CENTERNODE");
if (entry == NULL)
... | false | false | false | false | false | 0 |
__eval_tran_bits(register struct net_t *np)
{
register int32 bi;
int32 base;
word32 nav, nbv;
struct traux_t *trap;
struct vbinfo_t *vbip;
struct chanrec_t *chanp;
/* SJM 04/11/01 - can't do incremental relaxation until wire init done */
if (__wire_init) return;
trap = np->ntraux;
/* SJM 04/23/01 - all chan... | false | false | false | false | false | 0 |
test_noStereo(const std::string &file)
{
OBMol mol;
OBConversion conv;
conv.SetInFormat("mol");
conv.SetOutFormat("can");
const std::string filename = OBTestUtil::GetFilename(file);
ifstream ifs(filename.c_str());
if (!ifs) {
cerr << "Could not open " << filename << endl;
return;
}
conv.Read... | false | false | false | false | false | 0 |
qr_fd_ctx_free (qr_fd_ctx_t *qr_fd_ctx)
{
GF_VALIDATE_OR_GOTO ("quick-read", qr_fd_ctx, out);
GF_ASSERT (list_empty (&qr_fd_ctx->waiting_ops));
GF_FREE (qr_fd_ctx->path);
GF_FREE (qr_fd_ctx);
out:
return;
} | false | false | false | false | false | 0 |
find (void *addr, void *&base_addr)
{
ACE_TRACE ("ACE_Based_Pointer_Repository::find");
ACE_GUARD_RETURN (ACE_SYNCH_MUTEX, mon, this->rep_->lock_, -1);
ACE_Based_Pointer_Repository_Rep::MAP_ENTRY *ce = 0;
for (ACE_Based_Pointer_Repository_Rep::MAP_ITERATOR iter (this->rep_->addr_map_);
iter.next (ce) !=... | false | false | false | false | false | 0 |
_realNarrow(const char* repoId)
{
ASSERT_OMNI_TRACEDMUTEX_HELD(*omni::internalLock, 0);
OMNIORB_ASSERT(repoId && *repoId);
// Attempt to narrow the reference using static type info.
void* target = _ptrToObjRef(repoId);
if( target ) {
omni::internalLock->lock();
omniLocalIdentity* lid = omniLocalIde... | false | false | false | false | false | 0 |
check_relay(struct wstate *ws, struct ieee80211_frame *wh,
unsigned char *body, int dlen)
{
// looks like it...
if ((wh->i_fc[1] & IEEE80211_FC1_DIR_FROMDS) &&
(memcmp(wh->i_addr3, ws->ws_mymac, 6) == 0) &&
(memcmp(wh->i_addr1, "\xff\xff\xff\xff\xff\xff", 6) == 0) &&
dlen == ws->ws_fs.fs_len) {
// ... | false | false | false | false | false | 0 |
check_subscript_direction_loops(Block *loop1, Block *loop2)
{
UDlist *use1 = make_uselist(loop1);
UDlist *def1 = make_deflist(loop1);
UDlist *use2 = make_uselist(loop2);
UDlist *def2 = make_deflist(loop2);
if ((use1 != NULL || def1 != NULL)
&& (use2 != NULL || def2 != NULL)) {
retur... | false | false | false | false | false | 0 |
evd_web_service_add_connection_with_request (EvdWebService *self,
EvdHttpConnection *conn,
EvdHttpRequest *request,
EvdService *return_to)
{
EvdService *old_service;
... | false | false | false | false | false | 0 |
ps_check(const char *name, // I - Name of file
uchar *header, // I - Header data
int) // I - Length of header data (unused)
{
const char *home; // Home directory
char preview[FL_PATH_MAX], // Preview filename
outname[FL_PATH_MAX], // Preview PS file
command[FL_PATH_MAX]; // Command
FILE *... | false | false | false | false | true | 1 |
_mesa_realloc(void *oldBuffer, size_t oldSize, size_t newSize)
{
const size_t copySize = (oldSize < newSize) ? oldSize : newSize;
void *newBuffer = malloc(newSize);
if (newBuffer && oldBuffer && copySize > 0)
memcpy(newBuffer, oldBuffer, copySize);
free(oldBuffer);
return newBuffer;
}
/*@} | false | true | false | false | false | 1 |
p_prevw_draw (GapMorphSubWin *swp)
{
/*if(gap_debug) printf("p_prevw_draw: START\n");*/
if(swp->pv_ptr == NULL)
{
return;
}
if(swp->pv_ptr->da_widget==NULL)
{
return;
}
/*if(gap_debug) printf("p_prevw_draw: gap_pview_repaint\n");*/
gap_pview_repaint(swp->pv_ptr);
p_draw_workpoints(swp);
... | false | false | false | false | false | 0 |
dbus_signature_validate_single (const char *signature,
DBusError *error)
{
DBusSignatureIter iter;
if (!dbus_signature_validate (signature, error))
return FALSE;
dbus_signature_iter_init (&iter, signature);
if (dbus_signature_iter_get_current_type (&iter) == DBUS_TYPE_INVALID)
goto lo... | false | false | false | false | false | 0 |
scsifront_disconnect(struct vscsifrnt_info *info)
{
struct xenbus_device *dev = info->dev;
struct Scsi_Host *host = info->host;
pr_debug("%s: %s disconnect\n", __func__, dev->nodename);
/*
* When this function is executed, all devices of
* Frontend have been deleted.
* Therefore, it need not block I/O befor... | false | false | false | false | false | 0 |
g_daemon_file_append_to_finish (GFile *file,
GAsyncResult *res,
GError **error)
{
GSimpleAsyncResult *simple = G_SIMPLE_ASYNC_RESULT (res);
GFileOutputStream *output_stream;
output_stream = g_sim... | false | false | false | false | false | 0 |
empathy_server_sasl_handler_get_password_async_cb (GObject *source,
GAsyncResult *result,
gpointer user_data)
{
EmpathyServerSASLHandlerPriv *priv;
const gchar *password;
GError *error = NULL;
priv = EMPATHY_SERVER_SASL_HANDLER (user_data)->priv;
password = empathy_keyring_get_account_password_finis... | false | false | false | false | false | 0 |
Fixnum_To_String (Object x, int radix) {
char buf[32];
register char *p;
register int n = FIXNUM(x), neg = 0;
if (n == 0)
return Make_String ("0", 1);
if (n < 0) {
neg++;
n = -n;
}
p = buf+31;
*p = '\0';
while (n > 0) {
*--p = '0' + n % radix;
... | false | false | false | false | false | 0 |
r100_get_accessible_vram(struct radeon_device *rdev)
{
u32 aper_size;
u8 byte;
aper_size = RREG32(RADEON_CONFIG_APER_SIZE);
/* Set HDP_APER_CNTL only on cards that are known not to be broken,
* that is has the 2nd generation multifunction PCI interface
*/
if (rdev->family == CHIP_RV280 ||
rdev->family >... | false | false | false | false | false | 0 |
cb_client_event(GtkWidget *widget, GdkEventClient *event, gpointer data)
{
static GdkAtom atom_gkrellm_read_theme = GDK_NONE;
if (!atom_gkrellm_read_theme)
atom_gkrellm_read_theme = gdk_atom_intern("_GKRELLM_READ_THEME",FALSE);
if (event->message_type == atom_gkrellm_read_theme)
gkrellm_read_theme_event(NULL... | false | false | false | false | false | 0 |
CanonicalPath(const wstring &path){
wstring ret=path;
unsigned int len=ret.length();
for (unsigned int i=0; i<len; i++)
if (ret[i]==BADSEPARATOR) ret[i]=SEPARATOR;
return ret;
} | false | false | false | false | false | 0 |
osd_req_read_sg(struct osd_request *or,
const struct osd_obj_id *obj, struct bio *bio,
const struct osd_sg_entry *sglist, unsigned numentries)
{
u64 len;
u64 off;
int ret;
if (numentries > 1) {
off = 0;
ret = _add_sg_continuation_descriptor(or, sglist, numentries,
&len);
if (ret)
return ret;... | false | false | false | false | false | 0 |
UTF8_to_UTF16Nat ( const UTF8Unit * utf8In, const size_t utf8Len,
UTF16Unit * utf16Out, const size_t utf16Len,
size_t * utf8Read, size_t * utf16Written )
{
const UTF8Unit * utf8Pos = utf8In;
UTF16Unit * utf16Pos = utf16Out;
size_t utf8Left = utf8Len;
... | false | false | false | false | false | 0 |
Cudd_ApaPowerOfTwo(
int digits,
DdApaNumber number,
int power)
{
int i;
int index;
for (i = 0; i < digits; i++)
number[i] = 0;
i = digits - 1 - power / DD_APA_BITS;
if (i < 0) return;
index = power & (DD_APA_BITS - 1);
number[i] = 1 << index;
} | false | false | false | false | false | 0 |
qof_session_add_close_hook (GFunc fn, gpointer data)
{
GHook *hook;
if (session_closed_hooks == NULL)
{
session_closed_hooks = malloc(sizeof(GHookList)); /* LEAKED */
g_hook_list_init (session_closed_hooks, sizeof(GHook));
}
hook = g_hook_alloc(session_closed_hooks);
if (!hook)... | false | false | false | false | false | 0 |
l2_feed_i_if_reest(struct FsmInst *fi, int event, void *arg)
{
struct PStack *st = fi->userdata;
struct sk_buff *skb = arg;
if (test_bit(FLG_LAPB, &st->l2.flag))
st->l1.bcs->tx_cnt += skb->len + l2headersize(&st->l2, 0);
if (!test_bit(FLG_L3_INIT, &st->l2.flag))
skb_queue_tail(&st->l2.i_queue, skb);
else
de... | false | false | false | false | false | 0 |
sh_eth_open(struct net_device *ndev)
{
int ret = 0;
struct sh_eth_private *mdp = netdev_priv(ndev);
pm_runtime_get_sync(&mdp->pdev->dev);
napi_enable(&mdp->napi);
ret = request_irq(ndev->irq, sh_eth_interrupt,
mdp->cd->irq_flags, ndev->name, ndev);
if (ret) {
netdev_err(ndev, "Can not assign IRQ number\... | false | false | false | false | false | 0 |
find_index_iter_i(VALUE i, VALUE memop, int argc, VALUE *argv)
{
VALUE *memo = (VALUE*)memop;
if (RTEST(enum_yield(argc, argv))) {
memo[0] = UINT2NUM(memo[1]);
rb_iter_break();
}
memo[1]++;
return Qnil;
} | false | false | false | false | false | 0 |
MemberItemWithdraw(uint8 TabId, uint32 LowGuid)
{
uint32 SlotsWithDrawRight = GetMemberSlotWithdrawRem(LowGuid, TabId);
if (SlotsWithDrawRight == 0)
return false;
if (SlotsWithDrawRight < WITHDRAW_SLOT_UNLIMITED)
{
MemberList::iterator itr = members.find(LowGuid);
if (itr == me... | false | false | false | false | false | 0 |
phar_open_parsed_phar(char *fname, int fname_len, char *alias, int alias_len, int is_data, int options, phar_archive_data** pphar, char **error TSRMLS_DC) /* {{{ */
{
phar_archive_data *phar;
#ifdef PHP_WIN32
char *unixfname;
#endif
if (error) {
*error = NULL;
}
#ifdef PHP_WIN32
unixfname = estrndup(fname, fnam... | false | false | false | false | false | 0 |
main(int argc, char** argv) {
char remotename[FILENAME_MAX];
s3_initialize(&argc, argv);
if(argc < 3) {
fprintf(stderr, "usage: s3rm <bucket> <filename>\n");
return -1;
}
sprintf(remotename, "/%s", string_basename(argv[2]));
s3_rm_file(remotename, argv[1], s3_userid(), s3_key());
return 0;
} | true | true | false | false | false | 1 |
file_object_preadv(const struct file_object * const fo,
iovec_t * const iov, const int iov_cnt, const filesize_t offset)
{
file_object_check(fo);
g_assert(iov);
g_assert(iov_cnt > 0);
if (!is_valid_fd(fo->fd))
return file_object_ebadf();
return compat_preadv(fo->fd, iov, MIN(iov_cnt, MAX_IOV_COUNT), offset);
... | false | false | false | false | false | 0 |
setSMSStore(std::string smsStore, int storeTypes, bool needResultCode)
throw(GsmException)
{
if (_capabilities._cpmsParamCount == -1)
{
// count the number of parameters for the CPMS AT sequences
_capabilities._cpmsParamCount = 1;
Parser p(_at->chat("+CPMS=?", "+CPMS:"));
p.parseStringList();
... | false | false | false | false | false | 0 |
file_list_populate_dir (GiggleFileList *list,
const gchar *directory,
const gchar *rel_path,
GtkTreeIter *parent_iter)
{
GDir *dir;
const gchar *name;
gchar *full_path, *path;
full_path = g_build_filename (directory, rel_path, NULL);
dir = g_dir_open (full_path,... | false | false | false | false | false | 0 |
s_hierarchy_traverse(TOPLEVEL * pr_current, OBJECT * o_current,
NETLIST * netlist)
{
char *attrib;
int page_control=-1;
PAGE *p_current;
PAGE *child_page;
int count = 0;
int pcount = 0;
int looking_inside = FALSE;
int loaded_flag = FALSE;
char *current_filename;
int graphi... | false | false | false | false | false | 0 |
makeEdge(const string & src, const string & dst)
{
format f = format("%1% -> %2% [color = %3%];\n")
% dotQuote(src) % dotQuote(dst) % dotQuote(nextColour());
return f.str();
} | false | false | false | false | false | 0 |
execute_action(pdf_document *doc, pdf_obj *obj, pdf_obj *a)
{
fz_context *ctx = doc->ctx;
if (a)
{
char *type = pdf_to_name(pdf_dict_gets(a, "S"));
if (!strcmp(type, "JavaScript"))
{
pdf_obj *js = pdf_dict_gets(a, "JS");
if (js)
{
char *code = pdf_to_utf8(doc, js);
fz_try(ctx)
{
pdf_... | false | false | false | false | false | 0 |
Access_mmap_offset (int *remainder, int fd, off_t offset, size_t length, size_t eltsize, bool randomp) {
#ifdef HAVE_CADDR_T
caddr_t memory;
#else
void *memory;
#endif
if (length == 0) {
abort();
}
*remainder = offset % get_pagesize();
offset -= (off_t) *remainder;
length += (size_t) *remainder;
... | false | false | false | false | false | 0 |
insert_member_decl_and_init (IAnjutaEditor* editor, gchar* widget_name,
gchar* ui_filename, CppJavaPlugin* lang_plugin)
{
AnjutaStatus* status;
gchar* member_decl = generate_widget_member_decl_str(widget_name);
gchar* member_init = generate_widget_member_ini... | false | false | false | false | false | 0 |
set_mcl_conf(GIOChannel *chan, struct mcap_mcl *mcl)
{
gboolean reconn;
mcl->state = MCL_CONNECTED;
mcl->role = MCL_ACCEPTOR;
mcl->req = MCL_AVAILABLE;
mcl->cc = g_io_channel_ref(chan);
mcl->ctrl |= MCAP_CTRL_STD_OP;
mcap_sync_init(mcl);
reconn = (mcl->ctrl & MCAP_CTRL_CACHED);
if (reconn)
mcap_uncache_mc... | false | false | false | false | false | 0 |
tgdb_list_insert_after(struct tgdb_list *tlist,
tgdb_list_iterator * i, void *item)
{
struct tgdb_list_node *node;
if (!tlist)
return -1;
if ((node = tgdb_list_new_node()) == NULL)
return -1;
node->data = item;
tgdb_list_insert(tlist, i, i->next, node);
return 0;
} | false | false | false | false | false | 0 |
SWIG_Tcl_Disown(void *ptr) {
Tcl_HashEntry *entryPtr = Tcl_FindHashEntry(SWIG_Tcl_ObjectTable(), (char *) ptr);
if (entryPtr) {
Tcl_DeleteHashEntry(entryPtr);
return 1;
}
return 0;
} | false | false | false | false | false | 0 |
connection_expire_held_open(void)
{
time_t now;
smartlist_t *conns = get_connection_array();
now = time(NULL);
SMARTLIST_FOREACH(conns, connection_t *, conn,
{
/* If we've been holding the connection open, but we haven't written
* for 15 seconds...
*/
if (conn->hold_open_until_flushed) {
... | false | false | false | false | false | 0 |
add_queryseq_offset (List_T path, int queryseq_offset
#ifdef WASTE
, Pairpool_T pairpool
#endif
) {
List_T pairs = NULL, pairptr;
Pair_T pair;
while (path != NULL) {
pairptr = path;
path = Pairpool_pop(path,&pair);
/* Previously excluded cases where pair->gapp was true, but this failed ... | false | false | false | false | false | 0 |
RemoveSpaces()
{
char *tempString;
int i, length;
this->FunctionLength = 0;
length = static_cast<int>(strlen(this->Function));
tempString = new char[length+1];
for (i = 0; i < length; i++)
{
if (!isspace(this->Function[i]))
{
tempString[this->FunctionLength] = this->Function[i];
... | false | false | false | false | false | 0 |
babl_conversion_cost (BablConversion *conversion)
{
if (!conversion)
return 100000000L;
if (conversion->error == -1.0)
babl_conversion_error (conversion);
return conversion->cost;
} | false | false | false | false | false | 0 |
netdev_set_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
{
struct netdev_private *np = netdev_priv(dev);
if (ecmd->port != PORT_TP && ecmd->port != PORT_MII && ecmd->port != PORT_FIBRE)
return -EINVAL;
if (ecmd->transceiver != XCVR_INTERNAL && ecmd->transceiver != XCVR_EXTERNAL)
return -EINVAL;
if (ec... | false | false | false | false | false | 0 |
fuse_getlk_resume (fuse_state_t *state)
{
gf_log ("glusterfs-fuse", GF_LOG_TRACE,
"%"PRIu64": GETLK %p", state->finh->unique, state->fd);
FUSE_FOP (state, fuse_getlk_cbk, GF_FOP_LK,
lk, state->fd, F_GETLK, &state->lk_lock, state->xdata);
} | false | false | false | false | false | 0 |
gst_camerabin_start_video_recording (GstCameraBin * camera)
{
GstStateChangeReturn state_ret;
GstCameraBinVideo *vidbin = (GstCameraBinVideo *) camera->vidbin;
/* FIXME: how to ensure resolution and fps is supported by CPU?
* use a queue overrun signal?
*/
GST_INFO_OBJECT (camera, "starting video capture"... | false | false | false | false | false | 0 |
gda_sql_select_target_take_select (GdaSqlSelectTarget *target, GdaSqlStatement *stmt)
{
if (stmt) {
target->expr = gda_sql_expr_new (GDA_SQL_ANY_PART (target));
gda_sql_expr_take_select (target->expr, stmt);
}
} | false | false | false | false | false | 0 |
driver_wrong_lang_callback (const struct cl_decoded_option *decoded,
unsigned int lang_mask ATTRIBUTE_UNUSED)
{
/* At this point, non-driver options are accepted (and expected to
be passed down by specs) unless marked to be rejected by the
driver. Options to be rejected by the driver but accepted by... | false | false | false | false | false | 0 |
strToAfp(const std::string& s) {
return s=="On"?AFP_ON:s=="Off"?AFP_OFF:s=="On2Off"?AFP_ON2OFF:s=="Off2On"?AFP_OFF2ON:AFP_OTHER;
} | false | false | false | false | false | 0 |
ei_hash_resize(ei_hash *oldtab, int newsize)
{
ei_hash *newtab=NULL;
ei_bucket *b, *next;
int i,h;
/* make sure size is odd, then increase until prime */
newsize |= 0x1;
while (!ei_isprime(newsize)) newsize +=2;
if (newsize == oldtab->size) return oldtab;
/* make a new table */
if (!(newtab = ei... | false | false | false | false | false | 0 |
g4x_set_infoframes(struct drm_encoder *encoder,
bool enable,
const struct drm_display_mode *adjusted_mode)
{
struct drm_i915_private *dev_priv = encoder->dev->dev_private;
struct intel_digital_port *intel_dig_port = enc_to_dig_port(encoder);
struct intel_hdmi *intel_hdmi = &intel_dig_port->hdmi;
... | false | false | false | false | false | 0 |
attach() {
if (!omniIOR::lock) omniIOR::lock = new omni_tracedmutex;
} | false | false | false | false | false | 0 |
parseToken(const char* cp, fxStr& v)
{
while (isspace(*cp))
cp++;
const char* tp;
if (*cp == '"') { // "..."
tp = ++cp;
for (;;) {
if (*cp == '\0') {
parseError(NLS::TEXT("String with unmatched '\"'"));
return (NULL);
}
if (*cp == '\\' && cp[1] == '\0') {
parseError(NLS::TEXT("Bad ... | false | false | false | false | false | 0 |
snd_ac97_resume(struct snd_ac97 *ac97)
{
unsigned long end_time;
if (! ac97)
return;
if (ac97->bus->ops->reset) {
ac97->bus->ops->reset(ac97);
goto __reset_ready;
}
snd_ac97_write(ac97, AC97_POWERDOWN, 0);
if (! (ac97->flags & AC97_DEFAULT_POWER_OFF)) {
if (!(ac97->scaps & AC97_SCAP_SKIP_AUDIO))
sn... | false | false | false | false | false | 0 |
icon_list_append_children(icon_list_t *icons, icodir_t *dir)
{
struct dirent **namelist;
char dirname[FILENAME_MAX];
int n;
icodir_t *childdir;
g_assert(icons != NULL && dir != NULL);
g_assert(dir->recursive == TRUE);
TRACE("'%s'", dir->path);
splash_update(icons->iconsel->... | false | false | false | false | false | 0 |
GridNormalsCompositeField(CompositeField o, int dep)
{
int i;
Object c;
i = 0;
while(NULL != (c = DXGetEnumeratedMember((Group)o, i++, NULL)))
if (! GridNormalsField((Field)c, dep))
return NULL;
return o;
} | false | false | false | false | false | 0 |
kill_proc_tree(pid_t top, int sig)
{
xpid_t *list;
int rc = -1;
xppid_t **hashtbl;
if ((hashtbl = _build_hashtbl()) == NULL)
return -1;
list = _get_list(top, NULL, hashtbl);
rc = _kill_proclist(list, sig);
_destroy_hashtbl(hashtbl);
_destroy_list(list);
return rc;
} | false | false | false | false | false | 0 |
gnc_table_get_virtual_cell (Table *table, VirtualCellLocation vcell_loc)
{
if (table == NULL)
return NULL;
return g_table_index (table->virt_cells,
vcell_loc.virt_row, vcell_loc.virt_col);
} | false | false | false | false | false | 0 |
countDigs(char *p)
{
int length =0;
while (*(p+length)!='\0') length++; // Count total length
while (length>0 && *(p+length-1)=='0') length--; // Scan backwards for a non-'0'
return length;
} | false | false | false | false | false | 0 |
ast_setup_cc_recall_datastore(struct ast_channel *chan, const int core_id)
{
struct ast_datastore *recall_datastore = ast_datastore_alloc(&recall_ds_info, NULL);
struct cc_recall_ds_data *recall_data;
struct cc_core_instance *core_instance;
if (!recall_datastore) {
return -1;
}
if (!(recall_data = ast_calloc(... | false | false | false | false | false | 0 |
argsToCBuffer(OutBuffer *buf, HdrGenState *hgs, Parameters *arguments, int varargs)
{
buf->writeByte('(');
if (arguments)
{
OutBuffer argbuf;
argbuf.reserve(32);
size_t dim = Parameter::dim(arguments);
for (size_t i = 0; i < dim; i++)
{
if (i)
... | false | false | false | true | false | 1 |
mvumi_check_ib_list_9580(struct mvumi_hba *mhba)
{
unsigned int count;
if (atomic_read(&mhba->fw_outstanding) >= (mhba->max_io - 1))
return 0;
count = ioread32(mhba->ib_shadow);
if (count == 0xffff)
return 0;
return count;
} | false | false | false | false | false | 0 |
SUBCONTAINER_FIND(netsnmp_container *x,
const char* name)
{
if ((NULL == x) || (NULL == name))
return NULL;
/** start at first container */
while(x->prev)
x = x->prev;
while(x) {
if ((NULL != x->container_name) && (0 == strcmp(name,x->con... | false | false | false | false | false | 0 |
ql_napi_poll_msix(struct napi_struct *napi, int budget)
{
struct rx_ring *rx_ring = container_of(napi, struct rx_ring, napi);
struct ql_adapter *qdev = rx_ring->qdev;
struct rx_ring *trx_ring;
int i, work_done = 0;
struct intr_context *ctx = &qdev->intr_context[rx_ring->cq_id];
netif_printk(qdev, rx_status, KERN... | false | false | false | false | false | 0 |
test_diff_binary__delta(void)
{
git_index *index;
git_buf contents = GIT_BUF_INIT;
size_t i;
git_diff_options opts = GIT_DIFF_OPTIONS_INIT;
const char *expected =
"diff --git a/songof7cities.txt b/songof7cities.txt\n" \
"index 4210ffd5c390b21dd5483375e75288dea9ede512..cc84ec183351c9944ed90a619ca08911924055b5 1... | false | false | false | false | false | 0 |
md5_crypt_verify(const Port *port, const char *role, char *client_pass)
{
char *shadow_pass = NULL,
*valuntil = NULL,
*crypt_pwd;
int retval = STATUS_ERROR;
List **line;
ListCell *token;
char *crypt_client_pass = client_pass;
if ((line = get_role_line(role)) == NULL)
return STATUS_ERROR... | false | false | false | false | false | 0 |
init_reload(void)
{
for (int i=0; i < max_reloads; i++) {
reload_table[i].job_count = 0;
reload_table[i].res_table = NULL;
}
} | false | false | false | false | false | 0 |
RemapPNamesBasedOnProjCSAndPName( OGRSpatialReference* pOgr, const char* pszProgCSName,
char **mappingTable )
{
long ret = 0;
OGR_SRSNode *poPROJCS = pOgr->GetAttrNode( "PROJCS" );
for( int i = 0; mappingTable[i] != NULL; i += 3 )
{
while... | false | false | false | false | false | 0 |
elementNumberAfter(const NodePtr &node, const StringC &gi,
const StringC &resetGi)
{
NodePtr start;
NodePtr lastMatch;
unsigned long resetCount = 0;
unsigned long count = 0;
ElementEntry *entry = elementNumbers_.lookup(resetGi);
if (entry) {
unsigned long nodeIndex, entryIndex;
bool useSu... | false | false | false | false | false | 0 |
generate_idlist_primitive(ast_idlist* idList) {
int length = idList->get_length();
for (int i = 0; i < length; i++) {
ast_id* id = idList->get_item(i);
generate_lhs_id(id);
generate_lhs_default(id->getTypeSummary());
if (i < length - 1) Body.push_spc(',');
}
} | false | false | false | false | false | 0 |
fm10k_ptp_gettime(struct ptp_clock_info *ptp, struct timespec64 *ts)
{
struct fm10k_intfc *interface;
unsigned long flags;
u64 now;
interface = container_of(ptp, struct fm10k_intfc, ptp_caps);
read_lock_irqsave(&interface->systime_lock, flags);
now = fm10k_systime_read(interface) + interface->ptp_adjust;
read_... | false | false | false | false | false | 0 |
GWEN_InheritData_free(GWEN_INHERITDATA *d) {
if (d) {
if (d->freeDataFn)
d->freeDataFn(d->baseData, d->data);
free(d->typeName);
GWEN_LIST_FINI(GWEN_INHERITDATA, d);
GWEN_FREE_OBJECT(d);
}
} | false | false | false | false | false | 0 |
qcode_vm_std( QCodeVM* vm, unsigned char op1, long op2 ){
// Controlo si el puntero es bueno ...
if( op2 >= vm->data_size ){ return QCODE_RUNOUTOFM; }
// Controlo si es temporal 1
if( op1 >= 16 ){
if( op1 - 16 >= vm->stackt_count ){ AJUSTA_T( op1 - 16 ); }
vm->r[0] = ((long*)((char*)vm... | false | false | false | false | false | 0 |
nautilus_file_get_start_stop_type (NautilusFile *file)
{
GDriveStartStopType ret;
GDrive *drive;
g_return_val_if_fail (NAUTILUS_IS_FILE (file), FALSE);
ret = file->details->start_stop_type;
if (ret != G_DRIVE_START_STOP_TYPE_UNKNOWN)
goto out;
if (file->details->mount != NULL) {
drive = g_mount_get_drive (... | false | false | false | false | false | 0 |
pkix_pl_CrlDp_Destroy(
PKIX_PL_Object *object,
void *plContext)
{
pkix_pl_CrlDp *crldp = NULL;
PKIX_ENTER(CRLCHECKER, "pkix_CrlDp_Destroy");
PKIX_NULLCHECK_ONE(object);
/* Check that this object is a default CRL checker state */
PKIX_CHECK(
pkix_CheckType(object, PK... | false | false | false | false | false | 0 |
get_mtime_of_source(ZipImporter *self, PyObject *path)
{
PyObject *toc_entry, *stripped;
time_t mtime;
/* strip 'c' or 'o' from *.py[co] */
if (PyUnicode_READY(path) == -1)
return (time_t)-1;
stripped = PyUnicode_FromKindAndData(PyUnicode_KIND(path),
... | false | false | false | false | false | 0 |
H5S_hyper_rebuild_helper(const H5S_hyper_span_t *span, H5S_hyper_dim_t span_slab_info[],
unsigned rank)
{
hsize_t curr_stride, next_stride;
hsize_t curr_block, next_block;
hsize_t curr_start;
hsize_t curr_low;
size_t outcount;
unsigned u;
H5S_hyper_dim_t canon_down_span_slab_info[H5... | false | false | false | false | false | 0 |
enable_return(DBusMessageIter *iter, const char *error,
void *user_data)
{
char *tech = user_data;
char *str;
str = strrchr(tech, '/');
if (str != NULL)
str++;
else
str = tech;
if (error == NULL) {
fprintf(stdout, "Enabled %s\n", str);
} else
fprintf(stderr, "Error %s: %s\n", str, error);
g_free(us... | 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.