ML4SE23
Collection
Collection of models for the course. Naming convention: ML4SE23_G{group_number}_{model_name} • 27 items • Updated • 2
target int64 0 1 | func stringlengths 7 484k | func_no_comments stringlengths 7 484k | idx int64 1 368k |
|---|---|---|---|
1 | int _gnutls_ciphertext2compressed(gnutls_session_t session,
opaque * compress_data,
int compress_size,
gnutls_datum_t ciphertext, uint8 type)
{
uint8 MAC[MAX_HASH_SIZE];
uint16 c_length;
uint8 pad;
int length;
mac_hd_t td;
uint16 blocksize;
int ret, i, pad_failed = 0;
u... | int _gnutls_ciphertext2compressed(gnutls_session_t session,
opaque * compress_data,
int compress_size,
gnutls_datum_t ciphertext, uint8 type)
{
uint8 MAC[MAX_HASH_SIZE];
uint16 c_length;
uint8 pad;
int length;
mac_hd_t td;
uint16 blocksize;
int ret, i, pad_failed = 0;
u... | 1 |
0 | void KPasswordDlg::keyPressed( QKeyEvent *e )
{
static bool waitForAuthentication = false;
if (!waitForAuthentication) {
switch ( e->key() )
{
case Key_Backspace:
{
int len = password.length();
if ( len ) {
password.truncate( len - 1 );
if( stars )
showStars();
}
}
break;
... | void KPasswordDlg::keyPressed( QKeyEvent *e )
{
static bool waitForAuthentication = false;
if (!waitForAuthentication) {
switch ( e->key() )
{
case Key_Backspace:
{
int len = password.length();
if ( len ) {
password.truncate( len - 1 );
if( stars )
showStars();
}
}
break;
... | 2 |
0 | static av_cold int vdadec_init(AVCodecContext *avctx) { VDADecoderContext *ctx = avctx->priv_data; struct vda_context *vda_ctx = &ctx->vda_ctx; OSStatus status; int ret; ctx->h264_initialized = 0; /* init pix_fmts of codec */ if (!ff_h264_vda_decoder.pix_fmts) { if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVer... | static av_cold int vdadec_init(AVCodecContext *avctx) { VDADecoderContext *ctx = avctx->priv_data; struct vda_context *vda_ctx = &ctx->vda_ctx; OSStatus status; int ret; ctx->h264_initialized = 0; if (!ff_h264_vda_decoder.pix_fmts) { if (kCFCoreFoundationVersionNumber < kCFCoreFoundationVersionNumber10_7) ff_h264_vda... | 3 |
0 | armv6pmu_handle_irq(int irq_num,
void *dev)
{
unsigned long pmcr = armv6_pmcr_read();
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
struct pt_regs *regs;
int idx;
if (!armv6_pmcr_has_overflowed(pmcr))
return IRQ_NONE;
regs = get_irq_regs();
/*
* The interrupts are cleared by writing the... | armv6pmu_handle_irq(int irq_num,
void *dev)
{
unsigned long pmcr = armv6_pmcr_read();
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
struct pt_regs *regs;
int idx;
if (!armv6_pmcr_has_overflowed(pmcr))
return IRQ_NONE;
regs = get_irq_regs();
armv6_pmcr_write(pmcr);
perf_sample_data_in... | 5 |
0 | static void write_bootloader ( CPUMIPSState * env , uint8_t * base , int64_t kernel_entry ) {
uint32_t * p ;
p = ( uint32_t * ) base ;
stl_raw ( p ++ , 0x0bf00160 ) ;
stl_raw ( p ++ , 0x00000000 ) ;
stl_raw ( base + 0x500 , 0xbfc00580 ) ;
stl_raw ( base + 0x504 , 0xbfc0083c ) ;
stl_raw ( base + 0x520 , 0xbfc0058... | static void write_bootloader ( CPUMIPSState * env , uint8_t * base , int64_t kernel_entry ) {
uint32_t * p ;
p = ( uint32_t * ) base ;
stl_raw ( p ++ , 0x0bf00160 ) ;
stl_raw ( p ++ , 0x00000000 ) ;
stl_raw ( base + 0x500 , 0xbfc00580 ) ;
stl_raw ( base + 0x504 , 0xbfc0083c ) ;
stl_raw ( base + 0x520 , 0xbfc0058... | 6 |
1 | _dl_dst_count (const char *name, int is_path)
{
size_t cnt = 0;
do
{
size_t len = 1;
/* $ORIGIN is not expanded for SUID/GUID programs. */
if ((((!__libc_enable_secure
&& strncmp (&name[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|| (strncmp (&name[1], "PLATFORM", 8) == 0 && (len = ... | _dl_dst_count (const char *name, int is_path)
{
size_t cnt = 0;
do
{
size_t len = 1;
if ((((!__libc_enable_secure
&& strncmp (&name[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|| (strncmp (&name[1], "PLATFORM", 8) == 0 && (len = 9) != 0))
&& (name[len] == '\0' || name[len] == '... | 7 |
1 | static char *make_filename_safe(const char *filename TSRMLS_DC)
{
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
if (!fullpath) {
return NULL;
}
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_... | static char *make_filename_safe(const char *filename TSRMLS_DC)
{
if (*filename && strncmp(filename, ":memory:", sizeof(":memory:")-1)) {
char *fullpath = expand_filepath(filename, NULL TSRMLS_CC);
if (!fullpath) {
return NULL;
}
if (PG(safe_mode) && (!php_checkuid(fullpath, NULL, CHECKUID_CHECK_FILE_AND_... | 8 |
1 | armv6pmu_handle_irq(int irq_num,
void *dev)
{
unsigned long pmcr = armv6_pmcr_read();
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
struct pt_regs *regs;
int idx;
if (!armv6_pmcr_has_overflowed(pmcr))
return IRQ_NONE;
regs = get_irq_regs();
/*
* The interrupts are cleared by writing the... | armv6pmu_handle_irq(int irq_num,
void *dev)
{
unsigned long pmcr = armv6_pmcr_read();
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
struct pt_regs *regs;
int idx;
if (!armv6_pmcr_has_overflowed(pmcr))
return IRQ_NONE;
regs = get_irq_regs();
armv6_pmcr_write(pmcr);
perf_sample_data_in... | 10 |
1 | unpack_Z_stream(int fd_in, int fd_out)
{
IF_DESKTOP(long long total_written = 0;)
IF_DESKTOP(long long) int retval = -1;
unsigned char *stackp;
long code;
int finchar;
long oldcode;
long incode;
int inbits;
int posbits;
int outpos;
int insize;
int bitmask;
long free_ent;
long maxcode;
long maxmaxcode;
i... | unpack_Z_stream(int fd_in, int fd_out)
{
IF_DESKTOP(long long total_written = 0;)
IF_DESKTOP(long long) int retval = -1;
unsigned char *stackp;
long code;
int finchar;
long oldcode;
long incode;
int inbits;
int posbits;
int outpos;
int insize;
int bitmask;
long free_ent;
long maxcode;
long maxmaxcode;
i... | 11 |
1 | _dl_dst_substitute (struct link_map *l, const char *name, char *result,
int is_path)
{
char *last_elem, *wp;
/* Now fill the result path. While copying over the string we keep
track of the start of the last path element. When we come accross
a DST we copy over the value or (if the value is not av... | _dl_dst_substitute (struct link_map *l, const char *name, char *result,
int is_path)
{
char *last_elem, *wp;
last_elem = wp = result;
do
{
if (*name == '$')
{
const char *repl;
size_t len;
if ((((strncmp (&name[1], "ORIGIN", 6) == 0 && (len = 7) != 0)
|| (strncmp (&name[1], "PLA... | 12 |
0 | static void v4l2_free_buffer(void *opaque, uint8_t *unused) { V4L2Buffer* avbuf = opaque; V4L2m2mContext *s = buf_to_m2mctx(avbuf); if (atomic_fetch_sub(&avbuf->context_refcount, 1) == 1) { atomic_fetch_sub_explicit(&s->refcount, 1, memory_order_acq_rel); if (s->reinit) { if (!atomic_load(&s->refcount)) sem_post(&s->re... | static void v4l2_free_buffer(void *opaque, uint8_t *unused) { V4L2Buffer* avbuf = opaque; V4L2m2mContext *s = buf_to_m2mctx(avbuf); if (atomic_fetch_sub(&avbuf->context_refcount, 1) == 1) { atomic_fetch_sub_explicit(&s->refcount, 1, memory_order_acq_rel); if (s->reinit) { if (!atomic_load(&s->refcount)) sem_post(&s->re... | 13 |
0 | int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t buf_size) { cl_int status; void *mapped = clEnqueueMapBuffer(gpu_env.command_queue, dst_cl_buf, CL_TRUE,CL_MAP_WRITE, 0, sizeof(uint8_t) * buf_size, 0, NULL, NULL, &status); if (status != CL_SUCCESS) { av_log(&openclutils, AV_LOG_ERROR, "Could not m... | int av_opencl_buffer_write(cl_mem dst_cl_buf, uint8_t *src_buf, size_t buf_size) { cl_int status; void *mapped = clEnqueueMapBuffer(gpu_env.command_queue, dst_cl_buf, CL_TRUE,CL_MAP_WRITE, 0, sizeof(uint8_t) * buf_size, 0, NULL, NULL, &status); if (status != CL_SUCCESS) { av_log(&openclutils, AV_LOG_ERROR, "Could not m... | 16 |
1 | glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
uint8_t *dst,const uint8_t *src,
int dstpitch,int srcpitch,
int bltwidth,int bltheight)
{
int x,y;
dstpitch -= bltwidth;
srcpitch -= bltwidth;
for (y = 0; y < ... | glue(cirrus_bitblt_rop_fwd_, ROP_NAME)(CirrusVGAState *s,
uint8_t *dst,const uint8_t *src,
int dstpitch,int srcpitch,
int bltwidth,int bltheight)
{
int x,y;
dstpitch -= bltwidth;
srcpitch -= bltwidth;
for (y = 0; y < ... | 18 |
0 | static char * default_opaque_literal_tag ( tvbuff_t * tvb , guint32 offset , const char * token _U_ , guint8 codepage _U_ , guint32 * length ) {
guint32 data_len = tvb_get_guintvar ( tvb , offset , length ) ;
char * str = wmem_strdup_printf ( wmem_packet_scope ( ) , "(%d bytes of opaque data)" , data_len ) ;
* lengt... | static char * default_opaque_literal_tag ( tvbuff_t * tvb , guint32 offset , const char * token _U_ , guint8 codepage _U_ , guint32 * length ) {
guint32 data_len = tvb_get_guintvar ( tvb , offset , length ) ;
char * str = wmem_strdup_printf ( wmem_packet_scope ( ) , "(%d bytes of opaque data)" , data_len ) ;
* lengt... | 19 |
1 | static int r3d_read_rdvo(AVFormatContext *s, Atom *atom) { R3DContext *r3d = s->priv_data; AVStream *st = s->streams[0]; int i; r3d->video_offsets_count = (atom->size - 8) / 4; r3d->video_offsets = av_malloc(atom->size); if (!r3d->video_offsets) return AVERROR(ENOMEM); for (i = 0; i < r3d->video_offsets_count; i++) { r... | static int r3d_read_rdvo(AVFormatContext *s, Atom *atom) { R3DContext *r3d = s->priv_data; AVStream *st = s->streams[0]; int i; r3d->video_offsets_count = (atom->size - 8) / 4; r3d->video_offsets = av_malloc(atom->size); if (!r3d->video_offsets) return AVERROR(ENOMEM); for (i = 0; i < r3d->video_offsets_count; i++) { r... | 20 |
1 | static int intel_pmu_handle_irq(struct pt_regs *regs)
{
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
int bit, loops;
u64 status;
int handled;
perf_sample_data_init(&data, 0);
cpuc = &__get_cpu_var(cpu_hw_events);
/*
* Some chipsets need to unmask the LVTPC in a particular spot
* inside the n... | static int intel_pmu_handle_irq(struct pt_regs *regs)
{
struct perf_sample_data data;
struct cpu_hw_events *cpuc;
int bit, loops;
u64 status;
int handled;
perf_sample_data_init(&data, 0);
cpuc = &__get_cpu_var(cpu_hw_events);
apic_write(APIC_LVTPC, APIC_DM_NMI);
intel_pmu_disable_all();
handled = intel... | 21 |
0 | static int em_syscall(struct x86_emulate_ctxt *ctxt)
{
struct x86_emulate_ops *ops = ctxt->ops;
struct desc_struct cs, ss;
u64 msr_data;
u16 cs_sel, ss_sel;
u64 efer = 0;
/* syscall is not available in real mode */
if (ctxt->mode == X86EMUL_MODE_REAL ||
ctxt->mode == X86EMUL_MODE_VM86)
return emulate_ud(... | static int em_syscall(struct x86_emulate_ctxt *ctxt)
{
struct x86_emulate_ops *ops = ctxt->ops;
struct desc_struct cs, ss;
u64 msr_data;
u16 cs_sel, ss_sel;
u64 efer = 0;
if (ctxt->mode == X86EMUL_MODE_REAL ||
ctxt->mode == X86EMUL_MODE_VM86)
return emulate_ud(ctxt);
if (!(em_syscall_is_enabled(ctxt)... | 24 |
1 | vsyslog(pri, fmt, ap)
int pri;
register const char *fmt;
va_list ap;
{
struct tm now_tm;
time_t now;
int fd;
FILE *f;
char *buf = 0;
size_t bufsize = 0;
size_t prioff, msgoff;
struct sigaction action, oldaction;
struct sigaction *oldaction_ptr = NULL;
int sigpipe;
int saved_errno = errno;
#define INTER... | vsyslog(pri, fmt, ap)
int pri;
register const char *fmt;
va_list ap;
{
struct tm now_tm;
time_t now;
int fd;
FILE *f;
char *buf = 0;
size_t bufsize = 0;
size_t prioff, msgoff;
struct sigaction action, oldaction;
struct sigaction *oldaction_ptr = NULL;
int sigpipe;
int saved_errno = errno;
#define INTER... | 25 |
0 | static bool em_syscall_is_enabled(struct x86_emulate_ctxt *ctxt)
{
struct x86_emulate_ops *ops = ctxt->ops;
u32 eax, ebx, ecx, edx;
/*
* syscall should always be enabled in longmode - so only become
* vendor specific (cpuid) if other modes are active...
*/
if (ctxt->mode == X86EMUL_MODE_PROT64)
return true... | static bool em_syscall_is_enabled(struct x86_emulate_ctxt *ctxt)
{
struct x86_emulate_ops *ops = ctxt->ops;
u32 eax, ebx, ecx, edx;
if (ctxt->mode == X86EMUL_MODE_PROT64)
return true;
eax = 0x00000000;
ecx = 0x00000000;
if (ops->get_cpuid(ctxt, &eax, &ebx, &ecx, &edx)) {
if (ebx == X86EMUL_CPUID_VEND... | 26 |
0 | void tb_invalidate_phys_page_fast ( tb_page_addr_t start , int len ) {
PageDesc * p ;
int offset , b ;
# if 0 if ( 1 ) {
qemu_log ( "modifying code at 0x%x size=%d EIP=%x PC=%08x\n" , cpu_single_env -> mem_io_vaddr , len , cpu_single_env -> eip , cpu_single_env -> eip + ( intptr_t ) cpu_single_env -> segs [ R_CS ] ... | void tb_invalidate_phys_page_fast ( tb_page_addr_t start , int len ) {
PageDesc * p ;
int offset , b ;
# if 0 if ( 1 ) {
qemu_log ( "modifying code at 0x%x size=%d EIP=%x PC=%08x\n" , cpu_single_env -> mem_io_vaddr , len , cpu_single_env -> eip , cpu_single_env -> eip + ( intptr_t ) cpu_single_env -> segs [ R_CS ] ... | 28 |
1 | static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
const uint8_t * src)
{
uint8_t *dst;
dst = s->vram_ptr + s->cirrus_blt_dstaddr;
(*s->cirrus_rop) (s, dst, src,
s->cirrus_blt_dstpitch, 0,
s->cirrus_blt_width, s->cirrus_blt_height);
cirr... | static int cirrus_bitblt_common_patterncopy(CirrusVGAState * s,
const uint8_t * src)
{
uint8_t *dst;
dst = s->vram_ptr + s->cirrus_blt_dstaddr;
(*s->cirrus_rop) (s, dst, src,
s->cirrus_blt_dstpitch, 0,
s->cirrus_blt_width, s->cirrus_blt_height);
cirr... | 30 |
0 | int kvm_arch_process_async_events ( CPUState * cs ) {
X86CPU * cpu = X86_CPU ( cs ) ;
CPUX86State * env = & cpu -> env ;
if ( cs -> interrupt_request & CPU_INTERRUPT_MCE ) {
assert ( env -> mcg_cap ) ;
cs -> interrupt_request &= ~ CPU_INTERRUPT_MCE ;
kvm_cpu_synchronize_state ( cs ) ;
if ( env -> exception_injec... | int kvm_arch_process_async_events ( CPUState * cs ) {
X86CPU * cpu = X86_CPU ( cs ) ;
CPUX86State * env = & cpu -> env ;
if ( cs -> interrupt_request & CPU_INTERRUPT_MCE ) {
assert ( env -> mcg_cap ) ;
cs -> interrupt_request &= ~ CPU_INTERRUPT_MCE ;
kvm_cpu_synchronize_state ( cs ) ;
if ( env -> exception_injec... | 32 |
1 | void assert_avoptions(AVDictionary *m) { AVDictionaryEntry *t; if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key); exit(1); } } | void assert_avoptions(AVDictionary *m) { AVDictionaryEntry *t; if ((t = av_dict_get(m, "", NULL, AV_DICT_IGNORE_SUFFIX))) { av_log(NULL, AV_LOG_FATAL, "Option %s not found.\n", t->key); exit(1); } } | 34 |
0 | static void test_simplesignal ( void ) {
struct event ev ;
struct itimerval itv ;
setup_test ( "Simple signal: " ) ;
signal_set ( & ev , SIGALRM , signal_cb , & ev ) ;
signal_add ( & ev , NULL ) ;
signal_del ( & ev ) ;
signal_add ( & ev , NULL ) ;
memset ( & itv , 0 , sizeof ( itv ) ) ;
itv . it_value . tv_sec... | static void test_simplesignal ( void ) {
struct event ev ;
struct itimerval itv ;
setup_test ( "Simple signal: " ) ;
signal_set ( & ev , SIGALRM , signal_cb , & ev ) ;
signal_add ( & ev , NULL ) ;
signal_del ( & ev ) ;
signal_add ( & ev , NULL ) ;
memset ( & itv , 0 , sizeof ( itv ) ) ;
itv . it_value . tv_sec... | 35 |
1 | static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
int off_pitch, int bytesperline,
int lines)
{
int y;
int off_cur;
int off_cur_end;
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = off_cur + bytesperline;
off_cur &= TARGET_PAGE_MASK;
while (o... | static void cirrus_invalidate_region(CirrusVGAState * s, int off_begin,
int off_pitch, int bytesperline,
int lines)
{
int y;
int off_cur;
int off_cur_end;
for (y = 0; y < lines; y++) {
off_cur = off_begin;
off_cur_end = off_cur + bytesperline;
off_cur &= TARGET_PAGE_MASK;
while (o... | 36 |
0 | int TSHttpTxnIsWebsocket ( TSHttpTxn txnp ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
return sm -> t_state . is_websocket ;
} | int TSHttpTxnIsWebsocket ( TSHttpTxn txnp ) {
sdk_assert ( sdk_sanity_check_txn ( txnp ) == TS_SUCCESS ) ;
HttpSM * sm = ( HttpSM * ) txnp ;
return sm -> t_state . is_websocket ;
} | 38 |
1 | static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) { BDRVNBDState *s = bs->opaque; QDict *opts = qdict_new(); QObject *saddr_qdict; Visitor *ov; const char *host = NULL, *port = NULL, *path = NULL; if (s->saddr->type == SOCKET_ADDRESS_KIND_INET) { const InetSocketAddress *inet = s->saddr->u.inet.dat... | static void nbd_refresh_filename(BlockDriverState *bs, QDict *options) { BDRVNBDState *s = bs->opaque; QDict *opts = qdict_new(); QObject *saddr_qdict; Visitor *ov; const char *host = NULL, *port = NULL, *path = NULL; if (s->saddr->type == SOCKET_ADDRESS_KIND_INET) { const InetSocketAddress *inet = s->saddr->u.inet.dat... | 41 |
1 | static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
{
cirrus_fill_t rop_func;
rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
rop_func(s, s->vram_ptr + s->cirrus_blt_dstaddr,
s->cirrus_blt_dstpitch,
s->cirrus_blt_width, s->cirrus_blt_hei... | static int cirrus_bitblt_solidfill(CirrusVGAState *s, int blt_rop)
{
cirrus_fill_t rop_func;
rop_func = cirrus_fill[rop_to_index[blt_rop]][s->cirrus_blt_pixelwidth - 1];
rop_func(s, s->vram_ptr + s->cirrus_blt_dstaddr,
s->cirrus_blt_dstpitch,
s->cirrus_blt_width, s->cirrus_blt_hei... | 42 |
1 | int net_init_tap(QemuOpts *opts, const char *name, VLANState *vlan) { const char *ifname; ifname = qemu_opt_get(opts, "ifname"); if (!ifname) { error_report("tap: no interface name"); return -1; } if (tap_win32_init(vlan, "tap", name, ifname) == -1) { return -1; } return 0; } | int net_init_tap(QemuOpts *opts, const char *name, VLANState *vlan) { const char *ifname; ifname = qemu_opt_get(opts, "ifname"); if (!ifname) { error_report("tap: no interface name"); return -1; } if (tap_win32_init(vlan, "tap", name, ifname) == -1) { return -1; } return 0; } | 43 |
1 | print_insn (bfd_vma pc, disassemble_info *info) { const struct dis386 *dp; int i; char *op_txt[MAX_OPERANDS]; int needcomma; unsigned char uses_DATA_prefix, uses_LOCK_prefix; unsigned char uses_REPNZ_prefix, uses_REPZ_prefix; int sizeflag; const char *p; struct dis_private priv; unsigned char op; unsigned char threebyt... | print_insn (bfd_vma pc, disassemble_info *info) { const struct dis386 *dp; int i; char *op_txt[MAX_OPERANDS]; int needcomma; unsigned char uses_DATA_prefix, uses_LOCK_prefix; unsigned char uses_REPNZ_prefix, uses_REPZ_prefix; int sizeflag; const char *p; struct dis_private priv; unsigned char op; unsigned char threebyt... | 45 |
0 | static inline void decode2x2 ( GetBitContext * gb , uint8_t * dst , int linesize ) {
int i , j , v [ 2 ] ;
switch ( get_bits ( gb , 2 ) ) {
case 1 : v [ 0 ] = get_bits ( gb , 8 ) ;
for ( j = 0 ;
j < 2 ;
j ++ ) memset ( dst + j * linesize , v [ 0 ] , 2 ) ;
break ;
case 2 : v [ 0 ] = get_bits ( gb , 8 ) ;
v [ 1 ... | static inline void decode2x2 ( GetBitContext * gb , uint8_t * dst , int linesize ) {
int i , j , v [ 2 ] ;
switch ( get_bits ( gb , 2 ) ) {
case 1 : v [ 0 ] = get_bits ( gb , 8 ) ;
for ( j = 0 ;
j < 2 ;
j ++ ) memset ( dst + j * linesize , v [ 0 ] , 2 ) ;
break ;
case 2 : v [ 0 ] = get_bits ( gb , 8 ) ;
v [ 1 ... | 46 |
1 | static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
{
int copy_count;
uint8_t *end_ptr;
if (s->cirrus_srccounter > 0) {
if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
cirrus_bitblt_common_patterncopy(s, s->cirrus_bltbuf);
the_end:
s->cirrus_srccount... | static void cirrus_bitblt_cputovideo_next(CirrusVGAState * s)
{
int copy_count;
uint8_t *end_ptr;
if (s->cirrus_srccounter > 0) {
if (s->cirrus_blt_mode & CIRRUS_BLTMODE_PATTERNCOPY) {
cirrus_bitblt_common_patterncopy(s, s->cirrus_bltbuf);
the_end:
s->cirrus_srccount... | 47 |
1 | static void vp6_parse_coeff_huffman(VP56Context *s) { VP56Model *model = s->modelp; uint8_t *permute = s->scantable.permutated; VLC *vlc_coeff; int coeff, sign, coeff_idx; int b, cg, idx; int pt = 0; /* plane type (0 for Y, 1 for U or V) */ for (b=0; b<6; b++) { int ct = 0; /* code type */ if (b > 3) pt = 1; vlc_coeff ... | static void vp6_parse_coeff_huffman(VP56Context *s) { VP56Model *model = s->modelp; uint8_t *permute = s->scantable.permutated; VLC *vlc_coeff; int coeff, sign, coeff_idx; int b, cg, idx; int pt = 0; for (b=0; b<6; b++) { int ct = 0; if (b > 3) pt = 1; vlc_coeff = &s->dccv_vlc[pt]; for (coeff_idx=0; coeff_idx<64; )... | 48 |
1 | static int em_ret_far(struct x86_emulate_ctxt *ctxt)
{
int rc;
unsigned long eip, cs;
u16 old_cs;
int cpl = ctxt->ops->cpl(ctxt);
struct desc_struct old_desc, new_desc;
const struct x86_emulate_ops *ops = ctxt->ops;
if (ctxt->mode == X86EMUL_MODE_PROT64)
ops->get_segment(ctxt, &old_cs, &old_desc, NULL,
V... | static int em_ret_far(struct x86_emulate_ctxt *ctxt)
{
int rc;
unsigned long eip, cs;
u16 old_cs;
int cpl = ctxt->ops->cpl(ctxt);
struct desc_struct old_desc, new_desc;
const struct x86_emulate_ops *ops = ctxt->ops;
if (ctxt->mode == X86EMUL_MODE_PROT64)
ops->get_segment(ctxt, &old_cs, &old_desc, NULL,
V... | 50 |
1 | static int vncws_start_tls_handshake(VncState *vs) { int ret = gnutls_handshake(vs->tls.session); if (ret < 0) { if (!gnutls_error_is_fatal(ret)) { VNC_DEBUG("Handshake interrupted (blocking)\n"); if (!gnutls_record_get_direction(vs->tls.session)) { qemu_set_fd_handler(vs->csock, vncws_tls_handshake_io, NULL, vs); } el... | static int vncws_start_tls_handshake(VncState *vs) { int ret = gnutls_handshake(vs->tls.session); if (ret < 0) { if (!gnutls_error_is_fatal(ret)) { VNC_DEBUG("Handshake interrupted (blocking)\n"); if (!gnutls_record_get_direction(vs->tls.session)) { qemu_set_fd_handler(vs->csock, vncws_tls_handshake_io, NULL, vs); } el... | 53 |
1 | static int em_fxrstor(struct x86_emulate_ctxt *ctxt)
{
struct fxregs_state fx_state;
int rc;
rc = check_fxsr(ctxt);
if (rc != X86EMUL_CONTINUE)
return rc;
rc = segmented_read(ctxt, ctxt->memop.addr.mem, &fx_state, 512);
if (rc != X86EMUL_CONTINUE)
return rc;
if (fx_state.mxcsr >> 16)
return emulate_gp(c... | static int em_fxrstor(struct x86_emulate_ctxt *ctxt)
{
struct fxregs_state fx_state;
int rc;
rc = check_fxsr(ctxt);
if (rc != X86EMUL_CONTINUE)
return rc;
rc = segmented_read(ctxt, ctxt->memop.addr.mem, &fx_state, 512);
if (rc != X86EMUL_CONTINUE)
return rc;
if (fx_state.mxcsr >> 16)
return emulate_gp(c... | 54 |
0 | static void test_list_fields ( ) {
MYSQL_RES * result ;
int rc ;
myheader ( "test_list_fields" ) ;
rc = mysql_query ( mysql , "drop table if exists t1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "create table t1(c1 int primary key auto_increment, c2 char(10) default 'mysql')" ) ;
myquery ( rc ) ;
result = ... | static void test_list_fields ( ) {
MYSQL_RES * result ;
int rc ;
myheader ( "test_list_fields" ) ;
rc = mysql_query ( mysql , "drop table if exists t1" ) ;
myquery ( rc ) ;
rc = mysql_query ( mysql , "create table t1(c1 int primary key auto_increment, c2 char(10) default 'mysql')" ) ;
myquery ( rc ) ;
result = ... | 56 |
1 | check_1_6_dummy(kadm5_principal_ent_t entry, long mask,
int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char **passptr)
{
int i;
char *password = *passptr;
/* Old-style randkey operations disallowed tickets to start. */
if (!(mask & KADM5_ATTRIBUTES) ||
!(entry->attributes & KRB5... | check_1_6_dummy(kadm5_principal_ent_t entry, long mask,
int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char **passptr)
{
int i;
char *password = *passptr;
if (!(mask & KADM5_ATTRIBUTES) ||
!(entry->attributes & KRB5_KDB_DISALLOW_ALL_TIX))
return;
for (i = 0;... | 57 |
0 | check_1_6_dummy(kadm5_principal_ent_t entry, long mask,
int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char **passptr)
{
int i;
char *password = *passptr;
/* Old-style randkey operations disallowed tickets to start. */
if (password == NULL || !(mask & KADM5_ATTRIBUTES) ||
!(entr... | check_1_6_dummy(kadm5_principal_ent_t entry, long mask,
int n_ks_tuple, krb5_key_salt_tuple *ks_tuple, char **passptr)
{
int i;
char *password = *passptr;
if (password == NULL || !(mask & KADM5_ATTRIBUTES) ||
!(entry->attributes & KRB5_KDB_DISALLOW_ALL_TIX))
return;
... | 58 |
1 | asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
char __user * type, unsigned long flags,
void __user * data)
{
unsigned long type_page;
unsigned long data_page;
unsigned long dev_page;
char *dir_page;
int retval;
retval = copy_mount_options (type, &type_page);
if (retv... | asmlinkage long compat_sys_mount(char __user * dev_name, char __user * dir_name,
char __user * type, unsigned long flags,
void __user * data)
{
unsigned long type_page;
unsigned long data_page;
unsigned long dev_page;
char *dir_page;
int retval;
retval = copy_mount_options (type, &type_page);
if (retv... | 60 |
0 | static void ohci_eof_timer ( OHCIState * ohci ) {
ohci -> sof_time = qemu_clock_get_ns ( QEMU_CLOCK_VIRTUAL ) ;
timer_mod ( ohci -> eof_timer , ohci -> sof_time + usb_frame_time ) ;
} | static void ohci_eof_timer ( OHCIState * ohci ) {
ohci -> sof_time = qemu_clock_get_ns ( QEMU_CLOCK_VIRTUAL ) ;
timer_mod ( ohci -> eof_timer , ohci -> sof_time + usb_frame_time ) ;
} | 62 |
1 | unsigned short atalk_checksum(struct ddpehdr *ddp, int len)
{
unsigned long sum = 0; /* Assume unsigned long is >16 bits */
unsigned char *data = (unsigned char *)ddp;
len -= 4; /* skip header 4 bytes */
data += 4;
/* This ought to be unwrapped neatly. I'll trust gcc for now */
while (len--) {
sum += *data;... | unsigned short atalk_checksum(struct ddpehdr *ddp, int len)
{
unsigned long sum = 0;
unsigned char *data = (unsigned char *)ddp;
len -= 4;
data += 4;
while (len--) {
sum += *data;
sum <<= 1;
if (sum & 0x10000) {
sum++;
sum &= 0xFFFF;
}
data++;
}
return sum ? htons((unsigned short)su... | 63 |
0 | process_chpw_request(krb5_context context, void *server_handle, char *realm,
krb5_keytab keytab, const krb5_fulladdr *local_faddr,
const krb5_fulladdr *remote_faddr, krb5_data *req,
krb5_data *rep)
{
krb5_error_code ret;
char *ptr;
unsigned int ... | process_chpw_request(krb5_context context, void *server_handle, char *realm,
krb5_keytab keytab, const krb5_fulladdr *local_faddr,
const krb5_fulladdr *remote_faddr, krb5_data *req,
krb5_data *rep)
{
krb5_error_code ret;
char *ptr;
unsigned int ... | 64 |
1 | static int em_fxsave(struct x86_emulate_ctxt *ctxt)
{
struct fxregs_state fx_state;
size_t size;
int rc;
rc = check_fxsr(ctxt);
if (rc != X86EMUL_CONTINUE)
return rc;
ctxt->ops->get_fpu(ctxt);
rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
ctxt->ops->put_fpu(ctxt);
if (rc != X86EMUL_CONTINUE)
r... | static int em_fxsave(struct x86_emulate_ctxt *ctxt)
{
struct fxregs_state fx_state;
size_t size;
int rc;
rc = check_fxsr(ctxt);
if (rc != X86EMUL_CONTINUE)
return rc;
ctxt->ops->get_fpu(ctxt);
rc = asm_safe("fxsave %[fx]", , [fx] "+m"(fx_state));
ctxt->ops->put_fpu(ctxt);
if (rc != X86EMUL_CONTINUE)
r... | 65 |
1 | static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp) { char *backing_file = NULL; char *backing_fmt = NULL; char *buf = NULL; uint64_t size = 0; int flags = 0; size_t cluster_size = DEFAULT_CLUSTER_SIZE; PreallocMode prealloc; int version; uint64_t refcount_bits; int refcount_order; const char *e... | static int qcow2_create(const char *filename, QemuOpts *opts, Error **errp) { char *backing_file = NULL; char *backing_fmt = NULL; char *buf = NULL; uint64_t size = 0; int flags = 0; size_t cluster_size = DEFAULT_CLUSTER_SIZE; PreallocMode prealloc; int version; uint64_t refcount_bits; int refcount_order; const char *e... | 66 |
1 | process_chpw_request(krb5_context context, void *server_handle, char *realm,
krb5_keytab keytab, const krb5_fulladdr *local_faddr,
const krb5_fulladdr *remote_faddr, krb5_data *req,
krb5_data *rep)
{
krb5_error_code ret;
char *ptr;
unsigned int ... | process_chpw_request(krb5_context context, void *server_handle, char *realm,
krb5_keytab keytab, const krb5_fulladdr *local_faddr,
const krb5_fulladdr *remote_faddr, krb5_data *req,
krb5_data *rep)
{
krb5_error_code ret;
char *ptr;
unsigned int ... | 67 |
1 | static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
/* Expand any short form frames */
if (skb->mac.raw[2] == 1) {
struct ddpehdr *ddp;
/* Find our address */
struct atalk_addr *ap = atalk_find_dev_addr(dev);
if (!ap || skb->len < sizeof(struct ddpshdr))
goto fre... | static int ltalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
if (skb->mac.raw[2] == 1) {
struct ddpehdr *ddp;
struct atalk_addr *ap = atalk_find_dev_addr(dev);
if (!ap || skb->len < sizeof(struct ddpshdr))
goto freeit;
skb_push(skb, sizeof(*ddp) - 4);
ddp... | 70 |
1 | init_ctx_reselect(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc,
OM_uint32 acc_negState, gss_OID supportedMech,
gss_buffer_t *responseToken, gss_buffer_t *mechListMIC,
OM_uint32 *negState, send_token_flag *tokflag)
{
OM_uint32 tmpmin;
size_t i;
generic_gss_release_oid(&tmpmin, &sc->internal_mech);
gs... | init_ctx_reselect(OM_uint32 *minor_status, spnego_gss_ctx_id_t sc,
OM_uint32 acc_negState, gss_OID supportedMech,
gss_buffer_t *responseToken, gss_buffer_t *mechListMIC,
OM_uint32 *negState, send_token_flag *tokflag)
{
OM_uint32 tmpmin;
size_t i;
generic_gss_release_oid(&tmpmin, &sc->internal_mech);
gs... | 72 |
0 | static void pdo_stmt_iter_move_forwards ( zend_object_iterator * iter TSRMLS_DC ) {
struct php_pdo_iterator * I = ( struct php_pdo_iterator * ) iter -> data ;
if ( I -> fetch_ahead ) {
zval_ptr_dtor ( & I -> fetch_ahead ) ;
I -> fetch_ahead = NULL ;
}
MAKE_STD_ZVAL ( I -> fetch_ahead ) ;
if ( ! do_fetch ( I -> s... | static void pdo_stmt_iter_move_forwards ( zend_object_iterator * iter TSRMLS_DC ) {
struct php_pdo_iterator * I = ( struct php_pdo_iterator * ) iter -> data ;
if ( I -> fetch_ahead ) {
zval_ptr_dtor ( & I -> fetch_ahead ) ;
I -> fetch_ahead = NULL ;
}
MAKE_STD_ZVAL ( I -> fetch_ahead ) ;
if ( ! do_fetch ( I -> s... | 74 |
1 | static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
struct ddpehdr *ddp = ddp_hdr(skb);
struct sock *sock;
struct atalk_iface *atif;
struct sockaddr_at tosat;
int origlen;
struct ddpebits ddphv;
/* Size check */
if (skb->len < sizeof(*ddp))
goto fr... | static int atalk_rcv(struct sk_buff *skb, struct net_device *dev,
struct packet_type *pt)
{
struct ddpehdr *ddp = ddp_hdr(skb);
struct sock *sock;
struct atalk_iface *atif;
struct sockaddr_at tosat;
int origlen;
struct ddpebits ddphv;
if (skb->len < sizeof(*ddp))
goto freeit;
*((_... | 75 |
1 | long do_sigreturn(CPUPPCState *env) { struct target_sigcontext *sc = NULL; struct target_mcontext *sr = NULL; target_ulong sr_addr = 0, sc_addr; sigset_t blocked; target_sigset_t set; sc_addr = env->gpr[1] + SIGNAL_FRAMESIZE; if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) goto sigsegv; #if defined(TARGET_PPC64) se... | long do_sigreturn(CPUPPCState *env) { struct target_sigcontext *sc = NULL; struct target_mcontext *sr = NULL; target_ulong sr_addr = 0, sc_addr; sigset_t blocked; target_sigset_t set; sc_addr = env->gpr[1] + SIGNAL_FRAMESIZE; if (!lock_user_struct(VERIFY_READ, sc, sc_addr, 1)) goto sigsegv; #if defined(TARGET_PPC64) se... | 76 |
1 | static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
int len)
{
struct sock *sk = sock->sk;
struct atalk_sock *at = at_sk(sk);
struct sockaddr_at *usat = (struct sockaddr_at *)msg->msg_name;
int flags = msg->msg_flags;
int loopback = 0;
struct sockaddr_at local_satalk, gsat;
... | static int atalk_sendmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg,
int len)
{
struct sock *sk = sock->sk;
struct atalk_sock *at = at_sk(sk);
struct sockaddr_at *usat = (struct sockaddr_at *)msg->msg_name;
int flags = msg->msg_flags;
int loopback = 0;
struct sockaddr_at local_satalk, gsat;
... | 77 |
1 | static int fat_ioctl_filldir(void *__buf, const char *name, int name_len,
loff_t offset, u64 ino, unsigned int d_type)
{
struct fat_ioctl_filldir_callback *buf = __buf;
struct dirent __user *d1 = buf->dirent;
struct dirent __user *d2 = d1 + 1;
if (buf->result)
return -EINVAL;
buf->result++;
if (name !... | static int fat_ioctl_filldir(void *__buf, const char *name, int name_len,
loff_t offset, u64 ino, unsigned int d_type)
{
struct fat_ioctl_filldir_callback *buf = __buf;
struct dirent __user *d1 = buf->dirent;
struct dirent __user *d2 = d1 + 1;
if (buf->result)
return -EINVAL;
buf->result++;
if (name !... | 78 |
0 | static inline PixelTrait GetPixelGreenTraits ( const Image * restrict image ) {
return ( image -> channel_map [ GreenPixelChannel ] . traits ) ;
} | static inline PixelTrait GetPixelGreenTraits ( const Image * restrict image ) {
return ( image -> channel_map [ GreenPixelChannel ] . traits ) ;
} | 79 |