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 |
|---|---|---|---|---|---|---|
test_revert_workdir__merge_fails_without_mainline_specified(void)
{
git_commit *head;
git_oid head_oid;
git_oid_fromstr(&head_oid, "5acdc74af27172ec491d213ee36cea7eb9ef2579");
cl_git_pass(git_commit_lookup(&head, repo, &head_oid));
cl_git_pass(git_reset(repo, (git_object *)head, GIT_RESET_HARD, NULL, NULL, NULL))... | false | false | false | false | false | 0 |
_ecore_getopt_help_line(FILE *fp,
const int base,
const int total,
int used,
const char *text,
int len)
{
int linebreak = 0;
do
{
/* process line consideri... | false | false | false | false | false | 0 |
xgbe_read_mmc_stats(struct xgbe_prv_data *pdata)
{
struct xgbe_mmc_stats *stats = &pdata->mmc_stats;
/* Freeze counters */
XGMAC_IOWRITE_BITS(pdata, MMC_CR, MCF, 1);
stats->txoctetcount_gb +=
xgbe_mmc_read(pdata, MMC_TXOCTETCOUNT_GB_LO);
stats->txframecount_gb +=
xgbe_mmc_read(pdata, MMC_TXFRAMECOUNT_GB_LO)... | false | false | false | false | false | 0 |
realloc(size_t l_size)
{
register ssize_t l_free = m_capacity - m_size - (m_begin - m_buff);
register bool islinked = IsLinked();
if ( ((ssize_t)l_size <= l_free) && (NULL != m_buff) && !islinked )
{
return m_capacity;
}
if ( l_size <= m_capacity && (NULL != m_buff) && !islinked )
{
register char* l... | false | false | false | false | false | 0 |
ssd_lm80_enable_in(struct ssd_device *dev, uint8_t saddr, int idx)
{
uint8_t val = 0;
int ret = 0;
if (idx >= SSD_LM80_IN_NR || idx < 0) {
return -EINVAL;
}
ret = ssd_smbus_read_byte(dev, saddr, SSD_LM80_REG_MASK1, &val);
if (ret) {
goto out;
}
val &= ~(1UL << (uint32_t)idx);
ret = ssd_smbus_write_byte... | false | false | false | false | false | 0 |
decode_mknod(struct tcb *tcp, int offset)
{
int mode = tcp->u_arg[offset + 1];
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[offset]);
tprintf(", %s", sprintmode(mode));
switch (mode & S_IFMT) {
case S_IFCHR: case S_IFBLK:
#ifdef LINUXSPARC
if (current_personality == 1)
tprintf(", makedev(%lu, %lu)",
... | false | false | false | false | false | 0 |
check_funcs(int file, int size, int pec)
{
unsigned long funcs;
/* check adapter functionality */
if (ioctl(file, I2C_FUNCS, &funcs) < 0) {
fprintf(stderr, "Error: Could not get the adapter "
"functionality matrix: %s\n", strerror(errno));
return -1;
}
switch (size) {
case I2C_SMBUS_BYTE:
if (!(funcs &... | false | false | false | false | false | 0 |
zmod_poly_mul_trunc_n_precomp_init(zmod_poly_precomp_t pre, zmod_poly_p input2, unsigned long bits_input, unsigned long trunc)
{
unsigned long length2 = FLINT_MIN(input2->length, trunc);
while ((length2) && (input2->coeffs[length2-1] == 0)) length2--;
pre->length2 = length2;
if ((length2 == 0) || (trunc ==... | false | false | false | false | false | 0 |
setCurrentOption ( int value , bool printIt)
{
if (printIt && value != currentKeyWord_)
std::cout << "Option for " << name_ << " changed from "
<< definedKeyWords_[currentKeyWord_] << " to "
<< definedKeyWords_[value] << std::endl;
currentKeyWord_ = value;
} | false | false | false | false | false | 0 |
emitComment(Scope *sc)
{
//printf("AggregateDeclaration::emitComment() '%s'\n", toChars());
if (prot() == PROTprivate)
return;
if (!comment)
return;
OutBuffer *buf = sc->docbuf;
DocComment *dc = DocComment::parse(sc, this, comment);
if (!dc)
{
emitDitto(sc);
... | false | false | false | false | false | 0 |
update_read_multi_draw_nine_grid_order(STREAM* s, ORDER_INFO* orderInfo, MULTI_DRAW_NINE_GRID_ORDER* multi_draw_nine_grid)
{
if (orderInfo->fieldFlags & ORDER_FIELD_01)
update_read_coord(s, &multi_draw_nine_grid->srcLeft, orderInfo->deltaCoordinates);
if (orderInfo->fieldFlags & ORDER_FIELD_02)
update_read_coord... | false | false | false | false | false | 0 |
setup_reference(const char *repo)
{
const char *ref_git;
char *ref_git_copy;
struct remote *remote;
struct transport *transport;
const struct ref *extra;
ref_git = make_absolute_path(option_reference);
if (is_directory(mkpath("%s/.git/objects", ref_git)))
ref_git = mkpath("%s/.git", ref_git);
else if (!is_... | false | false | false | false | false | 0 |
gst_caps_setter_class_init (GstCapsSetterClass * g_class)
{
GObjectClass *gobject_class = (GObjectClass *) g_class;
GstBaseTransformClass *trans_class = (GstBaseTransformClass *) g_class;
GST_DEBUG_CATEGORY_INIT (caps_setter_debug, "capssetter", 0, "capssetter");
gobject_class->set_property = gst_caps_setter_... | false | false | false | false | false | 0 |
x264_mb_mc_0xywh( x264_t *h, int x, int y, int width, int height )
{
int i8 = x264_scan8[0]+x+8*y;
int i_ref = h->mb.cache.ref[0][i8];
int mvx = x264_clip3( h->mb.cache.mv[0][i8][0], h->mb.mv_min[0], h->mb.mv_max[0] ) + 4*4*x;
int mvy = x264_clip3( h->mb.cache.mv[0][i8][1], h->mb.mv_min[1], h->mb... | false | false | false | false | false | 0 |
get_unsigned_config_value(struct collection_item *item,
int strict,
unsigned def,
int *error)
{
unsigned long long val = 0;
int err = 0;
TRACE_FLOW_STRING("get_unsigned_config_value", "Entry");
val... | false | false | false | false | false | 0 |
handle_connections(UDSocket &pipe)
{
ConnectionHandler h; // the class that handles the connections
String ip;
bool toldparentready = false;
int cycle = o.maxage_children;
int stat = 0;
reloadconfig = false;
// stay alive both for the maximum allowed age of child processes, and whilst we aren't supposed to be ... | false | false | false | false | false | 0 |
CERT_GetSSLCACerts(CERTCertDBHandle *handle)
{
PLArenaPool *arena;
CERTDistNames *names;
int i;
SECStatus rv;
dnameNode *node;
/* allocate an arena to use */
arena = PORT_NewArena(DER_DEFAULT_CHUNKSIZE);
if ( arena == NULL ) {
PORT_SetError(SEC_ERROR_NO_MEMORY);
return(NULL);
... | false | false | false | false | false | 0 |
git_path_check_merge(const char *path, struct git_attr_check check[2])
{
if (!check[0].attr) {
check[0].attr = git_attr("merge");
check[1].attr = git_attr("conflict-marker-size");
}
return git_checkattr(path, 2, check);
} | true | true | false | false | false | 1 |
us_buffer_read_string( us_buffer_t *self, char *value_ptr, size_t result_max_len )
{
bool r = false;
size_t cur_length = us_buffer_readable_count( self );
if ( cur_length > 1 )
{
size_t i;
size_t l = 0;
if ( cur_length > result_max_len - 1 )
{
cur_length = res... | false | false | false | false | false | 0 |
digestmap_get(const digestmap_t *map, const char *key)
{
digestmap_entry_t *resolve;
digestmap_entry_t search;
tor_assert(map);
tor_assert(key);
memcpy(&search.key, key, DIGEST_LEN);
resolve = HT_FIND(digestmap_impl, &map->head, &search);
if (resolve) {
return resolve->val;
} else {
return NULL;... | false | true | false | false | false | 1 |
gobble(filep, file, file_red)
register struct filepointer *filep;
struct inclist *file, *file_red;
{
register char *line;
register int type;
while ((line = sge_getline(filep))) {
switch(type = deftype(line, filep, file_red, file, FALSE)) {
case IF:
case IFFALSE:
case IFG... | false | false | false | false | false | 0 |
ext4_init_block_bitmap(struct super_block *sb,
struct buffer_head *bh,
ext4_group_t block_group,
struct ext4_group_desc *gdp)
{
unsigned int bit, bit_max;
struct ext4_sb_info *sbi = EXT4_SB(sb);
ext4_fsblk_t start, tmp;
int flex_bg = 0;
struct ext4_group_info *grp;
J_ASSERT_BH(bh, buffer_loc... | false | false | false | false | false | 0 |
xtrace_print_case_command_head (case_command)
CASE_COM *case_command;
{
CHECK_XTRACE_FP;
fprintf (xtrace_fp, "%s", indirection_level_string ());
fprintf (xtrace_fp, "case %s in\n", case_command->word->word);
} | false | false | false | false | false | 0 |
emit_export(Node *n, String *name) {
if (GetInt(n, "feature:export"))
Printf(f_cl, "\n(cl:export '%s)\n", name);
} | false | false | false | false | false | 0 |
rtl92ee_is_tx_desc_closed(struct ieee80211_hw *hw, u8 hw_queue, u16 index)
{
struct rtl_pci *rtlpci = rtl_pcidev(rtl_pcipriv(hw));
struct rtl_priv *rtlpriv = rtl_priv(hw);
u16 read_point, write_point, available_desc_num;
bool ret = false;
static u8 stop_report_cnt;
struct rtl8192_tx_ring *ring = &rtlpci->tx_ring[... | false | false | false | false | false | 0 |
rb_ary_each(VALUE array)
{
long i;
volatile VALUE ary = array;
RETURN_ENUMERATOR(ary, 0, 0);
for (i=0; i<RARRAY_LEN(ary); i++) {
rb_yield(RARRAY_PTR(ary)[i]);
}
return ary;
} | false | false | false | false | false | 0 |
explain_buffer_cdrom_msf(explain_string_buffer_t *sb,
const struct cdrom_msf *data)
{
if (explain_is_efault_pointer(data, sizeof(*data)))
{
explain_buffer_pointer(sb, data);
return;
}
explain_string_buffer_puts(sb, "{ cdmsf_min0 = ");
explain_buffer_int(sb, data->cdmsf_min0);
... | false | false | false | false | false | 0 |
min_and_over(K x,K y)
{
I accI=1; F accF=FI;
if((!yt&&yn) || ABS(yt) > 2 || (x && xt!=1 && xt!=2)) R 0;
K z,r;
SW(ABS(yt)) //May want to consider casting y->t==1 to F's when x && x->t is F
{
CS(2,if(yn)accF=*kF(y);DO(y->n-1, accF=MIN(accF,kF(y)[i+1])) z=Kf(accF)) //CS order matters for empty list ()
... | false | false | false | false | true | 1 |
post_create_cb (SheetControlGUI *scg)
{
Sheet *sheet = sc_sheet (SHEET_CONTROL (scg));
if (sheet->sheet_objects)
scg_object_select (scg, (SheetObject *) sheet->sheet_objects->data);
return FALSE;
} | false | false | false | false | false | 0 |
gst_multi_handle_sink_setup_dscp_client (GstMultiHandleSink * sink,
GstMultiHandleClient * client)
{
#if !defined(IP_TOS) || !defined(HAVE_SYS_SOCKET_H)
return 0;
#else
gint tos;
gint ret;
int fd;
union gst_sockaddr
{
struct sockaddr sa;
struct sockaddr_in6 sa_in6;
struct sockaddr_storage sa... | false | false | false | false | false | 0 |
ListMagicInfo(FILE *file,ExceptionInfo *exception)
{
register unsigned int
i,
j;
ARG_NOT_USED(exception);
if (file == (const FILE *) NULL)
file=stdout;
(void) fprintf(file,"Name Offset Target\n");
(void) fprintf(file,"-------------------------------------------------"
"-----------------... | false | false | false | false | false | 0 |
GTextFieldImport(GTextField *gt) {
unichar_t *ret;
char *cret;
unichar_t *str;
if ( _ggadget_use_gettext ) {
char *temp = GWidgetOpenFile8(_("Open"),NULL,"*.txt",NULL,NULL);
ret = utf82u_copy(temp);
free(temp);
} else {
ret = GWidgetOpenFile(GStringGetResource(_STR_Open,NULL),NULL,
txt,NULL,N... | false | false | false | false | false | 0 |
gwy_container_values_equal(GValue *value1,
GValue *value2)
{
GType type;
g_return_val_if_fail(value1 || value2, TRUE);
if (!value1 || !value2)
return FALSE;
type = G_VALUE_TYPE(value1);
if (type != G_VALUE_TYPE(value2))
return FALSE;
switch (type) {
... | false | false | false | false | false | 0 |
cmds_quit(CONTEXT *ctx, char *arg)
{
if (ctx == NULL) /* Basic sanity check */
misc_die(FL, "cmds_quit: ?ctx?");
arg = arg; /* Calm down picky compilers */
/*
** Close all dependent connections
*/
if (ctx->srv_data != NULL) {
socket_kill(ctx->srv_data);
ctx->srv_data = NULL;
}
if (ctx->cli_data != NULL... | false | false | false | false | false | 0 |
canonicalize_for_substitution (tree node)
{
/* For a TYPE_DECL, use the type instead. */
if (TREE_CODE (node) == TYPE_DECL)
node = TREE_TYPE (node);
if (TYPE_P (node))
node = canonical_type_variant (node);
return node;
} | false | false | false | false | false | 0 |
object_to_str(JNIEnv* env, jobject obj, char* buf, size_t max_len) {
if (obj == NULL) {
snprintf(buf, max_len, "%s", "null");
} else {
lList *alpp;
jclass clazz;
jstring classname_obj;
const char* classname = NULL;
jmethodID mid;
jstring obj_str_obj;
cons... | false | false | false | false | false | 0 |
m_cdfg_get_static_expr (pIIR_RecordReference ror, string &str, RegionStack &rstack, IR_StaticLevel slevel,
id_type t = id_type(), bool start = false)
{
if (start) {
string result = "(create-record-element-reference ";
// if start is true then calculate the prefix
if (cdfg_get_static_expr(ror->record... | false | false | false | false | false | 0 |
SlotDirectAccessPCommand(
void *theEnv)
{
DEFCLASS *theDefclass;
SLOT_DESC *sd;
sd = CheckSlotExists(theEnv,"slot-direct-accessp",&theDefclass,TRUE,TRUE);
if (sd == NULL)
return(FALSE);
return((sd->publicVisibility || (sd->cls == theDefclass)) ? TRUE : FALSE);
} | false | false | false | false | false | 0 |
DBtype(dbfile)
FILE **dbfile ;
{
char *first_entry, *tmp_ptr ;
char rc = '\0' ;
int entrysize ;
int entrylen = 0 ;
Boolean check = FALSE ;
entrysize = ENTRYSIZE ;
first_entry = (char *) malloc(entrysize*sizeof(char)) ;
/* read first line to determine if file has ProDom mul... | false | false | false | false | false | 0 |
avl_getfirst( Avlnode *root )
{
if ( avl_list ) {
free( (char *) avl_list);
avl_list = (caddr_t *) 0;
}
avl_maxlist = 0;
avl_nextlist = 0;
if ( root == 0 )
return( 0 );
(void) avl_apply( root, avl_buildlist, (caddr_t) 0, -1, AVL_INORDER );
if(avl_list && avl_list[avl_nextlist++]){
return avl_list[avl_n... | false | false | false | false | false | 0 |
free_space(struct gl_context *ctx)
{
TNLcontext *tnl = TNL_CONTEXT(ctx);
GLuint i;
for (i = 0; i < tnl->nr_blocks; i++)
free(tnl->block[i]);
tnl->nr_blocks = 0;
} | false | false | false | false | false | 0 |
info_callback(const SSL *ssl, int where, int ret) {
if(where & SSL_CB_LOOP)
s_log(LOG_DEBUG, "SSL state (%s): %s",
where & SSL_ST_CONNECT ? "connect" :
where & SSL_ST_ACCEPT ? "accept" :
"undefined", SSL_state_string_long(ssl));
else if(where & SSL_CB_ALERT)
s_log(LOG_DEB... | false | false | false | false | false | 0 |
benchmark_loop(unsigned hash_id, const unsigned char* message, size_t msg_size, int count, unsigned char* out)
{
int i;
struct rhash_context *context = rhash_init(hash_id);
if (!context) return 0;
/* process the repeated message buffer */
for (i = 0; i < count && !rhash_data.interrupted; i++) {
rhash_update(con... | false | false | false | false | false | 0 |
chm_config_set_hashfuncs(cmph_config_t *mph, CMPH_HASH *hashfuncs)
{
chm_config_data_t *chm = (chm_config_data_t *)mph->data;
CMPH_HASH *hashptr = hashfuncs;
cmph_uint32 i = 0;
while(*hashptr != CMPH_HASH_COUNT)
{
if (i >= 2) break; //chm only uses two hash functions
chm->hashfuncs[i] = *hashptr;
++i, ++has... | false | false | false | false | false | 0 |
wm8350_rtc_readtime(struct device *dev, struct rtc_time *tm)
{
struct wm8350 *wm8350 = dev_get_drvdata(dev);
u16 time1[4], time2[4];
int retries = WM8350_GET_TIME_RETRIES, ret;
/*
* Read the time twice and compare.
* If time1 == time2, then time is valid else retry.
*/
do {
ret = wm8350_block_read(wm8350,... | false | false | false | false | false | 0 |
LI10(V68,V69)
object V68;object V69;
{ VMB10 VMS10 VMV10
bds_check;
goto TTL;
TTL:;
bds_bind(((object)VV[10]),((object)VV[22]));
V70= (*(LnkLI50))((V69));
bds_unwind1;
princ_str("\n unwind(frs_sch(",((object)VV[12]));
if((STREF(object,(V68),24))==Cnil){
goto T160;}
(void)((*(LnkLI42))(STREF(object,(V68),16))... | false | false | false | false | false | 0 |
Refresh()
{
if (name)
{
s32 ret;
if (0 != (ret = stat(name, &statInfo)))
{
if (errno == ENOENT)
exists = false;
}
else
{
exists = true;
}
return ret;
}
return -2;
} | false | false | false | false | false | 0 |
skb_put_frags(struct sk_buff *skb, unsigned int hdr_space,
unsigned int length)
{
int i, num_frags;
unsigned int size;
/* put header into skb */
size = min(length, hdr_space);
skb->tail += size;
skb->len += size;
length -= size;
num_frags = skb_shinfo(skb)->nr_frags;
for (i = 0; i < num_frags; i++) {
... | false | false | false | false | false | 0 |
rb_io_sysread(int argc, VALUE *argv, VALUE io)
{
VALUE len, str;
rb_io_t *fptr;
long n, ilen;
struct read_internal_arg arg;
rb_scan_args(argc, argv, "11", &len, &str);
ilen = NUM2LONG(len);
io_setstrbuf(&str,ilen);
if (ilen == 0) return str;
GetOpenFile(io, fptr);
rb_io_check_... | false | false | false | false | false | 0 |
trd_close_swapfile(runcxdef *runctx)
{
extern voccxdef *main_voc_ctx;
mcmcxdef *mctx;
mcmcx1def *globalctx;
mcscxdef *mcsctx;
/* if no run context was supplied, find it from the main voc context */
if (runctx == 0)
{
/* if there is no main voc context, ... | false | false | false | false | true | 1 |
cookie_cache_update(Cred_cache *new_cache)
{
int st;
unsigned int ui, uj;
Cred_auth_url *a, *na;
Cookie *c, *cookies, *nc;
Cred_cache *cache;
Ds ds;
FILE *fp, *nfp;
if (new_cache == NULL
|| new_cache->cookies == NULL
|| new_cache->auth == NULL)
return(0);
if ((fp = cookie_cache_open()) == NUL... | false | false | false | false | false | 0 |
__mmu_unsync_walk(struct kvm_mmu_page *sp,
struct kvm_mmu_pages *pvec)
{
int i, ret, nr_unsync_leaf = 0;
for_each_set_bit(i, sp->unsync_child_bitmap, 512) {
struct kvm_mmu_page *child;
u64 ent = sp->spt[i];
if (!is_shadow_present_pte(ent) || is_large_pte(ent))
goto clear_child_bitmap;
child = page... | false | false | false | false | false | 0 |
usb_hcd_unmap_urb_setup_for_dma(struct usb_hcd *hcd, struct urb *urb)
{
if (urb->transfer_flags & URB_SETUP_MAP_SINGLE)
dma_unmap_single(hcd->self.controller,
urb->setup_dma,
sizeof(struct usb_ctrlrequest),
DMA_TO_DEVICE);
else if (urb->transfer_flags & URB_SETUP_MAP_LOCAL)
hcd_free_coherent(urb->dev-... | false | false | false | false | false | 0 |
read_synthetic_font(Type1Reader &reader, const char *first_line,
StringAccum &wrong_accum)
{
// read font name
PermString font_name;
{
char *x = new char[strlen(first_line) + 1];
int n = 0;
sscanf(first_line, "FontDirectory /%[^] \t\r\n[{}/] known {%n", x, &n);
if (n && (isspace((unsigned char... | false | false | false | false | false | 0 |
test_odb_backend_nonrefreshing__exists_is_invoked_once_on_failure(void)
{
git_odb *odb;
setup_repository_and_backend(GIT_ENOTFOUND);
cl_git_pass(git_repository_odb__weakptr(&odb, _repo));
cl_assert_equal_b(false, git_odb_exists(odb, &_oid));
cl_assert_equal_i(1, _fake->exists_calls);
} | false | false | false | false | false | 0 |
move_bytes(unsigned long dst_idx,
unsigned long src_idx,
unsigned long cnt)
{
size_t src_avail;
size_t dst_avail;
unsigned char *srcp;
unsigned char *dstp;
/*
* If the destination is before the source, we're moving ... | false | false | false | false | false | 0 |
ipmi_serial_term_open(struct ipmi_intf * intf)
{
struct termios ti;
unsigned int rate = 9600;
char *p;
int i;
if (!intf->devfile) {
lprintf(LOG_ERR, "Serial device is not specified");
return -1;
}
is_system = 0;
/* check if baud rate is specified */
if ((p = strchr(intf->devfile, ':'))) {
char * pp;
... | false | false | false | false | true | 1 |
cl_arg(n)
int n;
{
return (n <= 0 ? argv[0] :
cl_search((char *)NULL, cl_ARG, n));
} | false | false | false | false | false | 0 |
has_magic(s, send, flags)
const char *s, *send;
int flags;
{
register const char *p = s;
register char c;
int open = 0;
int escape = !(flags & FNM_NOESCAPE);
while ((c = *p++) != '\0') {
switch (c) {
case '?':
case '*':
return Qtrue;
case '[': /* Only accept an open brace if... | false | false | false | false | false | 0 |
dbus_init (void)
{
GError *error = NULL;
DBusGConnection *bus;
DBusConnection *connection;
DBusGProxy *proxy;
int result;
dbus_connection_set_change_sigpipe (TRUE);
bus = dbus_g_bus_get (DBUS_BUS_SYSTEM, &error);
if (!bus) {
g_warning ("Could not get the system bus. Make sure "
"the message bu... | false | false | false | false | false | 0 |
__ecereInstMeth___ecereNameSpace__ecere__gui__controls__MenuItem_NotifySelect__00000025(struct __ecereNameSpace__ecere__com__Instance * this, struct __ecereNameSpace__ecere__com__Instance * selection, unsigned int mods)
{
struct IDEWorkSpace * __ecerePointer_IDEWorkSpace = (struct IDEWorkSpace *)(this ? (((char *)this)... | false | false | false | false | false | 0 |
inf_text_gtk_view_user_notify_status_cb(GObject* object,
GParamSpec* pspec,
gpointer user_data)
{
InfTextGtkView* view;
InfTextGtkViewPrivate* priv;
InfTextUser* user;
InfTextGtkViewUser* view_user;
view = INF_TEXT_GTK_VIEW(user_... | false | false | false | false | false | 0 |
DFR8getpalref(uint16 *pal_ref)
{
CONSTR(FUNC, "DFR8getpalref");
intn ret_value = SUCCEED;
HEclear();
/* Perform global, one-time initialization */
if (library_terminate == FALSE)
if(DFR8Istart()==FAIL)
HGOTO_ERROR(DFE_CANTINIT, FAIL);
*pal_ref = Readrig.lut.ref; /* ref of palette *... | false | false | false | false | false | 0 |
MSAAppendGC(MSA *msa, char *tag, char *value)
{
int tagidx;
/* Is this an unparsed tag name that we recognize?
* If not, handle adding it to index, and reallocating
* as needed.
*/
if (msa->gc_tag == NULL) /* first tag? init w/ malloc */
{
msa->gc_tag = MallocOrDie(sizeof(char *));
msa-... | false | false | false | false | false | 0 |
GetCol(MatrixColX& mrc)
{
REPORT
int c = mrc.rowcol; int n = lower_val+upper_val; int w = n+1;
mrc.length=nrows_val; int b; int s = c-upper_val;
if (s<=0) { w += s; s = 0; b = c+lower_val; } else b = s*w+n;
mrc.skip = s; s += w-nrows_val; if (s>0) w -= s; mrc.storage = w;
mrc.data = mrc.store+mrc.skip... | false | false | false | false | false | 0 |
gdata_mock_server_start_trace (GDataMockServer *self, const gchar *trace_name)
{
GFile *trace_file;
g_return_if_fail (GDATA_IS_MOCK_SERVER (self));
g_return_if_fail (trace_name != NULL && *trace_name != '\0');
g_assert (self->priv->trace_directory != NULL);
trace_file = g_file_get_child (self->priv->trace_direc... | false | false | false | false | false | 0 |
Curl_pp_getsock(struct pingpong *pp,
curl_socket_t *socks,
int numsocks)
{
struct connectdata *conn = pp->conn;
if(!numsocks)
return GETSOCK_BLANK;
socks[0] = conn->sock[FIRSTSOCKET];
if(pp->sendleft) {
/* write mode */
return GETSOCK_WRITESOCK(0);
}
/... | false | false | false | false | false | 0 |
tf_init (struct ata_tf *tf, __u8 ata_op, __u64 lba, unsigned int nsect)
{
memset(tf, 0, sizeof(*tf));
tf->command = ata_op;
tf->dev = ATA_USING_LBA;
tf->lob.lbal = lba;
tf->lob.lbam = lba >> 8;
tf->lob.lbah = lba >> 16;
tf->lob.nsect = nsect;
if (needs_lba48(ata_op, lba, nsect)) {
tf->is_lba48 = 1;
t... | false | false | false | false | false | 0 |
usn_get_attr(Slapi_PBlock *pb, const char* type, void *value)
{
if (0 == strcasecmp(type, "nsds5ReplicaTombstonePurgeInterval")) {
*(int *)value = 1;
} else {
*(int *)value = 0;
}
return 0;
} | false | false | false | false | false | 0 |
ges_track_set_timeline (GESTrack * track, GESTimeline * timeline)
{
GST_DEBUG ("track:%p, timeline:%p", track, timeline);
track->priv->timeline = timeline;
resort_and_fill_gaps (track);
} | false | false | false | false | false | 0 |
dump_dir_plugin(Plugin *plugin, FILE *fp)
{
if (!plugin) {
return ;
}
pDirInfo *info = (pDirInfo *) plugin->pinfo;
fprintf(fp, "\tversion=%d\n", info->version);
fprintf(fp, "\tdate=%s\n", NPRTB(info->plugin_date));
fprintf(fp, "\tmagic=%s\n", NPRTB(info->plugin_magic));
fprintf(fp, "\tauthor=... | false | false | false | false | false | 0 |
CPLRecodeToWChar( const char *pszSource,
const char *pszSrcEncoding,
const char *pszDstEncoding )
{
#ifdef CPL_RECODE_ICONV
/* -------------------------------------------------------------------- */
/* Conversions to CPL_ENC_UCS2 ... | false | false | false | false | false | 0 |
iwl_cancel_deferred_work(struct iwl_priv *priv)
{
if (priv->lib->bt_params)
iwlagn_bt_cancel_deferred_work(priv);
cancel_work_sync(&priv->run_time_calib_work);
cancel_work_sync(&priv->beacon_update);
iwl_cancel_scan_deferred_work(priv);
cancel_work_sync(&priv->bt_full_concurrency);
cancel_work_sync(&priv->bt... | false | false | false | false | false | 0 |
initFrand(double medium, double low, double high)
{
Frand f = (Frand)malloc(sizeof(*f));
if (!f) outOfMemory();
f->medium = medium;
f->alpha = high*2;
f->beta = low*2;
f->val = randval();
f->teiler = 1;
return f;
} | false | false | false | true | false | 1 |
int_upto(VALUE from, VALUE to)
{
RETURN_ENUMERATOR(from, 1, &to);
if (FIXNUM_P(from) && FIXNUM_P(to)) {
long i, end;
end = FIX2LONG(to);
for (i = FIX2LONG(from); i <= end; i++) {
rb_yield(LONG2FIX(i));
}
}
else {
VALUE i = from, c;
while (!(c = rb_funcall(i, '>', 1, to))) {
rb_yield(i)... | false | false | false | false | false | 0 |
trackCollectionDone()
{
QMutexLocker locker( &m_collectionResultsMutex );
m_trackCollection = TrackCollectionPtr( new TrackCollection( m_collectionUids ) );
m_collectionUids.clear();
m_collectionResultsReady.wakeAll();
} | false | false | false | false | false | 0 |
sem_enum(string_ty *s)
{
trace(("sem_enum(s = %08lX)\n{\n", (long)s));
trace_string(s->str_text);
if (!sem_root->type)
{
// do nothing
}
else if (!sem_root->type->enum_parse)
{
sub_context_ty *scp;
scp = sub_context_new();
sub_var_set_charstar(scp, "Name", sem_root->type->name);
lex_er... | false | false | false | false | false | 0 |
_mfd_inetCidrRouteTable_rowreq_from_index(netsnmp_index * oid_idx,
int *rc_ptr)
{
inetCidrRouteTable_rowreq_ctx *rowreq_ctx;
inetCidrRouteTable_mib_index mib_idx;
int rc;
DEBUGMSGTL(("internal:inetCidrRouteTable:_mfd_inetCidrRouteTable_rowreq_from_i... | false | false | false | false | false | 0 |
gtkrc_gtk_rc_set_default_files(ScmObj *SCM_FP, int SCM_ARGCNT, void *data_)
{
ScmObj strings_scm;
gchar ** strings;
ScmObj SCM_SUBRARGS[1];
int SCM_i;
SCM_ENTER_SUBR("gtk-rc-set-default-files");
for (SCM_i=0; SCM_i<1; SCM_i++) {
SCM_SUBRARGS[SCM_i] = SCM_ARGREF(SCM_i);
}
strings_scm = SCM_SUBRARGS[0... | false | false | false | false | false | 0 |
sst_module_runtime_alloc_blocks(struct sst_module_runtime *runtime,
int offset)
{
struct sst_dsp *dsp = runtime->dsp;
struct sst_module *module = runtime->module;
struct sst_block_allocator ba;
int ret;
if (module->persistent_size == 0)
return 0;
memset(&ba, 0, sizeof(ba));
ba.size = module->persistent_size... | false | false | false | false | false | 0 |
jack_call_sync_client (jack_client_t *client)
{
jack_client_control_t *control = client->control;
jack_control_t *ectl = client->engine;
/* Make sure still active and slow-sync; active_slowsync is
* set in a critical section; sync_cb is not. */
if ((ectl->new_pos || control->sync_poll || control->sync_new) &&
... | false | false | false | false | false | 0 |
gen_codes (tree, max_code, bl_count)
ct_data *tree; /* the tree to decorate */
int max_code; /* largest code with non zero frequency */
ushf *bl_count; /* number of codes at each bit length */
{
ush next_code[MAX_BITS+1]; /* next code value for each bit length */
... | false | false | false | false | false | 0 |
testNameAt(unsigned int index) const {
TestCase *test = tests_[index]();
std::string name = test->testName();
delete test;
return name;
} | false | false | false | false | false | 0 |
end_snippet(string_iterator first, string_iterator last)
{
append_code(first, last);
if(!snippet_stack) {
if (qbk_version_n >= 106u) {
detail::outerr(source_file, first)
<< "Mismatched end snippet."
<< std::endl;
++... | false | false | false | false | false | 0 |
gdata_commentable_insert_comment (GDataCommentable *self, GDataService *service, GDataComment *comment_, GCancellable *cancellable, GError **error)
{
GDataCommentableInterface *iface;
gchar *uri;
GDataComment *new_comment;
GDataAuthorizationDomain *domain = NULL;
g_return_val_if_fail (GDATA_IS_COMMENTABLE (self),... | false | false | false | true | false | 1 |
PrepareDStemList( GlyphData *gd, StemData **dstems ) {
double lpos, rpos, prevlsp, prevrsp, prevlep, prevrep;
PointData *ls, *rs, *le, *re;
struct stem_chunk *chunk;
StemData *stem;
int i, j, dcnt=0;
for ( i=0; i<gd->stemcnt; i++ ) {
stem = &gd->stems[i];
if ( stem->toobig ||
( stem->uni... | false | false | false | false | false | 0 |
get_cs_converted_string_value(THD *thd,
String *input_str,
String *output_str,
CHARSET_INFO *cs,
bool use_hex)
{
output_str->length(0);
if (input_s... | false | false | false | false | false | 0 |
remove_jump_pe_stm(Pe_statement *pestm)
{
Statement *s;
Statement *next;
s = pestm->stm_head;
while (s != NULL) {
next = s->next;
remove_jump_stm(s);
if (s->qr_head == NULL) {
unlink_statement(s);
free_statement(s);
}
s = next;
}
} | false | false | false | false | false | 0 |
gt_genome_node_set_origin(GtGenomeNode *gn, GtStr *filename,
unsigned int line_number)
{
gt_assert(gn && filename && line_number);
gt_str_delete(gn->filename);
gn->filename = gt_str_ref(filename);
gn->line_number = line_number;
} | false | false | false | false | false | 0 |
parse_float_pair (const gchar *p,
gdouble *x,
gdouble *y)
{
gchar *t = (void*) p;
while (*t && ((*t<'0' || *t > '9') && *t!='-')) t++;
if (!t)
return p;
*x = g_ascii_strtod (t, &t);
while (*t && ((*t<'0' || *t > '9') && *t!='-')) t++;
if (!t)
return p;
*... | false | false | false | false | false | 0 |
giveback_first_trb(struct xhci_hcd *xhci, int slot_id,
unsigned int ep_index, unsigned int stream_id, int start_cycle,
struct xhci_generic_trb *start_trb)
{
/*
* Pass all the TRBs to the hardware at once and make sure this write
* isn't reordered.
*/
wmb();
if (start_cycle)
start_trb->field[3] |= cpu_to_... | false | false | false | false | false | 0 |
po1030_s_ctrl(struct v4l2_ctrl *ctrl)
{
struct gspca_dev *gspca_dev =
container_of(ctrl->handler, struct gspca_dev, ctrl_handler);
struct sd *sd = (struct sd *) gspca_dev;
int err;
if (!gspca_dev->streaming)
return 0;
switch (ctrl->id) {
case V4L2_CID_AUTO_WHITE_BALANCE:
err = po1030_set_auto_white_balanc... | false | false | false | false | false | 0 |
find_widget(int x, int y) {
for (iterator i=begin(); i!=end(); ++i) {
Widget *w = *i;
if (w->get_area().contains(x,y)) {
Container *c = dynamic_cast<Container *> (w);
if (c) {
w = c->find_widget (x, y);
return w ? w : c;
}
... | false | false | false | false | false | 0 |
validatePage()
{
// changed to true to support 1932 version which doesn't require a firmware file
QString filePath = name->text();
if (filePath == "" || !QFile(filePath).exists()) return true;
// either copy it, or reference it!
if (copy->isChecked()) {
QString fileName = QFileInfo(filePat... | false | false | false | false | false | 0 |
gdbstub_get_packet_args ( struct gdbstub *stub, unsigned long *args, int nargs, int *stop_idx ) {
int i;
char ch = 0;
int argc = 0;
unsigned long val = 0;
for ( i = 1; i < stub->len && argc < nargs; i++ ) {
ch = stub->payload [ i ];
if ( ch == ':' ) {
break;
} else if ( ch == ',' ) {
args [ argc++ ] = ... | false | false | false | false | false | 0 |
get_new_id(VMG_ vm_obj_id_t old_id)
{
obj_fixup_entry *entry;
/*
* if it's a root-set object, don't bother even trying to translate
* it, because root-set objects have stable ID's that never change on
* saving or restoring
*/
if (G_obj_table->is_obj_id_valid(old_id)... | false | false | false | false | false | 0 |
cwid(unsigned short c)
{
if (c > sizeof cw_tb / sizeof cw_tb[0])
c = 'A';
return (float) cw_tb[c] / 1000.;
} | false | false | false | false | false | 0 |
mnt_reset_context(struct libmnt_context *cxt)
{
int fl;
if (!cxt)
return -EINVAL;
DBG(CXT, mnt_debug_h(cxt, "<---- reset [status=%d] ---->",
mnt_context_get_status(cxt)));
fl = cxt->flags;
if (!(cxt->flags & MNT_FL_EXTERN_FS))
mnt_free_fs(cxt->fs);
mnt_free_table(cxt->mtab);
free(cxt->helper);
fre... | false | false | false | false | false | 0 |
hoverLeaveEvent(QMouseEvent* /*event*/)
{
mHover = false;
if (mPushButton) mButtonPressed = false;
changeFrame();
} | false | false | false | false | false | 0 |
contact_logoff(struct contact *ec)
{
/* display the "closed door" icon */
ec->pix = iconlogoff_pb;
ec->group->contacts_online--;
/* remove any other timeouts(if the user just logged in) */
if (ec->icon_handler != -1)
eb_timeout_remove(ec->icon_handler);
/* timeout to remove the contact from the list */
ec->i... | 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.