blob_id
stringlengths
40
40
directory_id
stringlengths
40
40
path
stringlengths
3
264
content_id
stringlengths
40
40
detected_licenses
listlengths
0
85
license_type
stringclasses
2 values
repo_name
stringlengths
5
140
snapshot_id
stringlengths
40
40
revision_id
stringlengths
40
40
branch_name
stringclasses
905 values
visit_date
timestamp[us]date
2015-08-09 11:21:18
2023-09-06 10:45:07
revision_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-17 19:19:19
committer_date
timestamp[us]date
1997-09-14 05:04:47
2023-09-06 06:22:19
github_id
int64
3.89k
681M
star_events_count
int64
0
209k
fork_events_count
int64
0
110k
gha_license_id
stringclasses
22 values
gha_event_created_at
timestamp[us]date
2012-06-07 00:51:45
2023-09-14 21:58:39
gha_created_at
timestamp[us]date
2008-03-27 23:40:48
2023-08-21 23:17:38
gha_language
stringclasses
141 values
src_encoding
stringclasses
34 values
language
stringclasses
1 value
is_vendor
bool
1 class
is_generated
bool
2 classes
length_bytes
int64
3
10.4M
extension
stringclasses
115 values
content
stringlengths
3
10.4M
authors
listlengths
1
1
author_id
stringlengths
0
158
77f0e7a872511fb3552d5832f5db7befc1721969
95fc9763929e66297a6a700aaa2fd59e93ec4c37
/2/MP2/MP2/Salesman.cpp
1d03a57d99c6365ac5f99512923b058fab58983e
[]
no_license
endlesslydivided/MathP_2_2
1658c1a83763ef1a1da2f957234716fde452e164
dc631565607359656b4a5fc262391b88d7ab0571
refs/heads/main
2023-03-30T07:01:40.562409
2021-04-05T07:25:08
2021-04-05T07:25:08
354,753,187
1
0
null
null
null
null
WINDOWS-1251
C++
false
false
1,713
cpp
#include "Salesman.h" int sum(int x1, int x2) // суммирование с учетом бесконечности { return (x1 == INF || x2 == INF) ? INF : (x1 + x2); }; int* firstpath(int n) // формирование 1го маршрута 0,1,2,..., n-1, 0 { int* rc = new int[n + 1]; rc[n] = 0; for (int i = 0; i < n; i++) rc[i] = i; return rc; }; int* source(int n) // формирование исходного массива 1,2,..., n-1 { int* rc = new int[n - 1]; for (int i = 1; i < n; i++) rc[i - 1] = i; return rc; }; void copypath(int n, int* r1, const int* r2) // копировать маршрут { for (int i = 0; i < n; i++) r1[i] = r2[i]; }; int distance(int n, int* r, const int* d) // длина маршрута { int rc = 0; for (int i = 0; i < n - 1; i++) rc = sum(rc, d[r[i] * n + r[i + 1]]); return sum(rc, d[r[n - 1] * n + 0]); //+ последняя дуга (n-1,0) }; void indx(int n, int* r, const int* s, const short* ntx) { for (int i = 1; i < n; i++) r[i] = s[ntx[i - 1]]; } int salesman( int n, // [in] количество городов const int* d, // [in] массив [n*n] расстояний int* r // [out] массив [n] маршрут 0 x x x x ) { int* s = source(n), * b = firstpath(n), rc = INF, dist = 0; combi3::permutation p(n - 1); int k = p.getfirst(); while (k >= 0) // цикл генерации перестановок { indx(n, b, s, p.sset); // новый маршрут if ((dist = distance(n, b, d)) < rc) { rc = dist; copypath(n, r, b); } k = p.getnext(); }; return rc; }
[ "sashakovalev2002@hotmail.com" ]
sashakovalev2002@hotmail.com
485662f427758a8691e26cb25556c3ebb6dff9c6
fc5cf6e087df5b7934ceed7d2a1d22b094197ff1
/processed/12-189-9.cc
8490c885d922319b12653f26ea53234bbdcddd1e
[ "MIT" ]
permissive
giulianobelinassi/LTO-Timing-Analysis
80767a682960d2f2b1944edaf116466a784ac984
12eb7f3444f6c938c0a225f61aec47e419526490
refs/heads/master
2023-01-30T09:20:12.705767
2020-12-10T00:30:16
2020-12-10T00:30:16
263,368,860
1
0
MIT
2020-10-27T23:16:33
2020-05-12T14:59:34
C++
UTF-8
C++
false
false
838,998
cc
# 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" # 1 "/home/giulianob/gcc_git_gnu/build_temp/gcc//" # 1 "<built-in>" # 1 "<command-line>" # 1 "/usr/include/stdc-predef.h" 1 3 4 # 1 "<command-line>" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" # 21 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" # 1 "./config.h" 1 # 1 "./auto-host.h" 1 # 7 "./config.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" 1 # 40 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" extern "C" { # 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" } # 9 "./config.h" 2 # 22 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 1 # 32 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 1 3 4 # 40 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4 # 40 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4 typedef __builtin_va_list __gnuc_va_list; # 99 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdarg.h" 3 4 typedef __gnuc_va_list va_list; # 33 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 43 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 143 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4 typedef long int ptrdiff_t; # 209 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4 typedef long unsigned int size_t; # 415 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4 typedef struct { long long __max_align_ll __attribute__((__aligned__(__alignof__(long long)))); long double __max_align_ld __attribute__((__aligned__(__alignof__(long double)))); # 426 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 3 4 } max_align_t; typedef decltype(nullptr) nullptr_t; # 44 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/stdio.h" 1 3 4 # 27 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4 # 1 "/usr/include/features.h" 1 3 4 # 461 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4 # 452 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 453 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4 # 454 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4 # 462 "/usr/include/features.h" 2 3 4 # 485 "/usr/include/features.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4 # 486 "/usr/include/features.h" 2 3 4 # 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4 # 28 "/usr/include/stdio.h" 2 3 4 extern "C" { # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 34 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timesize.h" 1 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned char __u_char; typedef unsigned short int __u_short; typedef unsigned int __u_int; typedef unsigned long int __u_long; typedef signed char __int8_t; typedef unsigned char __uint8_t; typedef signed short int __int16_t; typedef unsigned short int __uint16_t; typedef signed int __int32_t; typedef unsigned int __uint32_t; typedef signed long int __int64_t; typedef unsigned long int __uint64_t; typedef __int8_t __int_least8_t; typedef __uint8_t __uint_least8_t; typedef __int16_t __int_least16_t; typedef __uint16_t __uint_least16_t; typedef __int32_t __int_least32_t; typedef __uint32_t __uint_least32_t; typedef __int64_t __int_least64_t; typedef __uint64_t __uint_least64_t; typedef long int __quad_t; typedef unsigned long int __u_quad_t; typedef long int __intmax_t; typedef unsigned long int __uintmax_t; # 141 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4 # 142 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time64.h" 1 3 4 # 143 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4 typedef unsigned long int __dev_t; typedef unsigned int __uid_t; typedef unsigned int __gid_t; typedef unsigned long int __ino_t; typedef unsigned long int __ino64_t; typedef unsigned int __mode_t; typedef unsigned long int __nlink_t; typedef long int __off_t; typedef long int __off64_t; typedef int __pid_t; typedef struct { int __val[2]; } __fsid_t; typedef long int __clock_t; typedef unsigned long int __rlim_t; typedef unsigned long int __rlim64_t; typedef unsigned int __id_t; typedef long int __time_t; typedef unsigned int __useconds_t; typedef long int __suseconds_t; typedef int __daddr_t; typedef int __key_t; typedef int __clockid_t; typedef void * __timer_t; typedef long int __blksize_t; typedef long int __blkcnt_t; typedef long int __blkcnt64_t; typedef unsigned long int __fsblkcnt_t; typedef unsigned long int __fsblkcnt64_t; typedef unsigned long int __fsfilcnt_t; typedef unsigned long int __fsfilcnt64_t; typedef long int __fsword_t; typedef long int __ssize_t; typedef long int __syscall_slong_t; typedef unsigned long int __syscall_ulong_t; typedef __off64_t __loff_t; typedef char *__caddr_t; typedef long int __intptr_t; typedef unsigned int __socklen_t; typedef int __sig_atomic_t; # 39 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4 # 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4 typedef struct { int __count; union { unsigned int __wch; char __wchb[4]; } __value; } __mbstate_t; # 6 "/usr/include/x86_64-linux-gnu/bits/types/__fpos_t.h" 2 3 4 typedef struct _G_fpos_t { __off_t __pos; __mbstate_t __state; } __fpos_t; # 40 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/bits/types/__fpos64_t.h" 3 4 typedef struct _G_fpos64_t { __off64_t __pos; __mbstate_t __state; } __fpos64_t; # 41 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE __FILE; # 42 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4 struct _IO_FILE; typedef struct _IO_FILE FILE; # 43 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/types/struct_FILE.h" 3 4 struct _IO_FILE; struct _IO_marker; struct _IO_codecvt; struct _IO_wide_data; typedef void _IO_lock_t; struct _IO_FILE { int _flags; char *_IO_read_ptr; char *_IO_read_end; char *_IO_read_base; char *_IO_write_base; char *_IO_write_ptr; char *_IO_write_end; char *_IO_buf_base; char *_IO_buf_end; char *_IO_save_base; char *_IO_backup_base; char *_IO_save_end; struct _IO_marker *_markers; struct _IO_FILE *_chain; int _fileno; int _flags2; __off_t _old_offset; unsigned short _cur_column; signed char _vtable_offset; char _shortbuf[1]; _IO_lock_t *_lock; __off64_t _offset; struct _IO_codecvt *_codecvt; struct _IO_wide_data *_wide_data; struct _IO_FILE *_freeres_list; void *_freeres_buf; size_t __pad5; int _mode; char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)]; }; # 44 "/usr/include/stdio.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/types/cookie_io_functions_t.h" 3 4 typedef __ssize_t cookie_read_function_t (void *__cookie, char *__buf, size_t __nbytes); typedef __ssize_t cookie_write_function_t (void *__cookie, const char *__buf, size_t __nbytes); typedef int cookie_seek_function_t (void *__cookie, __off64_t *__pos, int __w); typedef int cookie_close_function_t (void *__cookie); typedef struct _IO_cookie_io_functions_t { cookie_read_function_t *read; cookie_write_function_t *write; cookie_seek_function_t *seek; cookie_close_function_t *close; } cookie_io_functions_t; # 47 "/usr/include/stdio.h" 2 3 4 # 63 "/usr/include/stdio.h" 3 4 typedef __off_t off_t; typedef __off64_t off64_t; typedef __ssize_t ssize_t; typedef __fpos_t fpos_t; typedef __fpos64_t fpos64_t; # 133 "/usr/include/stdio.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4 # 134 "/usr/include/stdio.h" 2 3 4 extern FILE *stdin; extern FILE *stdout; extern FILE *stderr; extern int remove (const char *__filename) throw (); extern int rename (const char *__old, const char *__new) throw (); extern int renameat (int __oldfd, const char *__old, int __newfd, const char *__new) throw (); # 164 "/usr/include/stdio.h" 3 4 extern int renameat2 (int __oldfd, const char *__old, int __newfd, const char *__new, unsigned int __flags) throw (); extern FILE *tmpfile (void) ; # 183 "/usr/include/stdio.h" 3 4 extern FILE *tmpfile64 (void) ; extern char *tmpnam (char *__s) throw () ; extern char *tmpnam_r (char *__s) throw () ; # 204 "/usr/include/stdio.h" 3 4 extern char *tempnam (const char *__dir, const char *__pfx) throw () __attribute__ ((__malloc__)) ; extern int fclose (FILE *__stream); extern int fflush (FILE *__stream); # 227 "/usr/include/stdio.h" 3 4 extern int fflush_unlocked (FILE *__stream); # 237 "/usr/include/stdio.h" 3 4 extern int fcloseall (void); # 246 "/usr/include/stdio.h" 3 4 extern FILE *fopen (const char *__restrict __filename, const char *__restrict __modes) ; extern FILE *freopen (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) ; # 270 "/usr/include/stdio.h" 3 4 extern FILE *fopen64 (const char *__restrict __filename, const char *__restrict __modes) ; extern FILE *freopen64 (const char *__restrict __filename, const char *__restrict __modes, FILE *__restrict __stream) ; extern FILE *fdopen (int __fd, const char *__modes) throw () ; extern FILE *fopencookie (void *__restrict __magic_cookie, const char *__restrict __modes, cookie_io_functions_t __io_funcs) throw () ; extern FILE *fmemopen (void *__s, size_t __len, const char *__modes) throw () ; extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) throw () ; extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) throw (); extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf, int __modes, size_t __n) throw (); extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf, size_t __size) throw (); extern void setlinebuf (FILE *__stream) throw (); extern int fprintf (FILE *__restrict __stream, const char *__restrict __format, ...); extern int printf (const char *__restrict __format, ...); extern int sprintf (char *__restrict __s, const char *__restrict __format, ...) throw (); extern int vfprintf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg); extern int vsprintf (char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) throw (); extern int snprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, ...) throw () __attribute__ ((__format__ (__printf__, 3, 4))); extern int vsnprintf (char *__restrict __s, size_t __maxlen, const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__printf__, 3, 0))); extern int vasprintf (char **__restrict __ptr, const char *__restrict __f, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__printf__, 2, 0))) ; extern int __asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int asprintf (char **__restrict __ptr, const char *__restrict __fmt, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))) ; extern int vdprintf (int __fd, const char *__restrict __fmt, __gnuc_va_list __arg) __attribute__ ((__format__ (__printf__, 2, 0))); extern int dprintf (int __fd, const char *__restrict __fmt, ...) __attribute__ ((__format__ (__printf__, 2, 3))); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) ; extern int scanf (const char *__restrict __format, ...) ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) throw (); extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf") ; extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf") ; extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) throw () __asm__ ("" "__isoc99_sscanf") ; # 432 "/usr/include/stdio.h" 3 4 extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) throw () __attribute__ ((__format__ (__scanf__, 2, 0))); extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf") __attribute__ ((__format__ (__scanf__, 2, 0))) ; extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf") __attribute__ ((__format__ (__scanf__, 1, 0))) ; extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) throw () __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__format__ (__scanf__, 2, 0))); # 485 "/usr/include/stdio.h" 3 4 extern int fgetc (FILE *__stream); extern int getc (FILE *__stream); extern int getchar (void); extern int getc_unlocked (FILE *__stream); extern int getchar_unlocked (void); # 510 "/usr/include/stdio.h" 3 4 extern int fgetc_unlocked (FILE *__stream); # 521 "/usr/include/stdio.h" 3 4 extern int fputc (int __c, FILE *__stream); extern int putc (int __c, FILE *__stream); extern int putchar (int __c); # 537 "/usr/include/stdio.h" 3 4 extern int fputc_unlocked (int __c, FILE *__stream); extern int putc_unlocked (int __c, FILE *__stream); extern int putchar_unlocked (int __c); extern int getw (FILE *__stream); extern int putw (int __w, FILE *__stream); extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 587 "/usr/include/stdio.h" 3 4 extern char *fgets_unlocked (char *__restrict __s, int __n, FILE *__restrict __stream) ; # 603 "/usr/include/stdio.h" 3 4 extern __ssize_t __getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getdelim (char **__restrict __lineptr, size_t *__restrict __n, int __delimiter, FILE *__restrict __stream) ; extern __ssize_t getline (char **__restrict __lineptr, size_t *__restrict __n, FILE *__restrict __stream) ; extern int fputs (const char *__restrict __s, FILE *__restrict __stream); extern int puts (const char *__s); extern int ungetc (int __c, FILE *__stream); extern size_t fread (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __s); # 662 "/usr/include/stdio.h" 3 4 extern int fputs_unlocked (const char *__restrict __s, FILE *__restrict __stream); # 673 "/usr/include/stdio.h" 3 4 extern size_t fread_unlocked (void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream) ; extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size, size_t __n, FILE *__restrict __stream); extern int fseek (FILE *__stream, long int __off, int __whence); extern long int ftell (FILE *__stream) ; extern void rewind (FILE *__stream); # 707 "/usr/include/stdio.h" 3 4 extern int fseeko (FILE *__stream, __off_t __off, int __whence); extern __off_t ftello (FILE *__stream) ; # 731 "/usr/include/stdio.h" 3 4 extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos); extern int fsetpos (FILE *__stream, const fpos_t *__pos); # 750 "/usr/include/stdio.h" 3 4 extern int fseeko64 (FILE *__stream, __off64_t __off, int __whence); extern __off64_t ftello64 (FILE *__stream) ; extern int fgetpos64 (FILE *__restrict __stream, fpos64_t *__restrict __pos); extern int fsetpos64 (FILE *__stream, const fpos64_t *__pos); extern void clearerr (FILE *__stream) throw (); extern int feof (FILE *__stream) throw () ; extern int ferror (FILE *__stream) throw () ; extern void clearerr_unlocked (FILE *__stream) throw (); extern int feof_unlocked (FILE *__stream) throw () ; extern int ferror_unlocked (FILE *__stream) throw () ; extern void perror (const char *__s); # 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4 extern int sys_nerr; extern const char *const sys_errlist[]; extern int _sys_nerr; extern const char *const _sys_errlist[]; # 782 "/usr/include/stdio.h" 2 3 4 extern int fileno (FILE *__stream) throw () ; extern int fileno_unlocked (FILE *__stream) throw () ; # 800 "/usr/include/stdio.h" 3 4 extern FILE *popen (const char *__command, const char *__modes) ; extern int pclose (FILE *__stream); extern char *ctermid (char *__s) throw (); extern char *cuserid (char *__s); struct obstack; extern int obstack_printf (struct obstack *__restrict __obstack, const char *__restrict __format, ...) throw () __attribute__ ((__format__ (__printf__, 2, 3))); extern int obstack_vprintf (struct obstack *__restrict __obstack, const char *__restrict __format, __gnuc_va_list __args) throw () __attribute__ ((__format__ (__printf__, 2, 0))); extern void flockfile (FILE *__stream) throw (); extern int ftrylockfile (FILE *__stream) throw () ; extern void funlockfile (FILE *__stream) throw (); # 858 "/usr/include/stdio.h" 3 4 extern int __uflow (FILE *); extern int __overflow (FILE *, int); # 1 "/usr/include/x86_64-linux-gnu/bits/stdio.h" 1 3 4 # 38 "/usr/include/x86_64-linux-gnu/bits/stdio.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int vprintf (const char *__restrict __fmt, __gnuc_va_list __arg) { return vfprintf (stdout, __fmt, __arg); } extern __inline __attribute__ ((__gnu_inline__)) int getchar (void) { return getc (stdin); } extern __inline __attribute__ ((__gnu_inline__)) int fgetc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getc_unlocked (FILE *__fp) { return (__builtin_expect (((__fp)->_IO_read_ptr >= (__fp)->_IO_read_end), 0) ? __uflow (__fp) : *(unsigned char *) (__fp)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int getchar_unlocked (void) { return (__builtin_expect (((stdin)->_IO_read_ptr >= (stdin)->_IO_read_end), 0) ? __uflow (stdin) : *(unsigned char *) (stdin)->_IO_read_ptr++); } extern __inline __attribute__ ((__gnu_inline__)) int putchar (int __c) { return putc (__c, stdout); } extern __inline __attribute__ ((__gnu_inline__)) int fputc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putc_unlocked (int __c, FILE *__stream) { return (__builtin_expect (((__stream)->_IO_write_ptr >= (__stream)->_IO_write_end), 0) ? __overflow (__stream, (unsigned char) (__c)) : (unsigned char) (*(__stream)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) int putchar_unlocked (int __c) { return (__builtin_expect (((stdout)->_IO_write_ptr >= (stdout)->_IO_write_end), 0) ? __overflow (stdout, (unsigned char) (__c)) : (unsigned char) (*(stdout)->_IO_write_ptr++ = (__c))); } extern __inline __attribute__ ((__gnu_inline__)) __ssize_t getline (char **__lineptr, size_t *__n, FILE *__stream) { return __getdelim (__lineptr, __n, '\n', __stream); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) feof_unlocked (FILE *__stream) throw () { return (((__stream)->_flags & 0x0010) != 0); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) ferror_unlocked (FILE *__stream) throw () { return (((__stream)->_flags & 0x0020) != 0); } # 865 "/usr/include/stdio.h" 2 3 4 # 873 "/usr/include/stdio.h" 3 4 } # 47 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 103 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 103 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" extern "C" { # 187 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" } # 209 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" 1 # 57 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" enum { _sch_isblank = 0x0001, _sch_iscntrl = 0x0002, _sch_isdigit = 0x0004, _sch_islower = 0x0008, _sch_isprint = 0x0010, _sch_ispunct = 0x0020, _sch_isspace = 0x0040, _sch_isupper = 0x0080, _sch_isxdigit = 0x0100, _sch_isidst = 0x0200, _sch_isvsp = 0x0400, _sch_isnvsp = 0x0800, _sch_isalpha = _sch_isupper|_sch_islower, _sch_isalnum = _sch_isalpha|_sch_isdigit, _sch_isidnum = _sch_isidst|_sch_isdigit, _sch_isgraph = _sch_isalnum|_sch_ispunct, _sch_iscppsp = _sch_isvsp|_sch_isnvsp, _sch_isbasic = _sch_isprint|_sch_iscppsp }; extern const unsigned short _sch_istable[256]; # 110 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" extern const unsigned char _sch_toupper[256]; extern const unsigned char _sch_tolower[256]; # 122 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" # 1 "/usr/include/ctype.h" 1 3 4 # 28 "/usr/include/ctype.h" 3 4 # 28 "/usr/include/ctype.h" 3 4 extern "C" { # 39 "/usr/include/ctype.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/endianness.h" 1 3 4 # 36 "/usr/include/x86_64-linux-gnu/bits/endian.h" 2 3 4 # 40 "/usr/include/ctype.h" 2 3 4 enum { _ISupper = ((0) < 8 ? ((1 << (0)) << 8) : ((1 << (0)) >> 8)), _ISlower = ((1) < 8 ? ((1 << (1)) << 8) : ((1 << (1)) >> 8)), _ISalpha = ((2) < 8 ? ((1 << (2)) << 8) : ((1 << (2)) >> 8)), _ISdigit = ((3) < 8 ? ((1 << (3)) << 8) : ((1 << (3)) >> 8)), _ISxdigit = ((4) < 8 ? ((1 << (4)) << 8) : ((1 << (4)) >> 8)), _ISspace = ((5) < 8 ? ((1 << (5)) << 8) : ((1 << (5)) >> 8)), _ISprint = ((6) < 8 ? ((1 << (6)) << 8) : ((1 << (6)) >> 8)), _ISgraph = ((7) < 8 ? ((1 << (7)) << 8) : ((1 << (7)) >> 8)), _ISblank = ((8) < 8 ? ((1 << (8)) << 8) : ((1 << (8)) >> 8)), _IScntrl = ((9) < 8 ? ((1 << (9)) << 8) : ((1 << (9)) >> 8)), _ISpunct = ((10) < 8 ? ((1 << (10)) << 8) : ((1 << (10)) >> 8)), _ISalnum = ((11) < 8 ? ((1 << (11)) << 8) : ((1 << (11)) >> 8)) }; # 79 "/usr/include/ctype.h" 3 4 extern const unsigned short int **__ctype_b_loc (void) throw () __attribute__ ((__const__)); extern const __int32_t **__ctype_tolower_loc (void) throw () __attribute__ ((__const__)); extern const __int32_t **__ctype_toupper_loc (void) throw () __attribute__ ((__const__)); # 108 "/usr/include/ctype.h" 3 4 extern int isalnum (int) throw (); extern int isalpha (int) throw (); extern int iscntrl (int) throw (); extern int isdigit (int) throw (); extern int islower (int) throw (); extern int isgraph (int) throw (); extern int isprint (int) throw (); extern int ispunct (int) throw (); extern int isspace (int) throw (); extern int isupper (int) throw (); extern int isxdigit (int) throw (); extern int tolower (int __c) throw (); extern int toupper (int __c) throw (); extern int isblank (int) throw (); extern int isctype (int __c, int __mask) throw (); extern int isascii (int __c) throw (); extern int toascii (int __c) throw (); extern int _toupper (int) throw (); extern int _tolower (int) throw (); # 174 "/usr/include/ctype.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int isalnum (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISalnum; } extern __inline __attribute__ ((__gnu_inline__)) int isalpha (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISalpha; } extern __inline __attribute__ ((__gnu_inline__)) int iscntrl (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _IScntrl; } extern __inline __attribute__ ((__gnu_inline__)) int isdigit (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISdigit; } extern __inline __attribute__ ((__gnu_inline__)) int islower (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISlower; } extern __inline __attribute__ ((__gnu_inline__)) int isgraph (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISgraph; } extern __inline __attribute__ ((__gnu_inline__)) int isprint (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISprint; } extern __inline __attribute__ ((__gnu_inline__)) int ispunct (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISpunct; } extern __inline __attribute__ ((__gnu_inline__)) int isspace (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISspace; } extern __inline __attribute__ ((__gnu_inline__)) int isupper (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISupper; } extern __inline __attribute__ ((__gnu_inline__)) int isxdigit (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISxdigit; } extern __inline __attribute__ ((__gnu_inline__)) int isblank (int __c) throw () { return (*__ctype_b_loc ())[(int) (__c)] & (unsigned short int) _ISblank; } # 206 "/usr/include/ctype.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) tolower (int __c) throw () { return __c >= -128 && __c < 256 ? (*__ctype_tolower_loc ())[__c] : __c; } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) toupper (int __c) throw () { return __c >= -128 && __c < 256 ? (*__ctype_toupper_loc ())[__c] : __c; } # 237 "/usr/include/ctype.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4 struct __locale_struct { struct __locale_data *__locales[13]; const unsigned short int *__ctype_b; const int *__ctype_tolower; const int *__ctype_toupper; const char *__names[13]; }; typedef struct __locale_struct *__locale_t; # 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4 typedef __locale_t locale_t; # 238 "/usr/include/ctype.h" 2 3 4 # 251 "/usr/include/ctype.h" 3 4 extern int isalnum_l (int, locale_t) throw (); extern int isalpha_l (int, locale_t) throw (); extern int iscntrl_l (int, locale_t) throw (); extern int isdigit_l (int, locale_t) throw (); extern int islower_l (int, locale_t) throw (); extern int isgraph_l (int, locale_t) throw (); extern int isprint_l (int, locale_t) throw (); extern int ispunct_l (int, locale_t) throw (); extern int isspace_l (int, locale_t) throw (); extern int isupper_l (int, locale_t) throw (); extern int isxdigit_l (int, locale_t) throw (); extern int isblank_l (int, locale_t) throw (); extern int __tolower_l (int __c, locale_t __l) throw (); extern int tolower_l (int __c, locale_t __l) throw (); extern int __toupper_l (int __c, locale_t __l) throw (); extern int toupper_l (int __c, locale_t __l) throw (); # 327 "/usr/include/ctype.h" 3 4 } # 123 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/safe-ctype.h" 2 # 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 extern "C" { typedef __u_char u_char; typedef __u_short u_short; typedef __u_int u_int; typedef __u_long u_long; typedef __quad_t quad_t; typedef __u_quad_t u_quad_t; typedef __fsid_t fsid_t; typedef __loff_t loff_t; typedef __ino_t ino_t; typedef __ino64_t ino64_t; typedef __dev_t dev_t; typedef __gid_t gid_t; typedef __mode_t mode_t; typedef __nlink_t nlink_t; typedef __uid_t uid_t; # 97 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __pid_t pid_t; typedef __id_t id_t; # 114 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __daddr_t daddr_t; typedef __caddr_t caddr_t; typedef __key_t key_t; # 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4 typedef __clock_t clock_t; # 127 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4 typedef __clockid_t clockid_t; # 129 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4 typedef __time_t time_t; # 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4 typedef __timer_t timer_t; # 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef __useconds_t useconds_t; typedef __suseconds_t suseconds_t; # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef unsigned long int ulong; typedef unsigned short int ushort; typedef unsigned int uint; # 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4 typedef __int8_t int8_t; typedef __int16_t int16_t; typedef __int32_t int32_t; typedef __int64_t int64_t; # 156 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef __uint8_t u_int8_t; typedef __uint16_t u_int16_t; typedef __uint32_t u_int32_t; typedef __uint64_t u_int64_t; typedef int register_t __attribute__ ((__mode__ (__word__))); # 176 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 # 1 "/usr/include/endian.h" 1 3 4 # 35 "/usr/include/endian.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4 # 33 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 static __inline __uint16_t __bswap_16 (__uint16_t __bsx) { return __builtin_bswap16 (__bsx); } static __inline __uint32_t __bswap_32 (__uint32_t __bsx) { return __builtin_bswap32 (__bsx); } # 69 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4 __extension__ static __inline __uint64_t __bswap_64 (__uint64_t __bsx) { return __builtin_bswap64 (__bsx); } # 36 "/usr/include/endian.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4 # 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4 static __inline __uint16_t __uint16_identity (__uint16_t __x) { return __x; } static __inline __uint32_t __uint32_identity (__uint32_t __x) { return __x; } static __inline __uint64_t __uint64_identity (__uint64_t __x) { return __x; } # 37 "/usr/include/endian.h" 2 3 4 # 177 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4 # 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/select.h" 2 3 4 # 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4 typedef struct { unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))]; } __sigset_t; # 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4 typedef __sigset_t sigset_t; # 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4 struct timeval { __time_t tv_sec; __suseconds_t tv_usec; }; # 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4 # 10 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4 struct timespec { __time_t tv_sec; __syscall_slong_t tv_nsec; # 26 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 3 4 }; # 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4 # 49 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 typedef long int __fd_mask; # 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 typedef struct { __fd_mask fds_bits[1024 / (8 * (int) sizeof (__fd_mask))]; } fd_set; typedef __fd_mask fd_mask; # 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern "C" { # 101 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern int select (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, struct timeval *__restrict __timeout); # 113 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 extern int pselect (int __nfds, fd_set *__restrict __readfds, fd_set *__restrict __writefds, fd_set *__restrict __exceptfds, const struct timespec *__restrict __timeout, const __sigset_t *__restrict __sigmask); # 126 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4 } # 180 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 typedef __blksize_t blksize_t; typedef __blkcnt_t blkcnt_t; typedef __fsblkcnt_t fsblkcnt_t; typedef __fsfilcnt_t fsfilcnt_t; # 219 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4 typedef __blkcnt64_t blkcnt64_t; typedef __fsblkcnt64_t fsblkcnt64_t; typedef __fsfilcnt64_t fsfilcnt64_t; # 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4 # 44 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4 # 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4 # 45 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 typedef struct __pthread_internal_list { struct __pthread_internal_list *__prev; struct __pthread_internal_list *__next; } __pthread_list_t; typedef struct __pthread_internal_slist { struct __pthread_internal_slist *__next; } __pthread_slist_t; # 74 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4 struct __pthread_mutex_s { int __lock; unsigned int __count; int __owner; unsigned int __nusers; int __kind; short __spins; short __elision; __pthread_list_t __list; # 53 "/usr/include/x86_64-linux-gnu/bits/struct_mutex.h" 3 4 }; # 75 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 # 87 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4 struct __pthread_rwlock_arch_t { unsigned int __readers; unsigned int __writers; unsigned int __wrphase_futex; unsigned int __writers_futex; unsigned int __pad3; unsigned int __pad4; int __cur_writer; int __shared; signed char __rwelision; unsigned char __pad1[7]; unsigned long int __pad2; unsigned int __flags; # 55 "/usr/include/x86_64-linux-gnu/bits/struct_rwlock.h" 3 4 }; # 88 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4 struct __pthread_cond_s { __extension__ union { __extension__ unsigned long long int __wseq; struct { unsigned int __low; unsigned int __high; } __wseq32; }; __extension__ union { __extension__ unsigned long long int __g1_start; struct { unsigned int __low; unsigned int __high; } __g1_start32; }; unsigned int __g_refs[2] ; unsigned int __g_size[2]; unsigned int __g1_orig_size; unsigned int __wrefs; unsigned int __g_signals[2]; }; # 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4 typedef unsigned long int pthread_t; typedef union { char __size[4]; int __align; } pthread_mutexattr_t; typedef union { char __size[4]; int __align; } pthread_condattr_t; typedef unsigned int pthread_key_t; typedef int pthread_once_t; union pthread_attr_t { char __size[56]; long int __align; }; typedef union pthread_attr_t pthread_attr_t; typedef union { struct __pthread_mutex_s __data; char __size[40]; long int __align; } pthread_mutex_t; typedef union { struct __pthread_cond_s __data; char __size[48]; __extension__ long long int __align; } pthread_cond_t; typedef union { struct __pthread_rwlock_arch_t __data; char __size[56]; long int __align; } pthread_rwlock_t; typedef union { char __size[8]; long int __align; } pthread_rwlockattr_t; typedef volatile int pthread_spinlock_t; typedef union { char __size[32]; long int __align; } pthread_barrier_t; typedef union { char __size[4]; int __align; } pthread_barrierattr_t; # 228 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4 } # 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/errno.h" 1 3 4 # 28 "/usr/include/errno.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4 # 1 "/usr/include/linux/errno.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno.h" 1 3 4 # 1 "/usr/include/asm-generic/errno-base.h" 1 3 4 # 6 "/usr/include/asm-generic/errno.h" 2 3 4 # 2 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4 # 2 "/usr/include/linux/errno.h" 2 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4 # 29 "/usr/include/errno.h" 2 3 4 extern "C" { extern int *__errno_location (void) throw () __attribute__ ((__const__)); extern char *program_invocation_name; extern char *program_invocation_short_name; # 1 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/types/error_t.h" 3 4 typedef int error_t; # 49 "/usr/include/errno.h" 2 3 4 } # 214 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 235 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/c++/10/cstring" 1 3 # 39 "/usr/include/c++/10/cstring" 3 # 40 "/usr/include/c++/10/cstring" 3 # 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 1 3 # 262 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3 namespace std { typedef long unsigned int size_t; typedef long int ptrdiff_t; typedef decltype(nullptr) nullptr_t; } # 284 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3 namespace std { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } namespace __gnu_cxx { inline namespace __cxx11 __attribute__((__abi_tag__ ("cxx11"))) { } } # 522 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 3 # 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/os_defines.h" 1 3 # 523 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 2 3 # 1 "/usr/include/x86_64-linux-gnu/c++/10/bits/cpu_defines.h" 1 3 # 526 "/usr/include/x86_64-linux-gnu/c++/10/bits/c++config.h" 2 3 # 42 "/usr/include/c++/10/cstring" 2 3 # 1 "/usr/include/string.h" 1 3 4 # 26 "/usr/include/string.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/string.h" 2 3 4 extern "C" { # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 34 "/usr/include/string.h" 2 3 4 # 43 "/usr/include/string.h" 3 4 extern void *memcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern void *memmove (void *__dest, const void *__src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern void *memccpy (void *__restrict __dest, const void *__restrict __src, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern void *memset (void *__s, int __c, size_t __n) throw () __attribute__ ((__nonnull__ (1))); extern int memcmp (const void *__s1, const void *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" { extern void *memchr (void *__s, int __c, size_t __n) throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const void *memchr (const void *__s, int __c, size_t __n) throw () __asm ("memchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) void * memchr (void *__s, int __c, size_t __n) throw () { return __builtin_memchr (__s, __c, __n); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const void * memchr (const void *__s, int __c, size_t __n) throw () { return __builtin_memchr (__s, __c, __n); } } # 99 "/usr/include/string.h" 3 4 extern "C++" void *rawmemchr (void *__s, int __c) throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" const void *rawmemchr (const void *__s, int __c) throw () __asm ("rawmemchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" void *memrchr (void *__s, int __c, size_t __n) throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" const void *memrchr (const void *__s, int __c, size_t __n) throw () __asm ("memrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 122 "/usr/include/string.h" 3 4 extern char *strcpy (char *__restrict __dest, const char *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *strncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *strcat (char *__restrict __dest, const char *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *strncat (char *__restrict __dest, const char *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern int strcmp (const char *__s1, const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncmp (const char *__s1, const char *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcoll (const char *__s1, const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strxfrm (char *__restrict __dest, const char *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (2))); extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n, locale_t __l) throw () __attribute__ ((__nonnull__ (2, 4))); extern char *strdup (const char *__s) throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); extern char *strndup (const char *__string, size_t __n) throw () __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1))); # 204 "/usr/include/string.h" 3 4 extern "C++" { extern char *strchr (char *__s, int __c) throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *strchr (const char *__s, int __c) throw () __asm ("strchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strchr (char *__s, int __c) throw () { return __builtin_strchr (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strchr (const char *__s, int __c) throw () { return __builtin_strchr (__s, __c); } } extern "C++" { extern char *strrchr (char *__s, int __c) throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *strrchr (const char *__s, int __c) throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strrchr (char *__s, int __c) throw () { return __builtin_strrchr (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strrchr (const char *__s, int __c) throw () { return __builtin_strrchr (__s, __c); } } # 261 "/usr/include/string.h" 3 4 extern "C++" char *strchrnul (char *__s, int __c) throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern "C++" const char *strchrnul (const char *__s, int __c) throw () __asm ("strchrnul") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); # 273 "/usr/include/string.h" 3 4 extern size_t strcspn (const char *__s, const char *__reject) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern size_t strspn (const char *__s, const char *__accept) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" { extern char *strpbrk (char *__s, const char *__accept) throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern const char *strpbrk (const char *__s, const char *__accept) throw () __asm ("strpbrk") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strpbrk (char *__s, const char *__accept) throw () { return __builtin_strpbrk (__s, __accept); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strpbrk (const char *__s, const char *__accept) throw () { return __builtin_strpbrk (__s, __accept); } } extern "C++" { extern char *strstr (char *__haystack, const char *__needle) throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern const char *strstr (const char *__haystack, const char *__needle) throw () __asm ("strstr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * strstr (char *__haystack, const char *__needle) throw () { return __builtin_strstr (__haystack, __needle); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * strstr (const char *__haystack, const char *__needle) throw () { return __builtin_strstr (__haystack, __needle); } } extern char *strtok (char *__restrict __s, const char *__restrict __delim) throw () __attribute__ ((__nonnull__ (2))); extern char *__strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) throw () __attribute__ ((__nonnull__ (2, 3))); extern char *strtok_r (char *__restrict __s, const char *__restrict __delim, char **__restrict __save_ptr) throw () __attribute__ ((__nonnull__ (2, 3))); extern "C++" char *strcasestr (char *__haystack, const char *__needle) throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern "C++" const char *strcasestr (const char *__haystack, const char *__needle) throw () __asm ("strcasestr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); # 369 "/usr/include/string.h" 3 4 extern void *memmem (const void *__haystack, size_t __haystacklen, const void *__needle, size_t __needlelen) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 3))); extern void *__mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern void *mempcpy (void *__restrict __dest, const void *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern size_t strlen (const char *__s) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern size_t strnlen (const char *__string, size_t __maxlen) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern char *strerror (int __errnum) throw (); # 421 "/usr/include/string.h" 3 4 extern char *strerror_r (int __errnum, char *__buf, size_t __buflen) throw () __attribute__ ((__nonnull__ (2))) ; extern char *strerror_l (int __errnum, locale_t __l) throw (); # 1 "/usr/include/strings.h" 1 3 4 # 23 "/usr/include/strings.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 24 "/usr/include/strings.h" 2 3 4 extern "C" { extern int bcmp (const void *__s1, const void *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern void bcopy (const void *__src, void *__dest, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern void bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); extern "C++" { extern char *index (char *__s, int __c) throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *index (const char *__s, int __c) throw () __asm ("index") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * index (char *__s, int __c) throw () { return __builtin_index (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * index (const char *__s, int __c) throw () { return __builtin_index (__s, __c); } } extern "C++" { extern char *rindex (char *__s, int __c) throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern const char *rindex (const char *__s, int __c) throw () __asm ("rindex") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))); extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) char * rindex (char *__s, int __c) throw () { return __builtin_rindex (__s, __c); } extern __inline __attribute__ ((__always_inline__)) __attribute__ ((__gnu_inline__)) const char * rindex (const char *__s, int __c) throw () { return __builtin_rindex (__s, __c); } } # 104 "/usr/include/strings.h" 3 4 extern int ffs (int __i) throw () __attribute__ ((__const__)); extern int ffsl (long int __l) throw () __attribute__ ((__const__)); __extension__ extern int ffsll (long long int __ll) throw () __attribute__ ((__const__)); extern int strcasecmp (const char *__s1, const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strncasecmp (const char *__s1, const char *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3))); extern int strncasecmp_l (const char *__s1, const char *__s2, size_t __n, locale_t __loc) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4))); } # 433 "/usr/include/string.h" 2 3 4 extern void explicit_bzero (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); extern char *strsep (char **__restrict __stringp, const char *__restrict __delim) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *strsignal (int __sig) throw (); extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *stpcpy (char *__restrict __dest, const char *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *__stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern char *stpncpy (char *__restrict __dest, const char *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern int strverscmp (const char *__s1, const char *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern char *strfry (char *__string) throw () __attribute__ ((__nonnull__ (1))); extern void *memfrob (void *__s, size_t __n) throw () __attribute__ ((__nonnull__ (1))); extern "C++" char *basename (char *__filename) throw () __asm ("basename") __attribute__ ((__nonnull__ (1))); extern "C++" const char *basename (const char *__filename) throw () __asm ("basename") __attribute__ ((__nonnull__ (1))); # 499 "/usr/include/string.h" 3 4 } # 43 "/usr/include/c++/10/cstring" 2 3 # 71 "/usr/include/c++/10/cstring" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { using ::memchr; using ::memcmp; using ::memcpy; using ::memmove; using ::memset; using ::strcat; using ::strcmp; using ::strcoll; using ::strcpy; using ::strcspn; using ::strerror; using ::strlen; using ::strncat; using ::strncmp; using ::strncpy; using ::strspn; using ::strtok; using ::strxfrm; using ::strchr; using ::strpbrk; using ::strrchr; using ::strstr; # 122 "/usr/include/c++/10/cstring" 3 } } # 236 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/c++/10/new" 1 3 # 38 "/usr/include/c++/10/new" 3 # 39 "/usr/include/c++/10/new" 3 # 1 "/usr/include/c++/10/exception" 1 3 # 33 "/usr/include/c++/10/exception" 3 # 34 "/usr/include/c++/10/exception" 3 #pragma GCC visibility push(default) # 1 "/usr/include/c++/10/bits/exception.h" 1 3 # 34 "/usr/include/c++/10/bits/exception.h" 3 # 35 "/usr/include/c++/10/bits/exception.h" 3 #pragma GCC visibility push(default) extern "C++" { namespace std { # 60 "/usr/include/c++/10/bits/exception.h" 3 class exception { public: exception() noexcept { } virtual ~exception() noexcept; exception(const exception&) = default; exception& operator=(const exception&) = default; exception(exception&&) = default; exception& operator=(exception&&) = default; virtual const char* what() const noexcept; }; } } #pragma GCC visibility pop # 39 "/usr/include/c++/10/exception" 2 3 extern "C++" { namespace std { class bad_exception : public exception { public: bad_exception() noexcept { } virtual ~bad_exception() noexcept; virtual const char* what() const noexcept; }; typedef void (*terminate_handler) (); typedef void (*unexpected_handler) (); terminate_handler set_terminate(terminate_handler) noexcept; terminate_handler get_terminate() noexcept; void terminate() noexcept __attribute__ ((__noreturn__)); unexpected_handler set_unexpected(unexpected_handler) noexcept; unexpected_handler get_unexpected() noexcept; void unexpected() __attribute__ ((__noreturn__)); # 105 "/usr/include/c++/10/exception" 3 bool uncaught_exception() noexcept __attribute__ ((__pure__)); int uncaught_exceptions() noexcept __attribute__ ((__pure__)); } namespace __gnu_cxx { # 137 "/usr/include/c++/10/exception" 3 void __verbose_terminate_handler(); } } #pragma GCC visibility pop # 1 "/usr/include/c++/10/bits/exception_ptr.h" 1 3 # 34 "/usr/include/c++/10/bits/exception_ptr.h" 3 #pragma GCC visibility push(default) # 1 "/usr/include/c++/10/bits/exception_defines.h" 1 3 # 38 "/usr/include/c++/10/bits/exception_ptr.h" 2 3 # 1 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 1 3 # 34 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3 # 35 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3 #pragma GCC visibility push(default) # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 39 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 2 3 # 50 "/usr/include/c++/10/bits/cxxabi_init_exception.h" 3 namespace std { class type_info; } namespace __cxxabiv1 { struct __cxa_refcounted_exception; extern "C" { void* __cxa_allocate_exception(size_t) noexcept; void __cxa_free_exception(void*) noexcept; __cxa_refcounted_exception* __cxa_init_primary_exception(void *object, std::type_info *tinfo, void ( *dest) (void *)) noexcept; } } #pragma GCC visibility pop # 39 "/usr/include/c++/10/bits/exception_ptr.h" 2 3 # 1 "/usr/include/c++/10/typeinfo" 1 3 # 32 "/usr/include/c++/10/typeinfo" 3 # 33 "/usr/include/c++/10/typeinfo" 3 # 1 "/usr/include/c++/10/bits/hash_bytes.h" 1 3 # 33 "/usr/include/c++/10/bits/hash_bytes.h" 3 # 34 "/usr/include/c++/10/bits/hash_bytes.h" 3 namespace std { size_t _Hash_bytes(const void* __ptr, size_t __len, size_t __seed); size_t _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed); } # 37 "/usr/include/c++/10/typeinfo" 2 3 #pragma GCC visibility push(default) extern "C++" { namespace __cxxabiv1 { class __class_type_info; } # 80 "/usr/include/c++/10/typeinfo" 3 namespace std { class type_info { public: virtual ~type_info(); const char* name() const noexcept { return __name[0] == '*' ? __name + 1 : __name; } # 115 "/usr/include/c++/10/typeinfo" 3 bool before(const type_info& __arg) const noexcept { return (__name[0] == '*' && __arg.__name[0] == '*') ? __name < __arg.__name : __builtin_strcmp (__name, __arg.__name) < 0; } bool operator==(const type_info& __arg) const noexcept { return ((__name == __arg.__name) || (__name[0] != '*' && __builtin_strcmp (__name, __arg.__name) == 0)); } # 138 "/usr/include/c++/10/typeinfo" 3 bool operator!=(const type_info& __arg) const noexcept { return !operator==(__arg); } size_t hash_code() const noexcept { return _Hash_bytes(name(), __builtin_strlen(name()), static_cast<size_t>(0xc70f6907UL)); } virtual bool __is_pointer_p() const; virtual bool __is_function_p() const; virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj, unsigned __outer) const; virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target, void **__obj_ptr) const; protected: const char *__name; explicit type_info(const char *__n): __name(__n) { } private: type_info& operator=(const type_info&); type_info(const type_info&); }; class bad_cast : public exception { public: bad_cast() noexcept { } virtual ~bad_cast() noexcept; virtual const char* what() const noexcept; }; class bad_typeid : public exception { public: bad_typeid () noexcept { } virtual ~bad_typeid() noexcept; virtual const char* what() const noexcept; }; } } #pragma GCC visibility pop # 40 "/usr/include/c++/10/bits/exception_ptr.h" 2 3 # 1 "/usr/include/c++/10/new" 1 3 # 41 "/usr/include/c++/10/bits/exception_ptr.h" 2 3 extern "C++" { namespace std { class type_info; namespace __exception_ptr { class exception_ptr; } using __exception_ptr::exception_ptr; exception_ptr current_exception() noexcept; template<typename _Ex> exception_ptr make_exception_ptr(_Ex) noexcept; void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__)); namespace __exception_ptr { using std::rethrow_exception; class exception_ptr { void* _M_exception_object; explicit exception_ptr(void* __e) noexcept; void _M_addref() noexcept; void _M_release() noexcept; void *_M_get() const noexcept __attribute__ ((__pure__)); friend exception_ptr std::current_exception() noexcept; friend void std::rethrow_exception(exception_ptr); template<typename _Ex> friend exception_ptr std::make_exception_ptr(_Ex) noexcept; public: exception_ptr() noexcept; exception_ptr(const exception_ptr&) noexcept; exception_ptr(nullptr_t) noexcept : _M_exception_object(0) { } exception_ptr(exception_ptr&& __o) noexcept : _M_exception_object(__o._M_exception_object) { __o._M_exception_object = 0; } # 118 "/usr/include/c++/10/bits/exception_ptr.h" 3 exception_ptr& operator=(const exception_ptr&) noexcept; exception_ptr& operator=(exception_ptr&& __o) noexcept { exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this); return *this; } ~exception_ptr() noexcept; void swap(exception_ptr&) noexcept; # 145 "/usr/include/c++/10/bits/exception_ptr.h" 3 explicit operator bool() const { return _M_exception_object; } friend bool operator==(const exception_ptr&, const exception_ptr&) noexcept __attribute__ ((__pure__)); const class std::type_info* __cxa_exception_type() const noexcept __attribute__ ((__pure__)); }; bool operator==(const exception_ptr&, const exception_ptr&) noexcept __attribute__ ((__pure__)); bool operator!=(const exception_ptr&, const exception_ptr&) noexcept __attribute__ ((__pure__)); inline void swap(exception_ptr& __lhs, exception_ptr& __rhs) { __lhs.swap(__rhs); } template<typename _Ex> inline void __dest_thunk(void* __x) { static_cast<_Ex*>(__x)->~_Ex(); } } template<typename _Ex> exception_ptr make_exception_ptr(_Ex __ex) noexcept { # 213 "/usr/include/c++/10/bits/exception_ptr.h" 3 return exception_ptr(); } } } #pragma GCC visibility pop # 148 "/usr/include/c++/10/exception" 2 3 # 1 "/usr/include/c++/10/bits/nested_exception.h" 1 3 # 33 "/usr/include/c++/10/bits/nested_exception.h" 3 #pragma GCC visibility push(default) # 1 "/usr/include/c++/10/bits/move.h" 1 3 # 38 "/usr/include/c++/10/bits/move.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { template<typename _Tp> inline constexpr _Tp* __addressof(_Tp& __r) noexcept { return __builtin_addressof(__r); } } # 1 "/usr/include/c++/10/type_traits" 1 3 # 32 "/usr/include/c++/10/type_traits" 3 # 33 "/usr/include/c++/10/type_traits" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 56 "/usr/include/c++/10/type_traits" 3 template<typename _Tp, _Tp __v> struct integral_constant { static constexpr _Tp value = __v; typedef _Tp value_type; typedef integral_constant<_Tp, __v> type; constexpr operator value_type() const noexcept { return value; } constexpr value_type operator()() const noexcept { return value; } }; template<typename _Tp, _Tp __v> constexpr _Tp integral_constant<_Tp, __v>::value; typedef integral_constant<bool, true> true_type; typedef integral_constant<bool, false> false_type; template<bool __v> using __bool_constant = integral_constant<bool, __v>; # 91 "/usr/include/c++/10/type_traits" 3 template<bool, typename, typename> struct conditional; template <typename _Type> struct __type_identity { using type = _Type; }; template<typename _Tp> using __type_identity_t = typename __type_identity<_Tp>::type; template<typename...> struct __or_; template<> struct __or_<> : public false_type { }; template<typename _B1> struct __or_<_B1> : public _B1 { }; template<typename _B1, typename _B2> struct __or_<_B1, _B2> : public conditional<_B1::value, _B1, _B2>::type { }; template<typename _B1, typename _B2, typename _B3, typename... _Bn> struct __or_<_B1, _B2, _B3, _Bn...> : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type { }; template<typename...> struct __and_; template<> struct __and_<> : public true_type { }; template<typename _B1> struct __and_<_B1> : public _B1 { }; template<typename _B1, typename _B2> struct __and_<_B1, _B2> : public conditional<_B1::value, _B2, _B1>::type { }; template<typename _B1, typename _B2, typename _B3, typename... _Bn> struct __and_<_B1, _B2, _B3, _Bn...> : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type { }; template<typename _Pp> struct __not_ : public __bool_constant<!bool(_Pp::value)> { }; # 188 "/usr/include/c++/10/type_traits" 3 template<typename> struct is_reference; template<typename> struct is_function; template<typename> struct is_void; template<typename> struct __is_array_unknown_bounds; template <typename _Tp, size_t = sizeof(_Tp)> constexpr true_type __is_complete_or_unbounded(__type_identity<_Tp>) { return {}; } template <typename _TypeIdentity, typename _NestedType = typename _TypeIdentity::type> constexpr typename __or_< is_reference<_NestedType>, is_function<_NestedType>, is_void<_NestedType>, __is_array_unknown_bounds<_NestedType> >::type __is_complete_or_unbounded(_TypeIdentity) { return {}; } template<typename _Tp> struct __success_type { typedef _Tp type; }; struct __failure_type { }; template<typename> struct remove_cv; template<typename _Tp> using __remove_cv_t = typename remove_cv<_Tp>::type; template<typename> struct is_const; template<typename> struct __is_void_helper : public false_type { }; template<> struct __is_void_helper<void> : public true_type { }; template<typename _Tp> struct is_void : public __is_void_helper<__remove_cv_t<_Tp>>::type { }; template<typename> struct __is_integral_helper : public false_type { }; template<> struct __is_integral_helper<bool> : public true_type { }; template<> struct __is_integral_helper<char> : public true_type { }; template<> struct __is_integral_helper<signed char> : public true_type { }; template<> struct __is_integral_helper<unsigned char> : public true_type { }; template<> struct __is_integral_helper<wchar_t> : public true_type { }; # 284 "/usr/include/c++/10/type_traits" 3 template<> struct __is_integral_helper<char16_t> : public true_type { }; template<> struct __is_integral_helper<char32_t> : public true_type { }; template<> struct __is_integral_helper<short> : public true_type { }; template<> struct __is_integral_helper<unsigned short> : public true_type { }; template<> struct __is_integral_helper<int> : public true_type { }; template<> struct __is_integral_helper<unsigned int> : public true_type { }; template<> struct __is_integral_helper<long> : public true_type { }; template<> struct __is_integral_helper<unsigned long> : public true_type { }; template<> struct __is_integral_helper<long long> : public true_type { }; template<> struct __is_integral_helper<unsigned long long> : public true_type { }; template<> struct __is_integral_helper<__int128> : public true_type { }; template<> struct __is_integral_helper<unsigned __int128> : public true_type { }; # 364 "/usr/include/c++/10/type_traits" 3 template<typename _Tp> struct is_integral : public __is_integral_helper<__remove_cv_t<_Tp>>::type { }; template<typename> struct __is_floating_point_helper : public false_type { }; template<> struct __is_floating_point_helper<float> : public true_type { }; template<> struct __is_floating_point_helper<double> : public true_type { }; template<> struct __is_floating_point_helper<long double> : public true_type { }; template<> struct __is_floating_point_helper<__float128> : public true_type { }; template<typename _Tp> struct is_floating_point : public __is_floating_point_helper<__remove_cv_t<_Tp>>::type { }; template<typename> struct is_array : public false_type { }; template<typename _Tp, std::size_t _Size> struct is_array<_Tp[_Size]> : public true_type { }; template<typename _Tp> struct is_array<_Tp[]> : public true_type { }; template<typename> struct __is_pointer_helper : public false_type { }; template<typename _Tp> struct __is_pointer_helper<_Tp*> : public true_type { }; template<typename _Tp> struct is_pointer : public __is_pointer_helper<__remove_cv_t<_Tp>>::type { }; template<typename> struct is_lvalue_reference : public false_type { }; template<typename _Tp> struct is_lvalue_reference<_Tp&> : public true_type { }; template<typename> struct is_rvalue_reference : public false_type { }; template<typename _Tp> struct is_rvalue_reference<_Tp&&> : public true_type { }; template<typename> struct __is_member_object_pointer_helper : public false_type { }; template<typename _Tp, typename _Cp> struct __is_member_object_pointer_helper<_Tp _Cp::*> : public __not_<is_function<_Tp>>::type { }; template<typename _Tp> struct is_member_object_pointer : public __is_member_object_pointer_helper<__remove_cv_t<_Tp>>::type { }; template<typename> struct __is_member_function_pointer_helper : public false_type { }; template<typename _Tp, typename _Cp> struct __is_member_function_pointer_helper<_Tp _Cp::*> : public is_function<_Tp>::type { }; template<typename _Tp> struct is_member_function_pointer : public __is_member_function_pointer_helper<__remove_cv_t<_Tp>>::type { }; template<typename _Tp> struct is_enum : public integral_constant<bool, __is_enum(_Tp)> { }; template<typename _Tp> struct is_union : public integral_constant<bool, __is_union(_Tp)> { }; template<typename _Tp> struct is_class : public integral_constant<bool, __is_class(_Tp)> { }; template<typename _Tp> struct is_function : public __bool_constant<!is_const<const _Tp>::value> { }; template<typename _Tp> struct is_function<_Tp&> : public false_type { }; template<typename _Tp> struct is_function<_Tp&&> : public false_type { }; template<typename> struct __is_null_pointer_helper : public false_type { }; template<> struct __is_null_pointer_helper<std::nullptr_t> : public true_type { }; template<typename _Tp> struct is_null_pointer : public __is_null_pointer_helper<__remove_cv_t<_Tp>>::type { }; template<typename _Tp> struct __is_nullptr_t : public is_null_pointer<_Tp> { } __attribute__ ((__deprecated__ ("use '" "std::is_null_pointer" "' instead"))); template<typename _Tp> struct is_reference : public __or_<is_lvalue_reference<_Tp>, is_rvalue_reference<_Tp>>::type { }; template<typename _Tp> struct is_arithmetic : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type { }; template<typename _Tp> struct is_fundamental : public __or_<is_arithmetic<_Tp>, is_void<_Tp>, is_null_pointer<_Tp>>::type { }; template<typename _Tp> struct is_object : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>, is_void<_Tp>>>::type { }; template<typename> struct is_member_pointer; template<typename _Tp> struct is_scalar : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>, is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type { }; template<typename _Tp> struct is_compound : public __not_<is_fundamental<_Tp>>::type { }; template<typename _Tp> struct __is_member_pointer_helper : public false_type { }; template<typename _Tp, typename _Cp> struct __is_member_pointer_helper<_Tp _Cp::*> : public true_type { }; template<typename _Tp> struct is_member_pointer : public __is_member_pointer_helper<__remove_cv_t<_Tp>>::type { }; template<typename, typename> struct is_same; template<typename _Tp, typename... _Types> using __is_one_of = __or_<is_same<_Tp, _Types>...>; template<typename _Tp> using __is_signed_integer = __is_one_of<__remove_cv_t<_Tp>, signed char, signed short, signed int, signed long, signed long long , signed __int128 # 604 "/usr/include/c++/10/type_traits" 3 >; template<typename _Tp> using __is_unsigned_integer = __is_one_of<__remove_cv_t<_Tp>, unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long , unsigned __int128 # 623 "/usr/include/c++/10/type_traits" 3 >; template<typename _Tp> using __is_standard_integer = __or_<__is_signed_integer<_Tp>, __is_unsigned_integer<_Tp>>; template<typename...> using __void_t = void; template<typename _Tp, typename = void> struct __is_referenceable : public false_type { }; template<typename _Tp> struct __is_referenceable<_Tp, __void_t<_Tp&>> : public true_type { }; template<typename> struct is_const : public false_type { }; template<typename _Tp> struct is_const<_Tp const> : public true_type { }; template<typename> struct is_volatile : public false_type { }; template<typename _Tp> struct is_volatile<_Tp volatile> : public true_type { }; template<typename _Tp> struct is_trivial : public integral_constant<bool, __is_trivial(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_trivially_copyable : public integral_constant<bool, __is_trivially_copyable(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_standard_layout : public integral_constant<bool, __is_standard_layout(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_pod : public integral_constant<bool, __is_pod(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_literal_type : public integral_constant<bool, __is_literal_type(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_empty : public integral_constant<bool, __is_empty(_Tp)> { }; template<typename _Tp> struct is_polymorphic : public integral_constant<bool, __is_polymorphic(_Tp)> { }; template<typename _Tp> struct is_final : public integral_constant<bool, __is_final(_Tp)> { }; template<typename _Tp> struct is_abstract : public integral_constant<bool, __is_abstract(_Tp)> { }; template<typename _Tp, bool = is_arithmetic<_Tp>::value> struct __is_signed_helper : public false_type { }; template<typename _Tp> struct __is_signed_helper<_Tp, true> : public integral_constant<bool, _Tp(-1) < _Tp(0)> { }; template<typename _Tp> struct is_signed : public __is_signed_helper<_Tp>::type { }; template<typename _Tp> struct is_unsigned : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>> { }; # 770 "/usr/include/c++/10/type_traits" 3 template<typename _Tp, typename _Up = _Tp&&> _Up __declval(int); template<typename _Tp> _Tp __declval(long); template<typename _Tp> auto declval() noexcept -> decltype(__declval<_Tp>(0)); template<typename, unsigned = 0> struct extent; template<typename> struct remove_all_extents; template<typename _Tp> struct __is_array_known_bounds : public integral_constant<bool, (extent<_Tp>::value > 0)> { }; template<typename _Tp> struct __is_array_unknown_bounds : public __and_<is_array<_Tp>, __not_<extent<_Tp>>> { }; struct __do_is_destructible_impl { template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())> static true_type __test(int); template<typename> static false_type __test(...); }; template<typename _Tp> struct __is_destructible_impl : public __do_is_destructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template<typename _Tp, bool = __or_<is_void<_Tp>, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value> struct __is_destructible_safe; template<typename _Tp> struct __is_destructible_safe<_Tp, false, false> : public __is_destructible_impl<typename remove_all_extents<_Tp>::type>::type { }; template<typename _Tp> struct __is_destructible_safe<_Tp, true, false> : public false_type { }; template<typename _Tp> struct __is_destructible_safe<_Tp, false, true> : public true_type { }; template<typename _Tp> struct is_destructible : public __is_destructible_safe<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; struct __do_is_nt_destructible_impl { template<typename _Tp> static __bool_constant<noexcept(declval<_Tp&>().~_Tp())> __test(int); template<typename> static false_type __test(...); }; template<typename _Tp> struct __is_nt_destructible_impl : public __do_is_nt_destructible_impl { typedef decltype(__test<_Tp>(0)) type; }; template<typename _Tp, bool = __or_<is_void<_Tp>, __is_array_unknown_bounds<_Tp>, is_function<_Tp>>::value, bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value> struct __is_nt_destructible_safe; template<typename _Tp> struct __is_nt_destructible_safe<_Tp, false, false> : public __is_nt_destructible_impl<typename remove_all_extents<_Tp>::type>::type { }; template<typename _Tp> struct __is_nt_destructible_safe<_Tp, true, false> : public false_type { }; template<typename _Tp> struct __is_nt_destructible_safe<_Tp, false, true> : public true_type { }; template<typename _Tp> struct is_nothrow_destructible : public __is_nt_destructible_safe<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, typename... _Args> struct __is_constructible_impl : public __bool_constant<__is_constructible(_Tp, _Args...)> { }; template<typename _Tp, typename... _Args> struct is_constructible : public __is_constructible_impl<_Tp, _Args...> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_default_constructible : public __is_constructible_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_copy_constructible_impl; template<typename _Tp> struct __is_copy_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_copy_constructible_impl<_Tp, true> : public __is_constructible_impl<_Tp, const _Tp&> { }; template<typename _Tp> struct is_copy_constructible : public __is_copy_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_move_constructible_impl; template<typename _Tp> struct __is_move_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_move_constructible_impl<_Tp, true> : public __is_constructible_impl<_Tp, _Tp&&> { }; template<typename _Tp> struct is_move_constructible : public __is_move_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<bool, typename _Tp, typename... _Args> struct __is_nt_constructible_impl : public false_type { }; template<typename _Tp, typename... _Args> struct __is_nt_constructible_impl<true, _Tp, _Args...> : public __bool_constant<noexcept(_Tp(std::declval<_Args>()...))> { }; template<typename _Tp, typename _Arg> struct __is_nt_constructible_impl<true, _Tp, _Arg> : public __bool_constant<noexcept(static_cast<_Tp>(std::declval<_Arg>()))> { }; template<typename _Tp> struct __is_nt_constructible_impl<true, _Tp> : public __bool_constant<noexcept(_Tp())> { }; template<typename _Tp, size_t _Num> struct __is_nt_constructible_impl<true, _Tp[_Num]> : public __bool_constant<noexcept(typename remove_all_extents<_Tp>::type())> { }; # 1001 "/usr/include/c++/10/type_traits" 3 template<typename _Tp, typename... _Args> using __is_nothrow_constructible_impl = __is_nt_constructible_impl<__is_constructible(_Tp, _Args...), _Tp, _Args...>; template<typename _Tp, typename... _Args> struct is_nothrow_constructible : public __is_nothrow_constructible_impl<_Tp, _Args...>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_nothrow_default_constructible : public __is_nothrow_constructible_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_nothrow_copy_constructible_impl; template<typename _Tp> struct __is_nothrow_copy_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_nothrow_copy_constructible_impl<_Tp, true> : public __is_nothrow_constructible_impl<_Tp, const _Tp&> { }; template<typename _Tp> struct is_nothrow_copy_constructible : public __is_nothrow_copy_constructible_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_nothrow_move_constructible_impl; template<typename _Tp> struct __is_nothrow_move_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_nothrow_move_constructible_impl<_Tp, true> : public __is_nothrow_constructible_impl<_Tp, _Tp&&> { }; template<typename _Tp> struct is_nothrow_move_constructible : public __is_nothrow_move_constructible_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, typename _Up> struct is_assignable : public __bool_constant<__is_assignable(_Tp, _Up)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_copy_assignable_impl; template<typename _Tp> struct __is_copy_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_copy_assignable_impl<_Tp, true> : public __bool_constant<__is_assignable(_Tp&, const _Tp&)> { }; template<typename _Tp> struct is_copy_assignable : public __is_copy_assignable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_move_assignable_impl; template<typename _Tp> struct __is_move_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_move_assignable_impl<_Tp, true> : public __bool_constant<__is_assignable(_Tp&, _Tp&&)> { }; template<typename _Tp> struct is_move_assignable : public __is_move_assignable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, typename _Up> struct __is_nt_assignable_impl : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())> { }; template<typename _Tp, typename _Up> struct __is_nothrow_assignable_impl : public __and_<__bool_constant<__is_assignable(_Tp, _Up)>, __is_nt_assignable_impl<_Tp, _Up>> { }; template<typename _Tp, typename _Up> struct is_nothrow_assignable : public __is_nothrow_assignable_impl<_Tp, _Up> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_nt_copy_assignable_impl; template<typename _Tp> struct __is_nt_copy_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_nt_copy_assignable_impl<_Tp, true> : public __is_nothrow_assignable_impl<_Tp&, const _Tp&> { }; template<typename _Tp> struct is_nothrow_copy_assignable : public __is_nt_copy_assignable_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_nt_move_assignable_impl; template<typename _Tp> struct __is_nt_move_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_nt_move_assignable_impl<_Tp, true> : public __is_nothrow_assignable_impl<_Tp&, _Tp&&> { }; template<typename _Tp> struct is_nothrow_move_assignable : public __is_nt_move_assignable_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, typename... _Args> struct is_trivially_constructible : public __bool_constant<__is_trivially_constructible(_Tp, _Args...)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_trivially_default_constructible : public __bool_constant<__is_trivially_constructible(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; struct __do_is_implicitly_default_constructible_impl { template <typename _Tp> static void __helper(const _Tp&); template <typename _Tp> static true_type __test(const _Tp&, decltype(__helper<const _Tp&>({}))* = 0); static false_type __test(...); }; template<typename _Tp> struct __is_implicitly_default_constructible_impl : public __do_is_implicitly_default_constructible_impl { typedef decltype(__test(declval<_Tp>())) type; }; template<typename _Tp> struct __is_implicitly_default_constructible_safe : public __is_implicitly_default_constructible_impl<_Tp>::type { }; template <typename _Tp> struct __is_implicitly_default_constructible : public __and_<__is_constructible_impl<_Tp>, __is_implicitly_default_constructible_safe<_Tp>> { }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_trivially_copy_constructible_impl; template<typename _Tp> struct __is_trivially_copy_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_trivially_copy_constructible_impl<_Tp, true> : public __and_<__is_copy_constructible_impl<_Tp>, integral_constant<bool, __is_trivially_constructible(_Tp, const _Tp&)>> { }; template<typename _Tp> struct is_trivially_copy_constructible : public __is_trivially_copy_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_trivially_move_constructible_impl; template<typename _Tp> struct __is_trivially_move_constructible_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_trivially_move_constructible_impl<_Tp, true> : public __and_<__is_move_constructible_impl<_Tp>, integral_constant<bool, __is_trivially_constructible(_Tp, _Tp&&)>> { }; template<typename _Tp> struct is_trivially_move_constructible : public __is_trivially_move_constructible_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, typename _Up> struct is_trivially_assignable : public __bool_constant<__is_trivially_assignable(_Tp, _Up)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_trivially_copy_assignable_impl; template<typename _Tp> struct __is_trivially_copy_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_trivially_copy_assignable_impl<_Tp, true> : public __bool_constant<__is_trivially_assignable(_Tp&, const _Tp&)> { }; template<typename _Tp> struct is_trivially_copy_assignable : public __is_trivially_copy_assignable_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __is_trivially_move_assignable_impl; template<typename _Tp> struct __is_trivially_move_assignable_impl<_Tp, false> : public false_type { }; template<typename _Tp> struct __is_trivially_move_assignable_impl<_Tp, true> : public __bool_constant<__is_trivially_assignable(_Tp&, _Tp&&)> { }; template<typename _Tp> struct is_trivially_move_assignable : public __is_trivially_move_assignable_impl<_Tp> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_trivially_destructible : public __and_<__is_destructible_safe<_Tp>, __bool_constant<__has_trivial_destructor(_Tp)>> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct has_virtual_destructor : public integral_constant<bool, __has_virtual_destructor(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct alignment_of : public integral_constant<std::size_t, alignof(_Tp)> { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename> struct rank : public integral_constant<std::size_t, 0> { }; template<typename _Tp, std::size_t _Size> struct rank<_Tp[_Size]> : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; template<typename _Tp> struct rank<_Tp[]> : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { }; template<typename, unsigned _Uint> struct extent : public integral_constant<std::size_t, 0> { }; template<typename _Tp, unsigned _Uint, std::size_t _Size> struct extent<_Tp[_Size], _Uint> : public integral_constant<std::size_t, _Uint == 0 ? _Size : extent<_Tp, _Uint - 1>::value> { }; template<typename _Tp, unsigned _Uint> struct extent<_Tp[], _Uint> : public integral_constant<std::size_t, _Uint == 0 ? 0 : extent<_Tp, _Uint - 1>::value> { }; template<typename _Tp, typename _Up> struct is_same : public integral_constant<bool, __is_same_as(_Tp, _Up)> { }; # 1410 "/usr/include/c++/10/type_traits" 3 template<typename _Base, typename _Derived> struct is_base_of : public integral_constant<bool, __is_base_of(_Base, _Derived)> { }; template<typename _From, typename _To, bool = __or_<is_void<_From>, is_function<_To>, is_array<_To>>::value> struct __is_convertible_helper { typedef typename is_void<_To>::type type; }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" template<typename _From, typename _To> class __is_convertible_helper<_From, _To, false> { template<typename _To1> static void __test_aux(_To1) noexcept; template<typename _From1, typename _To1, typename = decltype(__test_aux<_To1>(std::declval<_From1>()))> static true_type __test(int); template<typename, typename> static false_type __test(...); public: typedef decltype(__test<_From, _To>(0)) type; }; #pragma GCC diagnostic pop template<typename _From, typename _To> struct is_convertible : public __is_convertible_helper<_From, _To>::type { }; template<typename _ToElementType, typename _FromElementType> using __is_array_convertible = is_convertible<_FromElementType(*)[], _ToElementType(*)[]>; template<typename _From, typename _To, bool = __or_<is_void<_From>, is_function<_To>, is_array<_To>>::value> struct __is_nt_convertible_helper : is_void<_To> { }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" template<typename _From, typename _To> class __is_nt_convertible_helper<_From, _To, false> { template<typename _To1> static void __test_aux(_To1) noexcept; template<typename _From1, typename _To1> static __bool_constant<noexcept(__test_aux<_To1>(std::declval<_From1>()))> __test(int); template<typename, typename> static false_type __test(...); public: using type = decltype(__test<_From, _To>(0)); }; #pragma GCC diagnostic pop template<typename _From, typename _To> struct __is_nothrow_convertible : public __is_nt_convertible_helper<_From, _To>::type { }; # 1508 "/usr/include/c++/10/type_traits" 3 template<typename _Tp> struct remove_const { typedef _Tp type; }; template<typename _Tp> struct remove_const<_Tp const> { typedef _Tp type; }; template<typename _Tp> struct remove_volatile { typedef _Tp type; }; template<typename _Tp> struct remove_volatile<_Tp volatile> { typedef _Tp type; }; template<typename _Tp> struct remove_cv { using type = _Tp; }; template<typename _Tp> struct remove_cv<const _Tp> { using type = _Tp; }; template<typename _Tp> struct remove_cv<volatile _Tp> { using type = _Tp; }; template<typename _Tp> struct remove_cv<const volatile _Tp> { using type = _Tp; }; template<typename _Tp> struct add_const { typedef _Tp const type; }; template<typename _Tp> struct add_volatile { typedef _Tp volatile type; }; template<typename _Tp> struct add_cv { typedef typename add_const<typename add_volatile<_Tp>::type>::type type; }; template<typename _Tp> using remove_const_t = typename remove_const<_Tp>::type; template<typename _Tp> using remove_volatile_t = typename remove_volatile<_Tp>::type; template<typename _Tp> using remove_cv_t = typename remove_cv<_Tp>::type; template<typename _Tp> using add_const_t = typename add_const<_Tp>::type; template<typename _Tp> using add_volatile_t = typename add_volatile<_Tp>::type; template<typename _Tp> using add_cv_t = typename add_cv<_Tp>::type; template<typename _Tp> struct remove_reference { typedef _Tp type; }; template<typename _Tp> struct remove_reference<_Tp&> { typedef _Tp type; }; template<typename _Tp> struct remove_reference<_Tp&&> { typedef _Tp type; }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __add_lvalue_reference_helper { typedef _Tp type; }; template<typename _Tp> struct __add_lvalue_reference_helper<_Tp, true> { typedef _Tp& type; }; template<typename _Tp> struct add_lvalue_reference : public __add_lvalue_reference_helper<_Tp> { }; template<typename _Tp, bool = __is_referenceable<_Tp>::value> struct __add_rvalue_reference_helper { typedef _Tp type; }; template<typename _Tp> struct __add_rvalue_reference_helper<_Tp, true> { typedef _Tp&& type; }; template<typename _Tp> struct add_rvalue_reference : public __add_rvalue_reference_helper<_Tp> { }; template<typename _Tp> using remove_reference_t = typename remove_reference<_Tp>::type; template<typename _Tp> using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type; template<typename _Tp> using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type; template<typename _Unqualified, bool _IsConst, bool _IsVol> struct __cv_selector; template<typename _Unqualified> struct __cv_selector<_Unqualified, false, false> { typedef _Unqualified __type; }; template<typename _Unqualified> struct __cv_selector<_Unqualified, false, true> { typedef volatile _Unqualified __type; }; template<typename _Unqualified> struct __cv_selector<_Unqualified, true, false> { typedef const _Unqualified __type; }; template<typename _Unqualified> struct __cv_selector<_Unqualified, true, true> { typedef const volatile _Unqualified __type; }; template<typename _Qualified, typename _Unqualified, bool _IsConst = is_const<_Qualified>::value, bool _IsVol = is_volatile<_Qualified>::value> class __match_cv_qualifiers { typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match; public: typedef typename __match::__type __type; }; template<typename _Tp> struct __make_unsigned { typedef _Tp __type; }; template<> struct __make_unsigned<char> { typedef unsigned char __type; }; template<> struct __make_unsigned<signed char> { typedef unsigned char __type; }; template<> struct __make_unsigned<short> { typedef unsigned short __type; }; template<> struct __make_unsigned<int> { typedef unsigned int __type; }; template<> struct __make_unsigned<long> { typedef unsigned long __type; }; template<> struct __make_unsigned<long long> { typedef unsigned long long __type; }; template<> struct __make_unsigned<__int128> { typedef unsigned __int128 __type; }; # 1730 "/usr/include/c++/10/type_traits" 3 template<typename _Tp, bool _IsInt = is_integral<_Tp>::value, bool _IsEnum = is_enum<_Tp>::value> class __make_unsigned_selector; template<typename _Tp> class __make_unsigned_selector<_Tp, true, false> { using __unsigned_type = typename __make_unsigned<__remove_cv_t<_Tp>>::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type; }; class __make_unsigned_selector_base { protected: template<typename...> struct _List { }; template<typename _Tp, typename... _Up> struct _List<_Tp, _Up...> : _List<_Up...> { static constexpr size_t __size = sizeof(_Tp); }; template<size_t _Sz, typename _Tp, bool = (_Sz <= _Tp::__size)> struct __select; template<size_t _Sz, typename _Uint, typename... _UInts> struct __select<_Sz, _List<_Uint, _UInts...>, true> { using __type = _Uint; }; template<size_t _Sz, typename _Uint, typename... _UInts> struct __select<_Sz, _List<_Uint, _UInts...>, false> : __select<_Sz, _List<_UInts...>> { }; }; template<typename _Tp> class __make_unsigned_selector<_Tp, false, true> : __make_unsigned_selector_base { using _UInts = _List<unsigned char, unsigned short, unsigned int, unsigned long, unsigned long long>; using __unsigned_type = typename __select<sizeof(_Tp), _UInts>::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __unsigned_type>::__type; }; template<> struct __make_unsigned<wchar_t> { using __type = typename __make_unsigned_selector<wchar_t, false, true>::__type; }; # 1806 "/usr/include/c++/10/type_traits" 3 template<> struct __make_unsigned<char16_t> { using __type = typename __make_unsigned_selector<char16_t, false, true>::__type; }; template<> struct __make_unsigned<char32_t> { using __type = typename __make_unsigned_selector<char32_t, false, true>::__type; }; template<typename _Tp> struct make_unsigned { typedef typename __make_unsigned_selector<_Tp>::__type type; }; template<> struct make_unsigned<bool>; template<typename _Tp> struct __make_signed { typedef _Tp __type; }; template<> struct __make_signed<char> { typedef signed char __type; }; template<> struct __make_signed<unsigned char> { typedef signed char __type; }; template<> struct __make_signed<unsigned short> { typedef signed short __type; }; template<> struct __make_signed<unsigned int> { typedef signed int __type; }; template<> struct __make_signed<unsigned long> { typedef signed long __type; }; template<> struct __make_signed<unsigned long long> { typedef signed long long __type; }; template<> struct __make_signed<unsigned __int128> { typedef __int128 __type; }; # 1884 "/usr/include/c++/10/type_traits" 3 template<typename _Tp, bool _IsInt = is_integral<_Tp>::value, bool _IsEnum = is_enum<_Tp>::value> class __make_signed_selector; template<typename _Tp> class __make_signed_selector<_Tp, true, false> { using __signed_type = typename __make_signed<__remove_cv_t<_Tp>>::__type; public: using __type = typename __match_cv_qualifiers<_Tp, __signed_type>::__type; }; template<typename _Tp> class __make_signed_selector<_Tp, false, true> { typedef typename __make_unsigned_selector<_Tp>::__type __unsigned_type; public: typedef typename __make_signed_selector<__unsigned_type>::__type __type; }; template<> struct __make_signed<wchar_t> { using __type = typename __make_signed_selector<wchar_t, false, true>::__type; }; # 1932 "/usr/include/c++/10/type_traits" 3 template<> struct __make_signed<char16_t> { using __type = typename __make_signed_selector<char16_t, false, true>::__type; }; template<> struct __make_signed<char32_t> { using __type = typename __make_signed_selector<char32_t, false, true>::__type; }; template<typename _Tp> struct make_signed { typedef typename __make_signed_selector<_Tp>::__type type; }; template<> struct make_signed<bool>; template<typename _Tp> using make_signed_t = typename make_signed<_Tp>::type; template<typename _Tp> using make_unsigned_t = typename make_unsigned<_Tp>::type; template<typename _Tp> struct remove_extent { typedef _Tp type; }; template<typename _Tp, std::size_t _Size> struct remove_extent<_Tp[_Size]> { typedef _Tp type; }; template<typename _Tp> struct remove_extent<_Tp[]> { typedef _Tp type; }; template<typename _Tp> struct remove_all_extents { typedef _Tp type; }; template<typename _Tp, std::size_t _Size> struct remove_all_extents<_Tp[_Size]> { typedef typename remove_all_extents<_Tp>::type type; }; template<typename _Tp> struct remove_all_extents<_Tp[]> { typedef typename remove_all_extents<_Tp>::type type; }; template<typename _Tp> using remove_extent_t = typename remove_extent<_Tp>::type; template<typename _Tp> using remove_all_extents_t = typename remove_all_extents<_Tp>::type; template<typename _Tp, typename> struct __remove_pointer_helper { typedef _Tp type; }; template<typename _Tp, typename _Up> struct __remove_pointer_helper<_Tp, _Up*> { typedef _Up type; }; template<typename _Tp> struct remove_pointer : public __remove_pointer_helper<_Tp, __remove_cv_t<_Tp>> { }; template<typename _Tp, bool = __or_<__is_referenceable<_Tp>, is_void<_Tp>>::value> struct __add_pointer_helper { typedef _Tp type; }; template<typename _Tp> struct __add_pointer_helper<_Tp, true> { typedef typename remove_reference<_Tp>::type* type; }; template<typename _Tp> struct add_pointer : public __add_pointer_helper<_Tp> { }; template<typename _Tp> using remove_pointer_t = typename remove_pointer<_Tp>::type; template<typename _Tp> using add_pointer_t = typename add_pointer<_Tp>::type; template<std::size_t _Len> struct __aligned_storage_msa { union __type { unsigned char __data[_Len]; struct __attribute__((__aligned__)) { } __align; }; }; # 2067 "/usr/include/c++/10/type_traits" 3 template<std::size_t _Len, std::size_t _Align = __alignof__(typename __aligned_storage_msa<_Len>::__type)> struct aligned_storage { union type { unsigned char __data[_Len]; struct __attribute__((__aligned__((_Align)))) { } __align; }; }; template <typename... _Types> struct __strictest_alignment { static const size_t _S_alignment = 0; static const size_t _S_size = 0; }; template <typename _Tp, typename... _Types> struct __strictest_alignment<_Tp, _Types...> { static const size_t _S_alignment = alignof(_Tp) > __strictest_alignment<_Types...>::_S_alignment ? alignof(_Tp) : __strictest_alignment<_Types...>::_S_alignment; static const size_t _S_size = sizeof(_Tp) > __strictest_alignment<_Types...>::_S_size ? sizeof(_Tp) : __strictest_alignment<_Types...>::_S_size; }; # 2106 "/usr/include/c++/10/type_traits" 3 template <size_t _Len, typename... _Types> struct aligned_union { private: static_assert(sizeof...(_Types) != 0, "At least one type is required"); using __strictest = __strictest_alignment<_Types...>; static const size_t _S_len = _Len > __strictest::_S_size ? _Len : __strictest::_S_size; public: static const size_t alignment_value = __strictest::_S_alignment; typedef typename aligned_storage<_S_len, alignment_value>::type type; }; template <size_t _Len, typename... _Types> const size_t aligned_union<_Len, _Types...>::alignment_value; template<typename _Up, bool _IsArray = is_array<_Up>::value, bool _IsFunction = is_function<_Up>::value> struct __decay_selector; template<typename _Up> struct __decay_selector<_Up, false, false> { typedef __remove_cv_t<_Up> __type; }; template<typename _Up> struct __decay_selector<_Up, true, false> { typedef typename remove_extent<_Up>::type* __type; }; template<typename _Up> struct __decay_selector<_Up, false, true> { typedef typename add_pointer<_Up>::type __type; }; template<typename _Tp> class decay { typedef typename remove_reference<_Tp>::type __remove_type; public: typedef typename __decay_selector<__remove_type>::__type type; }; template<typename _Tp> using __decay_t = typename decay<_Tp>::type; template<typename _Tp> class reference_wrapper; template<typename _Tp> struct __strip_reference_wrapper { typedef _Tp __type; }; template<typename _Tp> struct __strip_reference_wrapper<reference_wrapper<_Tp> > { typedef _Tp& __type; }; template<typename _Tp> using __decay_and_strip = __strip_reference_wrapper<__decay_t<_Tp>>; template<bool, typename _Tp = void> struct enable_if { }; template<typename _Tp> struct enable_if<true, _Tp> { typedef _Tp type; }; template<bool _Cond, typename _Tp = void> using __enable_if_t = typename enable_if<_Cond, _Tp>::type; template<typename... _Cond> using _Require = __enable_if_t<__and_<_Cond...>::value>; template<bool _Cond, typename _Iftrue, typename _Iffalse> struct conditional { typedef _Iftrue type; }; template<typename _Iftrue, typename _Iffalse> struct conditional<false, _Iftrue, _Iffalse> { typedef _Iffalse type; }; template<typename _Tp> using __remove_cvref_t = typename remove_cv<typename remove_reference<_Tp>::type>::type; template<typename... _Tp> struct common_type; struct __do_common_type_impl { template<typename _Tp, typename _Up> using __cond_t = decltype(true ? std::declval<_Tp>() : std::declval<_Up>()); template<typename _Tp, typename _Up> static __success_type<__decay_t<__cond_t<_Tp, _Up>>> _S_test(int); # 2239 "/usr/include/c++/10/type_traits" 3 template<typename, typename> static __failure_type _S_test_2(...); template<typename _Tp, typename _Up> static decltype(_S_test_2<_Tp, _Up>(0)) _S_test(...); }; template<> struct common_type<> { }; template<typename _Tp0> struct common_type<_Tp0> : public common_type<_Tp0, _Tp0> { }; template<typename _Tp1, typename _Tp2, typename _Dp1 = __decay_t<_Tp1>, typename _Dp2 = __decay_t<_Tp2>> struct __common_type_impl { using type = common_type<_Dp1, _Dp2>; }; template<typename _Tp1, typename _Tp2> struct __common_type_impl<_Tp1, _Tp2, _Tp1, _Tp2> : private __do_common_type_impl { using type = decltype(_S_test<_Tp1, _Tp2>(0)); }; template<typename _Tp1, typename _Tp2> struct common_type<_Tp1, _Tp2> : public __common_type_impl<_Tp1, _Tp2>::type { }; template<typename...> struct __common_type_pack { }; template<typename, typename, typename = void> struct __common_type_fold; template<typename _Tp1, typename _Tp2, typename... _Rp> struct common_type<_Tp1, _Tp2, _Rp...> : public __common_type_fold<common_type<_Tp1, _Tp2>, __common_type_pack<_Rp...>> { }; template<typename _CTp, typename... _Rp> struct __common_type_fold<_CTp, __common_type_pack<_Rp...>, __void_t<typename _CTp::type>> : public common_type<typename _CTp::type, _Rp...> { }; template<typename _CTp, typename _Rp> struct __common_type_fold<_CTp, _Rp, void> { }; template<typename _Tp, bool = is_enum<_Tp>::value> struct __underlying_type_impl { using type = __underlying_type(_Tp); }; template<typename _Tp> struct __underlying_type_impl<_Tp, false> { }; template<typename _Tp> struct underlying_type : public __underlying_type_impl<_Tp> { }; template<typename _Tp> struct __declval_protector { static const bool __stop = false; }; template<typename _Tp> auto declval() noexcept -> decltype(__declval<_Tp>(0)) { static_assert(__declval_protector<_Tp>::__stop, "declval() must not be used!"); return __declval<_Tp>(0); } template<typename _Signature> class result_of; struct __invoke_memfun_ref { }; struct __invoke_memfun_deref { }; struct __invoke_memobj_ref { }; struct __invoke_memobj_deref { }; struct __invoke_other { }; template<typename _Tp, typename _Tag> struct __result_of_success : __success_type<_Tp> { using __invoke_type = _Tag; }; struct __result_of_memfun_ref_impl { template<typename _Fp, typename _Tp1, typename... _Args> static __result_of_success<decltype( (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...) ), __invoke_memfun_ref> _S_test(int); template<typename...> static __failure_type _S_test(...); }; template<typename _MemPtr, typename _Arg, typename... _Args> struct __result_of_memfun_ref : private __result_of_memfun_ref_impl { typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type; }; struct __result_of_memfun_deref_impl { template<typename _Fp, typename _Tp1, typename... _Args> static __result_of_success<decltype( ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...) ), __invoke_memfun_deref> _S_test(int); template<typename...> static __failure_type _S_test(...); }; template<typename _MemPtr, typename _Arg, typename... _Args> struct __result_of_memfun_deref : private __result_of_memfun_deref_impl { typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type; }; struct __result_of_memobj_ref_impl { template<typename _Fp, typename _Tp1> static __result_of_success<decltype( std::declval<_Tp1>().*std::declval<_Fp>() ), __invoke_memobj_ref> _S_test(int); template<typename, typename> static __failure_type _S_test(...); }; template<typename _MemPtr, typename _Arg> struct __result_of_memobj_ref : private __result_of_memobj_ref_impl { typedef decltype(_S_test<_MemPtr, _Arg>(0)) type; }; struct __result_of_memobj_deref_impl { template<typename _Fp, typename _Tp1> static __result_of_success<decltype( (*std::declval<_Tp1>()).*std::declval<_Fp>() ), __invoke_memobj_deref> _S_test(int); template<typename, typename> static __failure_type _S_test(...); }; template<typename _MemPtr, typename _Arg> struct __result_of_memobj_deref : private __result_of_memobj_deref_impl { typedef decltype(_S_test<_MemPtr, _Arg>(0)) type; }; template<typename _MemPtr, typename _Arg> struct __result_of_memobj; template<typename _Res, typename _Class, typename _Arg> struct __result_of_memobj<_Res _Class::*, _Arg> { typedef __remove_cvref_t<_Arg> _Argval; typedef _Res _Class::* _MemPtr; typedef typename conditional<__or_<is_same<_Argval, _Class>, is_base_of<_Class, _Argval>>::value, __result_of_memobj_ref<_MemPtr, _Arg>, __result_of_memobj_deref<_MemPtr, _Arg> >::type::type type; }; template<typename _MemPtr, typename _Arg, typename... _Args> struct __result_of_memfun; template<typename _Res, typename _Class, typename _Arg, typename... _Args> struct __result_of_memfun<_Res _Class::*, _Arg, _Args...> { typedef typename remove_reference<_Arg>::type _Argval; typedef _Res _Class::* _MemPtr; typedef typename conditional<is_base_of<_Class, _Argval>::value, __result_of_memfun_ref<_MemPtr, _Arg, _Args...>, __result_of_memfun_deref<_MemPtr, _Arg, _Args...> >::type::type type; }; template<typename _Tp, typename _Up = __remove_cvref_t<_Tp>> struct __inv_unwrap { using type = _Tp; }; template<typename _Tp, typename _Up> struct __inv_unwrap<_Tp, reference_wrapper<_Up>> { using type = _Up&; }; template<bool, bool, typename _Functor, typename... _ArgTypes> struct __result_of_impl { typedef __failure_type type; }; template<typename _MemPtr, typename _Arg> struct __result_of_impl<true, false, _MemPtr, _Arg> : public __result_of_memobj<__decay_t<_MemPtr>, typename __inv_unwrap<_Arg>::type> { }; template<typename _MemPtr, typename _Arg, typename... _Args> struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...> : public __result_of_memfun<__decay_t<_MemPtr>, typename __inv_unwrap<_Arg>::type, _Args...> { }; struct __result_of_other_impl { template<typename _Fn, typename... _Args> static __result_of_success<decltype( std::declval<_Fn>()(std::declval<_Args>()...) ), __invoke_other> _S_test(int); template<typename...> static __failure_type _S_test(...); }; template<typename _Functor, typename... _ArgTypes> struct __result_of_impl<false, false, _Functor, _ArgTypes...> : private __result_of_other_impl { typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type; }; template<typename _Functor, typename... _ArgTypes> struct __invoke_result : public __result_of_impl< is_member_object_pointer< typename remove_reference<_Functor>::type >::value, is_member_function_pointer< typename remove_reference<_Functor>::type >::value, _Functor, _ArgTypes... >::type { }; template<typename _Functor, typename... _ArgTypes> struct result_of<_Functor(_ArgTypes...)> : public __invoke_result<_Functor, _ArgTypes...> { }; template<size_t _Len, size_t _Align = __alignof__(typename __aligned_storage_msa<_Len>::__type)> using aligned_storage_t = typename aligned_storage<_Len, _Align>::type; template <size_t _Len, typename... _Types> using aligned_union_t = typename aligned_union<_Len, _Types...>::type; template<typename _Tp> using decay_t = typename decay<_Tp>::type; template<bool _Cond, typename _Tp = void> using enable_if_t = typename enable_if<_Cond, _Tp>::type; template<bool _Cond, typename _Iftrue, typename _Iffalse> using conditional_t = typename conditional<_Cond, _Iftrue, _Iffalse>::type; template<typename... _Tp> using common_type_t = typename common_type<_Tp...>::type; template<typename _Tp> using underlying_type_t = typename underlying_type<_Tp>::type; template<typename _Tp> using result_of_t = typename result_of<_Tp>::type; template<typename...> using void_t = void; template<typename _Default, typename _AlwaysVoid, template<typename...> class _Op, typename... _Args> struct __detector { using value_t = false_type; using type = _Default; }; template<typename _Default, template<typename...> class _Op, typename... _Args> struct __detector<_Default, __void_t<_Op<_Args...>>, _Op, _Args...> { using value_t = true_type; using type = _Op<_Args...>; }; template<typename _Default, template<typename...> class _Op, typename... _Args> using __detected_or = __detector<_Default, void, _Op, _Args...>; template<typename _Default, template<typename...> class _Op, typename... _Args> using __detected_or_t = typename __detected_or<_Default, _Op, _Args...>::type; # 2624 "/usr/include/c++/10/type_traits" 3 template <typename _Tp> struct __is_swappable; template <typename _Tp> struct __is_nothrow_swappable; template<typename... _Elements> class tuple; template<typename> struct __is_tuple_like_impl : false_type { }; template<typename... _Tps> struct __is_tuple_like_impl<tuple<_Tps...>> : true_type { }; template<typename _Tp> struct __is_tuple_like : public __is_tuple_like_impl<__remove_cvref_t<_Tp>>::type { }; template<typename _Tp> inline _Require<__not_<__is_tuple_like<_Tp>>, is_move_constructible<_Tp>, is_move_assignable<_Tp>> swap(_Tp&, _Tp&) noexcept(__and_<is_nothrow_move_constructible<_Tp>, is_nothrow_move_assignable<_Tp>>::value); template<typename _Tp, size_t _Nm> inline __enable_if_t<__is_swappable<_Tp>::value> swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) noexcept(__is_nothrow_swappable<_Tp>::value); namespace __swappable_details { using std::swap; struct __do_is_swappable_impl { template<typename _Tp, typename = decltype(swap(std::declval<_Tp&>(), std::declval<_Tp&>()))> static true_type __test(int); template<typename> static false_type __test(...); }; struct __do_is_nothrow_swappable_impl { template<typename _Tp> static __bool_constant< noexcept(swap(std::declval<_Tp&>(), std::declval<_Tp&>())) > __test(int); template<typename> static false_type __test(...); }; } template<typename _Tp> struct __is_swappable_impl : public __swappable_details::__do_is_swappable_impl { typedef decltype(__test<_Tp>(0)) type; }; template<typename _Tp> struct __is_nothrow_swappable_impl : public __swappable_details::__do_is_nothrow_swappable_impl { typedef decltype(__test<_Tp>(0)) type; }; template<typename _Tp> struct __is_swappable : public __is_swappable_impl<_Tp>::type { }; template<typename _Tp> struct __is_nothrow_swappable : public __is_nothrow_swappable_impl<_Tp>::type { }; template<typename _Tp> struct is_swappable : public __is_swappable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> struct is_nothrow_swappable : public __is_nothrow_swappable_impl<_Tp>::type { static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}), "template argument must be a complete class or an unbounded array"); }; template<typename _Tp> constexpr bool is_swappable_v = is_swappable<_Tp>::value; template<typename _Tp> constexpr bool is_nothrow_swappable_v = is_nothrow_swappable<_Tp>::value; namespace __swappable_with_details { using std::swap; struct __do_is_swappable_with_impl { template<typename _Tp, typename _Up, typename = decltype(swap(std::declval<_Tp>(), std::declval<_Up>())), typename = decltype(swap(std::declval<_Up>(), std::declval<_Tp>()))> static true_type __test(int); template<typename, typename> static false_type __test(...); }; struct __do_is_nothrow_swappable_with_impl { template<typename _Tp, typename _Up> static __bool_constant< noexcept(swap(std::declval<_Tp>(), std::declval<_Up>())) && noexcept(swap(std::declval<_Up>(), std::declval<_Tp>())) > __test(int); template<typename, typename> static false_type __test(...); }; } template<typename _Tp, typename _Up> struct __is_swappable_with_impl : public __swappable_with_details::__do_is_swappable_with_impl { typedef decltype(__test<_Tp, _Up>(0)) type; }; template<typename _Tp> struct __is_swappable_with_impl<_Tp&, _Tp&> : public __swappable_details::__do_is_swappable_impl { typedef decltype(__test<_Tp&>(0)) type; }; template<typename _Tp, typename _Up> struct __is_nothrow_swappable_with_impl : public __swappable_with_details::__do_is_nothrow_swappable_with_impl { typedef decltype(__test<_Tp, _Up>(0)) type; }; template<typename _Tp> struct __is_nothrow_swappable_with_impl<_Tp&, _Tp&> : public __swappable_details::__do_is_nothrow_swappable_impl { typedef decltype(__test<_Tp&>(0)) type; }; template<typename _Tp, typename _Up> struct is_swappable_with : public __is_swappable_with_impl<_Tp, _Up>::type { }; template<typename _Tp, typename _Up> struct is_nothrow_swappable_with : public __is_nothrow_swappable_with_impl<_Tp, _Up>::type { }; template<typename _Tp, typename _Up> constexpr bool is_swappable_with_v = is_swappable_with<_Tp, _Up>::value; template<typename _Tp, typename _Up> constexpr bool is_nothrow_swappable_with_v = is_nothrow_swappable_with<_Tp, _Up>::value; template<typename _Result, typename _Ret, bool = is_void<_Ret>::value, typename = void> struct __is_invocable_impl : false_type { }; template<typename _Result, typename _Ret> struct __is_invocable_impl<_Result, _Ret, true, __void_t<typename _Result::type>> : true_type { }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" template<typename _Result, typename _Ret> struct __is_invocable_impl<_Result, _Ret, false, __void_t<typename _Result::type>> { private: static typename _Result::type _S_get(); template<typename _Tp> static void _S_conv(_Tp); template<typename _Tp, typename = decltype(_S_conv<_Tp>(_S_get()))> static true_type _S_test(int); template<typename _Tp> static false_type _S_test(...); public: using type = decltype(_S_test<_Ret>(1)); }; #pragma GCC diagnostic pop template<typename _Fn, typename... _ArgTypes> struct __is_invocable : __is_invocable_impl<__invoke_result<_Fn, _ArgTypes...>, void>::type { }; template<typename _Fn, typename _Tp, typename... _Args> constexpr bool __call_is_nt(__invoke_memfun_ref) { using _Up = typename __inv_unwrap<_Tp>::type; return noexcept((std::declval<_Up>().*std::declval<_Fn>())( std::declval<_Args>()...)); } template<typename _Fn, typename _Tp, typename... _Args> constexpr bool __call_is_nt(__invoke_memfun_deref) { return noexcept(((*std::declval<_Tp>()).*std::declval<_Fn>())( std::declval<_Args>()...)); } template<typename _Fn, typename _Tp> constexpr bool __call_is_nt(__invoke_memobj_ref) { using _Up = typename __inv_unwrap<_Tp>::type; return noexcept(std::declval<_Up>().*std::declval<_Fn>()); } template<typename _Fn, typename _Tp> constexpr bool __call_is_nt(__invoke_memobj_deref) { return noexcept((*std::declval<_Tp>()).*std::declval<_Fn>()); } template<typename _Fn, typename... _Args> constexpr bool __call_is_nt(__invoke_other) { return noexcept(std::declval<_Fn>()(std::declval<_Args>()...)); } template<typename _Result, typename _Fn, typename... _Args> struct __call_is_nothrow : __bool_constant< std::__call_is_nt<_Fn, _Args...>(typename _Result::__invoke_type{}) > { }; template<typename _Fn, typename... _Args> using __call_is_nothrow_ = __call_is_nothrow<__invoke_result<_Fn, _Args...>, _Fn, _Args...>; template<typename _Fn, typename... _Args> struct __is_nothrow_invocable : __and_<__is_invocable<_Fn, _Args...>, __call_is_nothrow_<_Fn, _Args...>>::type { }; #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wctor-dtor-privacy" struct __nonesuchbase {}; struct __nonesuch : private __nonesuchbase { ~__nonesuch() = delete; __nonesuch(__nonesuch const&) = delete; void operator=(__nonesuch const&) = delete; }; #pragma GCC diagnostic pop # 3455 "/usr/include/c++/10/type_traits" 3 } # 58 "/usr/include/c++/10/bits/move.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 74 "/usr/include/c++/10/bits/move.h" 3 template<typename _Tp> constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type& __t) noexcept { return static_cast<_Tp&&>(__t); } template<typename _Tp> constexpr _Tp&& forward(typename std::remove_reference<_Tp>::type&& __t) noexcept { static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument" " substituting _Tp is an lvalue reference type"); return static_cast<_Tp&&>(__t); } template<typename _Tp> constexpr typename std::remove_reference<_Tp>::type&& move(_Tp&& __t) noexcept { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); } template<typename _Tp> struct __move_if_noexcept_cond : public __and_<__not_<is_nothrow_move_constructible<_Tp>>, is_copy_constructible<_Tp>>::type { }; # 118 "/usr/include/c++/10/bits/move.h" 3 template<typename _Tp> constexpr typename conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type move_if_noexcept(_Tp& __x) noexcept { return std::move(__x); } # 138 "/usr/include/c++/10/bits/move.h" 3 template<typename _Tp> inline _Tp* addressof(_Tp& __r) noexcept { return std::__addressof(__r); } template<typename _Tp> const _Tp* addressof(const _Tp&&) = delete; template <typename _Tp, typename _Up = _Tp> inline _Tp __exchange(_Tp& __obj, _Up&& __new_val) { _Tp __old_val = std::move(__obj); __obj = std::forward<_Up>(__new_val); return __old_val; } # 179 "/usr/include/c++/10/bits/move.h" 3 template<typename _Tp> inline typename enable_if<__and_<__not_<__is_tuple_like<_Tp>>, is_move_constructible<_Tp>, is_move_assignable<_Tp>>::value>::type swap(_Tp& __a, _Tp& __b) noexcept(__and_<is_nothrow_move_constructible<_Tp>, is_nothrow_move_assignable<_Tp>>::value) { _Tp __tmp = std::move(__a); __a = std::move(__b); __b = std::move(__tmp); } template<typename _Tp, size_t _Nm> inline typename enable_if<__is_swappable<_Tp>::value>::type swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm]) noexcept(__is_nothrow_swappable<_Tp>::value) { for (size_t __n = 0; __n < _Nm; ++__n) swap(__a[__n], __b[__n]); } } # 41 "/usr/include/c++/10/bits/nested_exception.h" 2 3 extern "C++" { namespace std { class nested_exception { exception_ptr _M_ptr; public: nested_exception() noexcept : _M_ptr(current_exception()) { } nested_exception(const nested_exception&) noexcept = default; nested_exception& operator=(const nested_exception&) noexcept = default; virtual ~nested_exception() noexcept; [[noreturn]] void rethrow_nested() const { if (_M_ptr) rethrow_exception(_M_ptr); std::terminate(); } exception_ptr nested_ptr() const noexcept { return _M_ptr; } }; template<typename _Except> struct _Nested_exception : public _Except, public nested_exception { explicit _Nested_exception(const _Except& __ex) : _Except(__ex) { } explicit _Nested_exception(_Except&& __ex) : _Except(static_cast<_Except&&>(__ex)) { } }; template<typename _Tp> [[noreturn]] inline void __throw_with_nested_impl(_Tp&& __t, true_type) { using _Up = typename remove_reference<_Tp>::type; throw _Nested_exception<_Up>{std::forward<_Tp>(__t)}; } template<typename _Tp> [[noreturn]] inline void __throw_with_nested_impl(_Tp&& __t, false_type) { throw std::forward<_Tp>(__t); } template<typename _Tp> [[noreturn]] inline void throw_with_nested(_Tp&& __t) { using _Up = typename decay<_Tp>::type; using _CopyConstructible = __and_<is_copy_constructible<_Up>, is_move_constructible<_Up>>; static_assert(_CopyConstructible::value, "throw_with_nested argument must be CopyConstructible"); using __nest = __and_<is_class<_Up>, __bool_constant<!__is_final(_Up)>, __not_<is_base_of<nested_exception, _Up>>>; std::__throw_with_nested_impl(std::forward<_Tp>(__t), __nest{}); } template<typename _Tp> using __rethrow_if_nested_cond = typename enable_if< __and_<is_polymorphic<_Tp>, __or_<__not_<is_base_of<nested_exception, _Tp>>, is_convertible<_Tp*, nested_exception*>>>::value >::type; template<typename _Ex> inline __rethrow_if_nested_cond<_Ex> __rethrow_if_nested_impl(const _Ex* __ptr) { if (auto __ne_ptr = dynamic_cast<const nested_exception*>(__ptr)) __ne_ptr->rethrow_nested(); } inline void __rethrow_if_nested_impl(const void*) { } template<typename _Ex> inline void rethrow_if_nested(const _Ex& __ex) { std::__rethrow_if_nested_impl(std::__addressof(__ex)); } } } #pragma GCC visibility pop # 149 "/usr/include/c++/10/exception" 2 3 # 42 "/usr/include/c++/10/new" 2 3 #pragma GCC visibility push(default) extern "C++" { namespace std { class bad_alloc : public exception { public: bad_alloc() throw() { } bad_alloc(const bad_alloc&) = default; bad_alloc& operator=(const bad_alloc&) = default; virtual ~bad_alloc() throw(); virtual const char* what() const throw(); }; class bad_array_new_length : public bad_alloc { public: bad_array_new_length() throw() { } virtual ~bad_array_new_length() throw(); virtual const char* what() const throw(); }; struct nothrow_t { explicit nothrow_t() = default; }; extern const nothrow_t nothrow; typedef void (*new_handler)(); new_handler set_new_handler(new_handler) throw(); new_handler get_new_handler() noexcept; } # 126 "/usr/include/c++/10/new" 3 void* operator new(std::size_t) __attribute__((__externally_visible__)); void* operator new[](std::size_t) __attribute__((__externally_visible__)); void operator delete(void*) noexcept __attribute__((__externally_visible__)); void operator delete[](void*) noexcept __attribute__((__externally_visible__)); void operator delete(void*, std::size_t) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, std::size_t) noexcept __attribute__((__externally_visible__)); void* operator new(std::size_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __malloc__)); void* operator new[](std::size_t, const std::nothrow_t&) noexcept __attribute__((__externally_visible__, __malloc__)); void operator delete(void*, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); void operator delete[](void*, const std::nothrow_t&) noexcept __attribute__((__externally_visible__)); # 174 "/usr/include/c++/10/new" 3 inline void* operator new(std::size_t, void* __p) noexcept { return __p; } inline void* operator new[](std::size_t, void* __p) noexcept { return __p; } inline void operator delete (void*, void*) noexcept { } inline void operator delete[](void*, void*) noexcept { } } # 230 "/usr/include/c++/10/new" 3 #pragma GCC visibility pop # 237 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/c++/10/utility" 1 3 # 58 "/usr/include/c++/10/utility" 3 # 59 "/usr/include/c++/10/utility" 3 # 69 "/usr/include/c++/10/utility" 3 # 1 "/usr/include/c++/10/bits/stl_relops.h" 1 3 # 67 "/usr/include/c++/10/bits/stl_relops.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { namespace rel_ops { # 85 "/usr/include/c++/10/bits/stl_relops.h" 3 template <class _Tp> inline bool operator!=(const _Tp& __x, const _Tp& __y) { return !(__x == __y); } # 98 "/usr/include/c++/10/bits/stl_relops.h" 3 template <class _Tp> inline bool operator>(const _Tp& __x, const _Tp& __y) { return __y < __x; } # 111 "/usr/include/c++/10/bits/stl_relops.h" 3 template <class _Tp> inline bool operator<=(const _Tp& __x, const _Tp& __y) { return !(__y < __x); } # 124 "/usr/include/c++/10/bits/stl_relops.h" 3 template <class _Tp> inline bool operator>=(const _Tp& __x, const _Tp& __y) { return !(__x < __y); } } } # 70 "/usr/include/c++/10/utility" 2 3 # 1 "/usr/include/c++/10/bits/stl_pair.h" 1 3 # 69 "/usr/include/c++/10/bits/stl_pair.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 80 "/usr/include/c++/10/bits/stl_pair.h" 3 struct piecewise_construct_t { explicit piecewise_construct_t() = default; }; constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t(); template<typename...> class tuple; template<std::size_t...> struct _Index_tuple; template <bool, typename _T1, typename _T2> struct _PCC { template <typename _U1, typename _U2> static constexpr bool _ConstructiblePair() { return __and_<is_constructible<_T1, const _U1&>, is_constructible<_T2, const _U2&>>::value; } template <typename _U1, typename _U2> static constexpr bool _ImplicitlyConvertiblePair() { return __and_<is_convertible<const _U1&, _T1>, is_convertible<const _U2&, _T2>>::value; } template <typename _U1, typename _U2> static constexpr bool _MoveConstructiblePair() { return __and_<is_constructible<_T1, _U1&&>, is_constructible<_T2, _U2&&>>::value; } template <typename _U1, typename _U2> static constexpr bool _ImplicitlyMoveConvertiblePair() { return __and_<is_convertible<_U1&&, _T1>, is_convertible<_U2&&, _T2>>::value; } template <bool __implicit, typename _U1, typename _U2> static constexpr bool _CopyMovePair() { using __do_converts = __and_<is_convertible<const _U1&, _T1>, is_convertible<_U2&&, _T2>>; using __converts = typename conditional<__implicit, __do_converts, __not_<__do_converts>>::type; return __and_<is_constructible<_T1, const _U1&>, is_constructible<_T2, _U2&&>, __converts >::value; } template <bool __implicit, typename _U1, typename _U2> static constexpr bool _MoveCopyPair() { using __do_converts = __and_<is_convertible<_U1&&, _T1>, is_convertible<const _U2&, _T2>>; using __converts = typename conditional<__implicit, __do_converts, __not_<__do_converts>>::type; return __and_<is_constructible<_T1, _U1&&>, is_constructible<_T2, const _U2&&>, __converts >::value; } }; template <typename _T1, typename _T2> struct _PCC<false, _T1, _T2> { template <typename _U1, typename _U2> static constexpr bool _ConstructiblePair() { return false; } template <typename _U1, typename _U2> static constexpr bool _ImplicitlyConvertiblePair() { return false; } template <typename _U1, typename _U2> static constexpr bool _MoveConstructiblePair() { return false; } template <typename _U1, typename _U2> static constexpr bool _ImplicitlyMoveConvertiblePair() { return false; } }; template<typename _U1, typename _U2> class __pair_base { template<typename _T1, typename _T2> friend struct pair; __pair_base() = default; ~__pair_base() = default; __pair_base(const __pair_base&) = default; __pair_base& operator=(const __pair_base&) = delete; }; # 210 "/usr/include/c++/10/bits/stl_pair.h" 3 template<typename _T1, typename _T2> struct pair : private __pair_base<_T1, _T2> { typedef _T1 first_type; typedef _T2 second_type; _T1 first; _T2 second; template <typename _U1 = _T1, typename _U2 = _T2, typename enable_if<__and_< __is_implicitly_default_constructible<_U1>, __is_implicitly_default_constructible<_U2>> ::value, bool>::type = true> constexpr pair() : first(), second() { } template <typename _U1 = _T1, typename _U2 = _T2, typename enable_if<__and_< is_default_constructible<_U1>, is_default_constructible<_U2>, __not_< __and_<__is_implicitly_default_constructible<_U1>, __is_implicitly_default_constructible<_U2>>>> ::value, bool>::type = false> explicit constexpr pair() : first(), second() { } # 256 "/usr/include/c++/10/bits/stl_pair.h" 3 using _PCCP = _PCC<true, _T1, _T2>; template<typename _U1 = _T1, typename _U2=_T2, typename enable_if<_PCCP::template _ConstructiblePair<_U1, _U2>() && _PCCP::template _ImplicitlyConvertiblePair<_U1, _U2>(), bool>::type=true> constexpr pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) { } template<typename _U1 = _T1, typename _U2=_T2, typename enable_if<_PCCP::template _ConstructiblePair<_U1, _U2>() && !_PCCP::template _ImplicitlyConvertiblePair<_U1, _U2>(), bool>::type=false> explicit constexpr pair(const _T1& __a, const _T2& __b) : first(__a), second(__b) { } # 288 "/usr/include/c++/10/bits/stl_pair.h" 3 template <typename _U1, typename _U2> using _PCCFP = _PCC<!is_same<_T1, _U1>::value || !is_same<_T2, _U2>::value, _T1, _T2>; template<typename _U1, typename _U2, typename enable_if<_PCCFP<_U1, _U2>::template _ConstructiblePair<_U1, _U2>() && _PCCFP<_U1, _U2>::template _ImplicitlyConvertiblePair<_U1, _U2>(), bool>::type=true> constexpr pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } template<typename _U1, typename _U2, typename enable_if<_PCCFP<_U1, _U2>::template _ConstructiblePair<_U1, _U2>() && !_PCCFP<_U1, _U2>::template _ImplicitlyConvertiblePair<_U1, _U2>(), bool>::type=false> explicit constexpr pair(const pair<_U1, _U2>& __p) : first(__p.first), second(__p.second) { } constexpr pair(const pair&) = default; constexpr pair(pair&&) = default; template<typename _U1, typename enable_if<_PCCP::template _MoveCopyPair<true, _U1, _T2>(), bool>::type=true> constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { } template<typename _U1, typename enable_if<_PCCP::template _MoveCopyPair<false, _U1, _T2>(), bool>::type=false> explicit constexpr pair(_U1&& __x, const _T2& __y) : first(std::forward<_U1>(__x)), second(__y) { } template<typename _U2, typename enable_if<_PCCP::template _CopyMovePair<true, _T1, _U2>(), bool>::type=true> constexpr pair(const _T1& __x, _U2&& __y) : first(__x), second(std::forward<_U2>(__y)) { } template<typename _U2, typename enable_if<_PCCP::template _CopyMovePair<false, _T1, _U2>(), bool>::type=false> explicit pair(const _T1& __x, _U2&& __y) : first(__x), second(std::forward<_U2>(__y)) { } template<typename _U1, typename _U2, typename enable_if<_PCCP::template _MoveConstructiblePair<_U1, _U2>() && _PCCP::template _ImplicitlyMoveConvertiblePair<_U1, _U2>(), bool>::type=true> constexpr pair(_U1&& __x, _U2&& __y) : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } template<typename _U1, typename _U2, typename enable_if<_PCCP::template _MoveConstructiblePair<_U1, _U2>() && !_PCCP::template _ImplicitlyMoveConvertiblePair<_U1, _U2>(), bool>::type=false> explicit constexpr pair(_U1&& __x, _U2&& __y) : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { } template<typename _U1, typename _U2, typename enable_if<_PCCFP<_U1, _U2>::template _MoveConstructiblePair<_U1, _U2>() && _PCCFP<_U1, _U2>::template _ImplicitlyMoveConvertiblePair<_U1, _U2>(), bool>::type=true> constexpr pair(pair<_U1, _U2>&& __p) : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) { } template<typename _U1, typename _U2, typename enable_if<_PCCFP<_U1, _U2>::template _MoveConstructiblePair<_U1, _U2>() && !_PCCFP<_U1, _U2>::template _ImplicitlyMoveConvertiblePair<_U1, _U2>(), bool>::type=false> explicit constexpr pair(pair<_U1, _U2>&& __p) : first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) { } template<typename... _Args1, typename... _Args2> pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>); pair& operator=(typename conditional< __and_<is_copy_assignable<_T1>, is_copy_assignable<_T2>>::value, const pair&, const __nonesuch&>::type __p) { first = __p.first; second = __p.second; return *this; } pair& operator=(typename conditional< __and_<is_move_assignable<_T1>, is_move_assignable<_T2>>::value, pair&&, __nonesuch&&>::type __p) noexcept(__and_<is_nothrow_move_assignable<_T1>, is_nothrow_move_assignable<_T2>>::value) { first = std::forward<first_type>(__p.first); second = std::forward<second_type>(__p.second); return *this; } template<typename _U1, typename _U2> typename enable_if<__and_<is_assignable<_T1&, const _U1&>, is_assignable<_T2&, const _U2&>>::value, pair&>::type operator=(const pair<_U1, _U2>& __p) { first = __p.first; second = __p.second; return *this; } template<typename _U1, typename _U2> typename enable_if<__and_<is_assignable<_T1&, _U1&&>, is_assignable<_T2&, _U2&&>>::value, pair&>::type operator=(pair<_U1, _U2>&& __p) { first = std::forward<_U1>(__p.first); second = std::forward<_U2>(__p.second); return *this; } void swap(pair& __p) noexcept(__and_<__is_nothrow_swappable<_T1>, __is_nothrow_swappable<_T2>>::value) { using std::swap; swap(first, __p.first); swap(second, __p.second); } private: template<typename... _Args1, std::size_t... _Indexes1, typename... _Args2, std::size_t... _Indexes2> pair(tuple<_Args1...>&, tuple<_Args2...>&, _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>); }; # 464 "/usr/include/c++/10/bits/stl_pair.h" 3 template<typename _T1, typename _T2> inline constexpr bool operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first == __y.first && __x.second == __y.second; } # 487 "/usr/include/c++/10/bits/stl_pair.h" 3 template<typename _T1, typename _T2> inline constexpr bool operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __x.first < __y.first || (!(__y.first < __x.first) && __x.second < __y.second); } template<typename _T1, typename _T2> inline constexpr bool operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x == __y); } template<typename _T1, typename _T2> inline constexpr bool operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return __y < __x; } template<typename _T1, typename _T2> inline constexpr bool operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__y < __x); } template<typename _T1, typename _T2> inline constexpr bool operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) { return !(__x < __y); } # 524 "/usr/include/c++/10/bits/stl_pair.h" 3 template<typename _T1, typename _T2> inline typename enable_if<__and_<__is_swappable<_T1>, __is_swappable<_T2>>::value>::type swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y) noexcept(noexcept(__x.swap(__y))) { __x.swap(__y); } template<typename _T1, typename _T2> typename enable_if<!__and_<__is_swappable<_T1>, __is_swappable<_T2>>::value>::type swap(pair<_T1, _T2>&, pair<_T1, _T2>&) = delete; # 564 "/usr/include/c++/10/bits/stl_pair.h" 3 template<typename _T1, typename _T2> constexpr pair<typename __decay_and_strip<_T1>::__type, typename __decay_and_strip<_T2>::__type> make_pair(_T1&& __x, _T2&& __y) { typedef typename __decay_and_strip<_T1>::__type __ds_type1; typedef typename __decay_and_strip<_T2>::__type __ds_type2; typedef pair<__ds_type1, __ds_type2> __pair_type; return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y)); } # 583 "/usr/include/c++/10/bits/stl_pair.h" 3 } # 71 "/usr/include/c++/10/utility" 2 3 # 1 "/usr/include/c++/10/initializer_list" 1 3 # 33 "/usr/include/c++/10/initializer_list" 3 # 34 "/usr/include/c++/10/initializer_list" 3 #pragma GCC visibility push(default) namespace std { template<class _E> class initializer_list { public: typedef _E value_type; typedef const _E& reference; typedef const _E& const_reference; typedef size_t size_type; typedef const _E* iterator; typedef const _E* const_iterator; private: iterator _M_array; size_type _M_len; constexpr initializer_list(const_iterator __a, size_type __l) : _M_array(__a), _M_len(__l) { } public: constexpr initializer_list() noexcept : _M_array(0), _M_len(0) { } constexpr size_type size() const noexcept { return _M_len; } constexpr const_iterator begin() const noexcept { return _M_array; } constexpr const_iterator end() const noexcept { return begin() + size(); } }; template<class _Tp> constexpr const _Tp* begin(initializer_list<_Tp> __ils) noexcept { return __ils.begin(); } template<class _Tp> constexpr const _Tp* end(initializer_list<_Tp> __ils) noexcept { return __ils.end(); } } #pragma GCC visibility pop # 77 "/usr/include/c++/10/utility" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template<typename _Tp> struct tuple_size; template<typename _Tp, typename _Up = typename remove_cv<_Tp>::type, typename = typename enable_if<is_same<_Tp, _Up>::value>::type, size_t = tuple_size<_Tp>::value> using __enable_if_has_tuple_size = _Tp; template<typename _Tp> struct tuple_size<const __enable_if_has_tuple_size<_Tp>> : public tuple_size<_Tp> { }; template<typename _Tp> struct tuple_size<volatile __enable_if_has_tuple_size<_Tp>> : public tuple_size<_Tp> { }; template<typename _Tp> struct tuple_size<const volatile __enable_if_has_tuple_size<_Tp>> : public tuple_size<_Tp> { }; template<std::size_t __i, typename _Tp> struct tuple_element; template<std::size_t __i, typename _Tp> using __tuple_element_t = typename tuple_element<__i, _Tp>::type; template<std::size_t __i, typename _Tp> struct tuple_element<__i, const _Tp> { typedef typename add_const<__tuple_element_t<__i, _Tp>>::type type; }; template<std::size_t __i, typename _Tp> struct tuple_element<__i, volatile _Tp> { typedef typename add_volatile<__tuple_element_t<__i, _Tp>>::type type; }; template<std::size_t __i, typename _Tp> struct tuple_element<__i, const volatile _Tp> { typedef typename add_cv<__tuple_element_t<__i, _Tp>>::type type; }; template<std::size_t __i, typename _Tp> using tuple_element_t = typename tuple_element<__i, _Tp>::type; template<typename _T1, typename _T2> struct __is_tuple_like_impl<std::pair<_T1, _T2>> : true_type { }; template<class _Tp1, class _Tp2> struct tuple_size<std::pair<_Tp1, _Tp2>> : public integral_constant<std::size_t, 2> { }; template<class _Tp1, class _Tp2> struct tuple_element<0, std::pair<_Tp1, _Tp2>> { typedef _Tp1 type; }; template<class _Tp1, class _Tp2> struct tuple_element<1, std::pair<_Tp1, _Tp2>> { typedef _Tp2 type; }; template<std::size_t _Int> struct __pair_get; template<> struct __pair_get<0> { template<typename _Tp1, typename _Tp2> static constexpr _Tp1& __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } template<typename _Tp1, typename _Tp2> static constexpr _Tp1&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp1>(__pair.first); } template<typename _Tp1, typename _Tp2> static constexpr const _Tp1& __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.first; } template<typename _Tp1, typename _Tp2> static constexpr const _Tp1&& __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<const _Tp1>(__pair.first); } }; template<> struct __pair_get<1> { template<typename _Tp1, typename _Tp2> static constexpr _Tp2& __get(std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } template<typename _Tp1, typename _Tp2> static constexpr _Tp2&& __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<_Tp2>(__pair.second); } template<typename _Tp1, typename _Tp2> static constexpr const _Tp2& __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept { return __pair.second; } template<typename _Tp1, typename _Tp2> static constexpr const _Tp2&& __const_move_get(const std::pair<_Tp1, _Tp2>&& __pair) noexcept { return std::forward<const _Tp2>(__pair.second); } }; template<std::size_t _Int, class _Tp1, class _Tp2> constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& get(std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__get(__in); } template<std::size_t _Int, class _Tp1, class _Tp2> constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& get(std::pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__move_get(std::move(__in)); } template<std::size_t _Int, class _Tp1, class _Tp2> constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type& get(const std::pair<_Tp1, _Tp2>& __in) noexcept { return __pair_get<_Int>::__const_get(__in); } template<std::size_t _Int, class _Tp1, class _Tp2> constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&& get(const std::pair<_Tp1, _Tp2>&& __in) noexcept { return __pair_get<_Int>::__const_move_get(std::move(__in)); } template <typename _Tp, typename _Up> constexpr _Tp& get(pair<_Tp, _Up>& __p) noexcept { return __p.first; } template <typename _Tp, typename _Up> constexpr const _Tp& get(const pair<_Tp, _Up>& __p) noexcept { return __p.first; } template <typename _Tp, typename _Up> constexpr _Tp&& get(pair<_Tp, _Up>&& __p) noexcept { return std::move(__p.first); } template <typename _Tp, typename _Up> constexpr const _Tp&& get(const pair<_Tp, _Up>&& __p) noexcept { return std::move(__p.first); } template <typename _Tp, typename _Up> constexpr _Tp& get(pair<_Up, _Tp>& __p) noexcept { return __p.second; } template <typename _Tp, typename _Up> constexpr const _Tp& get(const pair<_Up, _Tp>& __p) noexcept { return __p.second; } template <typename _Tp, typename _Up> constexpr _Tp&& get(pair<_Up, _Tp>&& __p) noexcept { return std::move(__p.second); } template <typename _Tp, typename _Up> constexpr const _Tp&& get(const pair<_Up, _Tp>&& __p) noexcept { return std::move(__p.second); } template <typename _Tp, typename _Up = _Tp> inline _Tp exchange(_Tp& __obj, _Up&& __new_val) { return std::__exchange(__obj, std::forward<_Up>(__new_val)); } template<size_t... _Indexes> struct _Index_tuple { }; # 307 "/usr/include/c++/10/utility" 3 template<size_t _Num> struct _Build_index_tuple { using __type = _Index_tuple<__integer_pack(_Num)...>; }; template<typename _Tp, _Tp... _Idx> struct integer_sequence { typedef _Tp value_type; static constexpr size_t size() noexcept { return sizeof...(_Idx); } }; template<typename _Tp, _Tp _Num> using make_integer_sequence = integer_sequence<_Tp, __integer_pack(_Num)...>; template<size_t... _Idx> using index_sequence = integer_sequence<size_t, _Idx...>; template<size_t _Num> using make_index_sequence = make_integer_sequence<size_t, _Num>; template<typename... _Types> using index_sequence_for = make_index_sequence<sizeof...(_Types)>; # 473 "/usr/include/c++/10/utility" 3 } # 238 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 259 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/c++/10/stdlib.h" 1 3 # 36 "/usr/include/c++/10/stdlib.h" 3 # 1 "/usr/include/c++/10/cstdlib" 1 3 # 39 "/usr/include/c++/10/cstdlib" 3 # 40 "/usr/include/c++/10/cstdlib" 3 # 75 "/usr/include/c++/10/cstdlib" 3 # 1 "/usr/include/stdlib.h" 1 3 4 # 25 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 26 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 32 "/usr/include/stdlib.h" 2 3 4 extern "C" { # 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4 # 52 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4 typedef enum { P_ALL, P_PID, P_PGID } idtype_t; # 40 "/usr/include/stdlib.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4 # 41 "/usr/include/stdlib.h" 2 3 4 # 55 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4 # 75 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4 typedef _Complex float __cfloat128 __attribute__ ((__mode__ (__TC__))); # 87 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4 typedef __float128 _Float128; # 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4 # 214 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 typedef float _Float32; # 251 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 typedef double _Float64; # 268 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 typedef double _Float32x; # 285 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4 typedef long double _Float64x; # 121 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4 # 56 "/usr/include/stdlib.h" 2 3 4 typedef struct { int quot; int rem; } div_t; typedef struct { long int quot; long int rem; } ldiv_t; __extension__ typedef struct { long long int quot; long long int rem; } lldiv_t; # 97 "/usr/include/stdlib.h" 3 4 extern size_t __ctype_get_mb_cur_max (void) throw () ; extern double atof (const char *__nptr) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern int atoi (const char *__nptr) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern long int atol (const char *__nptr) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; __extension__ extern long long int atoll (const char *__nptr) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; extern double strtod (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern float strtof (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern long double strtold (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); # 140 "/usr/include/stdlib.h" 3 4 extern _Float32 strtof32 (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern _Float64 strtof64 (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern _Float128 strtof128 (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern _Float32x strtof32x (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); extern _Float64x strtof64x (const char *__restrict __nptr, char **__restrict __endptr) throw () __attribute__ ((__nonnull__ (1))); # 176 "/usr/include/stdlib.h" 3 4 extern long int strtol (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); extern unsigned long int strtoul (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoq (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtouq (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); __extension__ extern long long int strtoll (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); __extension__ extern unsigned long long int strtoull (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw () __attribute__ ((__nonnull__ (1))); extern int strfromd (char *__dest, size_t __size, const char *__format, double __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfromf (char *__dest, size_t __size, const char *__format, float __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfroml (char *__dest, size_t __size, const char *__format, long double __f) throw () __attribute__ ((__nonnull__ (3))); # 232 "/usr/include/stdlib.h" 3 4 extern int strfromf32 (char *__dest, size_t __size, const char * __format, _Float32 __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfromf64 (char *__dest, size_t __size, const char * __format, _Float64 __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfromf128 (char *__dest, size_t __size, const char * __format, _Float128 __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfromf32x (char *__dest, size_t __size, const char * __format, _Float32x __f) throw () __attribute__ ((__nonnull__ (3))); extern int strfromf64x (char *__dest, size_t __size, const char * __format, _Float64x __f) throw () __attribute__ ((__nonnull__ (3))); # 274 "/usr/include/stdlib.h" 3 4 extern long int strtol_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))); extern unsigned long int strtoul_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))); __extension__ extern long long int strtoll_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))); __extension__ extern unsigned long long int strtoull_l (const char *__restrict __nptr, char **__restrict __endptr, int __base, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 4))); extern double strtod_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern float strtof_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern long double strtold_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); # 316 "/usr/include/stdlib.h" 3 4 extern _Float32 strtof32_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern _Float64 strtof64_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern _Float128 strtof128_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern _Float32x strtof32x_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); extern _Float64x strtof64x_l (const char *__restrict __nptr, char **__restrict __endptr, locale_t __loc) throw () __attribute__ ((__nonnull__ (1, 3))); # 360 "/usr/include/stdlib.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) atoi (const char *__nptr) throw () { return (int) strtol (__nptr, (char **) __null, 10); } extern __inline __attribute__ ((__gnu_inline__)) long int __attribute__ ((__leaf__)) atol (const char *__nptr) throw () { return strtol (__nptr, (char **) __null, 10); } __extension__ extern __inline __attribute__ ((__gnu_inline__)) long long int __attribute__ ((__leaf__)) atoll (const char *__nptr) throw () { return strtoll (__nptr, (char **) __null, 10); } # 385 "/usr/include/stdlib.h" 3 4 extern char *l64a (long int __n) throw () ; extern long int a64l (const char *__s) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ; # 401 "/usr/include/stdlib.h" 3 4 extern long int random (void) throw (); extern void srandom (unsigned int __seed) throw (); extern char *initstate (unsigned int __seed, char *__statebuf, size_t __statelen) throw () __attribute__ ((__nonnull__ (2))); extern char *setstate (char *__statebuf) throw () __attribute__ ((__nonnull__ (1))); struct random_data { int32_t *fptr; int32_t *rptr; int32_t *state; int rand_type; int rand_deg; int rand_sep; int32_t *end_ptr; }; extern int random_r (struct random_data *__restrict __buf, int32_t *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int srandom_r (unsigned int __seed, struct random_data *__buf) throw () __attribute__ ((__nonnull__ (2))); extern int initstate_r (unsigned int __seed, char *__restrict __statebuf, size_t __statelen, struct random_data *__restrict __buf) throw () __attribute__ ((__nonnull__ (2, 4))); extern int setstate_r (char *__restrict __statebuf, struct random_data *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); extern int rand (void) throw (); extern void srand (unsigned int __seed) throw (); extern int rand_r (unsigned int *__seed) throw (); extern double drand48 (void) throw (); extern double erand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1))); extern long int lrand48 (void) throw (); extern long int nrand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1))); extern long int mrand48 (void) throw (); extern long int jrand48 (unsigned short int __xsubi[3]) throw () __attribute__ ((__nonnull__ (1))); extern void srand48 (long int __seedval) throw (); extern unsigned short int *seed48 (unsigned short int __seed16v[3]) throw () __attribute__ ((__nonnull__ (1))); extern void lcong48 (unsigned short int __param[7]) throw () __attribute__ ((__nonnull__ (1))); struct drand48_data { unsigned short int __x[3]; unsigned short int __old_x[3]; unsigned short int __c; unsigned short int __init; __extension__ unsigned long long int __a; }; extern int drand48_r (struct drand48_data *__restrict __buffer, double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int erand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, double *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int lrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int nrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int mrand48_r (struct drand48_data *__restrict __buffer, long int *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int jrand48_r (unsigned short int __xsubi[3], struct drand48_data *__restrict __buffer, long int *__restrict __result) throw () __attribute__ ((__nonnull__ (1, 2))); extern int srand48_r (long int __seedval, struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (2))); extern int seed48_r (unsigned short int __seed16v[3], struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2))); extern int lcong48_r (unsigned short int __param[7], struct drand48_data *__buffer) throw () __attribute__ ((__nonnull__ (1, 2))); extern void *malloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1))) ; extern void *calloc (size_t __nmemb, size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1, 2))) ; extern void *realloc (void *__ptr, size_t __size) throw () __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2))); extern void *reallocarray (void *__ptr, size_t __nmemb, size_t __size) throw () __attribute__ ((__warn_unused_result__)) __attribute__ ((__alloc_size__ (2, 3))); extern void free (void *__ptr) throw (); # 1 "/usr/include/alloca.h" 1 3 4 # 24 "/usr/include/alloca.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 25 "/usr/include/alloca.h" 2 3 4 extern "C" { extern void *alloca (size_t __size) throw (); } # 569 "/usr/include/stdlib.h" 2 3 4 extern void *valloc (size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (1))) ; extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size) throw () __attribute__ ((__nonnull__ (1))) ; extern void *aligned_alloc (size_t __alignment, size_t __size) throw () __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ; extern void abort (void) throw () __attribute__ ((__noreturn__)); extern int atexit (void (*__func) (void)) throw () __attribute__ ((__nonnull__ (1))); extern "C++" int at_quick_exit (void (*__func) (void)) throw () __asm ("at_quick_exit") __attribute__ ((__nonnull__ (1))); # 610 "/usr/include/stdlib.h" 3 4 extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg) throw () __attribute__ ((__nonnull__ (1))); extern void exit (int __status) throw () __attribute__ ((__noreturn__)); extern void quick_exit (int __status) throw () __attribute__ ((__noreturn__)); extern void _Exit (int __status) throw () __attribute__ ((__noreturn__)); extern char *getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ; extern char *secure_getenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ; extern int putenv (char *__string) throw () __attribute__ ((__nonnull__ (1))); extern int setenv (const char *__name, const char *__value, int __replace) throw () __attribute__ ((__nonnull__ (2))); extern int unsetenv (const char *__name) throw () __attribute__ ((__nonnull__ (1))); extern int clearenv (void) throw (); # 675 "/usr/include/stdlib.h" 3 4 extern char *mktemp (char *__template) throw () __attribute__ ((__nonnull__ (1))); # 688 "/usr/include/stdlib.h" 3 4 extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ; # 698 "/usr/include/stdlib.h" 3 4 extern int mkstemp64 (char *__template) __attribute__ ((__nonnull__ (1))) ; # 710 "/usr/include/stdlib.h" 3 4 extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ; # 720 "/usr/include/stdlib.h" 3 4 extern int mkstemps64 (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ; # 731 "/usr/include/stdlib.h" 3 4 extern char *mkdtemp (char *__template) throw () __attribute__ ((__nonnull__ (1))) ; # 742 "/usr/include/stdlib.h" 3 4 extern int mkostemp (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ; # 752 "/usr/include/stdlib.h" 3 4 extern int mkostemp64 (char *__template, int __flags) __attribute__ ((__nonnull__ (1))) ; # 762 "/usr/include/stdlib.h" 3 4 extern int mkostemps (char *__template, int __suffixlen, int __flags) __attribute__ ((__nonnull__ (1))) ; # 774 "/usr/include/stdlib.h" 3 4 extern int mkostemps64 (char *__template, int __suffixlen, int __flags) __attribute__ ((__nonnull__ (1))) ; # 784 "/usr/include/stdlib.h" 3 4 extern int system (const char *__command) ; extern char *canonicalize_file_name (const char *__name) throw () __attribute__ ((__nonnull__ (1))) ; # 800 "/usr/include/stdlib.h" 3 4 extern char *realpath (const char *__restrict __name, char *__restrict __resolved) throw () ; typedef int (*__compar_fn_t) (const void *, const void *); typedef __compar_fn_t comparison_fn_t; typedef int (*__compar_d_fn_t) (const void *, const void *, void *); extern void *bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 2, 5))) ; # 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h" 1 3 4 # 19 "/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) void * bsearch (const void *__key, const void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) { size_t __l, __u, __idx; const void *__p; int __comparison; __l = 0; __u = __nmemb; while (__l < __u) { __idx = (__l + __u) / 2; __p = (void *) (((const char *) __base) + (__idx * __size)); __comparison = (*__compar) (__key, __p); if (__comparison < 0) __u = __idx; else if (__comparison > 0) __l = __idx + 1; else return (void *) __p; } return __null; } # 826 "/usr/include/stdlib.h" 2 3 4 extern void qsort (void *__base, size_t __nmemb, size_t __size, __compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4))); extern void qsort_r (void *__base, size_t __nmemb, size_t __size, __compar_d_fn_t __compar, void *__arg) __attribute__ ((__nonnull__ (1, 4))); extern int abs (int __x) throw () __attribute__ ((__const__)) ; extern long int labs (long int __x) throw () __attribute__ ((__const__)) ; __extension__ extern long long int llabs (long long int __x) throw () __attribute__ ((__const__)) ; extern div_t div (int __numer, int __denom) throw () __attribute__ ((__const__)) ; extern ldiv_t ldiv (long int __numer, long int __denom) throw () __attribute__ ((__const__)) ; __extension__ extern lldiv_t lldiv (long long int __numer, long long int __denom) throw () __attribute__ ((__const__)) ; # 872 "/usr/include/stdlib.h" 3 4 extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ; extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ; extern char *gcvt (double __value, int __ndigit, char *__buf) throw () __attribute__ ((__nonnull__ (3))) ; extern char *qecvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ; extern char *qfcvt (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign) throw () __attribute__ ((__nonnull__ (3, 4))) ; extern char *qgcvt (long double __value, int __ndigit, char *__buf) throw () __attribute__ ((__nonnull__ (3))) ; extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5))); extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5))); extern int qecvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5))); extern int qfcvt_r (long double __value, int __ndigit, int *__restrict __decpt, int *__restrict __sign, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (3, 4, 5))); extern int mblen (const char *__s, size_t __n) throw (); extern int mbtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n) throw (); extern int wctomb (char *__s, wchar_t __wchar) throw (); extern size_t mbstowcs (wchar_t *__restrict __pwcs, const char *__restrict __s, size_t __n) throw (); extern size_t wcstombs (char *__restrict __s, const wchar_t *__restrict __pwcs, size_t __n) throw (); extern int rpmatch (const char *__response) throw () __attribute__ ((__nonnull__ (1))) ; # 957 "/usr/include/stdlib.h" 3 4 extern int getsubopt (char **__restrict __optionp, char *const *__restrict __tokens, char **__restrict __valuep) throw () __attribute__ ((__nonnull__ (1, 2, 3))) ; extern int posix_openpt (int __oflag) ; extern int grantpt (int __fd) throw (); extern int unlockpt (int __fd) throw (); extern char *ptsname (int __fd) throw () ; extern int ptsname_r (int __fd, char *__buf, size_t __buflen) throw () __attribute__ ((__nonnull__ (2))); extern int getpt (void); extern int getloadavg (double __loadavg[], int __nelem) throw () __attribute__ ((__nonnull__ (1))); # 1013 "/usr/include/stdlib.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 3 4 extern __inline __attribute__ ((__gnu_inline__)) double __attribute__ ((__leaf__)) atof (const char *__nptr) throw () { return strtod (__nptr, (char **) __null); } # 1014 "/usr/include/stdlib.h" 2 3 4 # 1023 "/usr/include/stdlib.h" 3 4 } # 76 "/usr/include/c++/10/cstdlib" 2 3 # 1 "/usr/include/c++/10/bits/std_abs.h" 1 3 # 33 "/usr/include/c++/10/bits/std_abs.h" 3 # 34 "/usr/include/c++/10/bits/std_abs.h" 3 # 46 "/usr/include/c++/10/bits/std_abs.h" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { using ::abs; inline long abs(long __i) { return __builtin_labs(__i); } inline long long abs(long long __x) { return __builtin_llabs (__x); } # 70 "/usr/include/c++/10/bits/std_abs.h" 3 inline constexpr double abs(double __x) { return __builtin_fabs(__x); } inline constexpr float abs(float __x) { return __builtin_fabsf(__x); } inline constexpr long double abs(long double __x) { return __builtin_fabsl(__x); } inline constexpr __int128 abs(__int128 __x) { return __x >= 0 ? __x : -__x; } # 101 "/usr/include/c++/10/bits/std_abs.h" 3 inline constexpr __float128 abs(__float128 __x) { return __x < 0 ? -__x : __x; } } } # 78 "/usr/include/c++/10/cstdlib" 2 3 # 121 "/usr/include/c++/10/cstdlib" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { using ::div_t; using ::ldiv_t; using ::abort; using ::atexit; using ::at_quick_exit; using ::atof; using ::atoi; using ::atol; using ::bsearch; using ::calloc; using ::div; using ::exit; using ::free; using ::getenv; using ::labs; using ::ldiv; using ::malloc; using ::mblen; using ::mbstowcs; using ::mbtowc; using ::qsort; using ::quick_exit; using ::rand; using ::realloc; using ::srand; using ::strtod; using ::strtol; using ::strtoul; using ::system; using ::wcstombs; using ::wctomb; inline ldiv_t div(long __i, long __j) { return ldiv(__i, __j); } } # 195 "/usr/include/c++/10/cstdlib" 3 namespace __gnu_cxx __attribute__ ((__visibility__ ("default"))) { using ::lldiv_t; using ::_Exit; using ::llabs; inline lldiv_t div(long long __n, long long __d) { lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; } using ::lldiv; # 227 "/usr/include/c++/10/cstdlib" 3 using ::atoll; using ::strtoll; using ::strtoull; using ::strtof; using ::strtold; } namespace std { using ::__gnu_cxx::lldiv_t; using ::__gnu_cxx::_Exit; using ::__gnu_cxx::llabs; using ::__gnu_cxx::div; using ::__gnu_cxx::lldiv; using ::__gnu_cxx::atoll; using ::__gnu_cxx::strtof; using ::__gnu_cxx::strtoll; using ::__gnu_cxx::strtoull; using ::__gnu_cxx::strtold; } } # 37 "/usr/include/c++/10/stdlib.h" 2 3 using std::abort; using std::atexit; using std::exit; using std::at_quick_exit; using std::quick_exit; using std::div_t; using std::ldiv_t; using std::abs; using std::atof; using std::atoi; using std::atol; using std::bsearch; using std::calloc; using std::div; using std::free; using std::getenv; using std::labs; using std::ldiv; using std::malloc; using std::mblen; using std::mbstowcs; using std::mbtowc; using std::qsort; using std::rand; using std::realloc; using std::srand; using std::strtod; using std::strtol; using std::strtoul; using std::system; using std::wcstombs; using std::wctomb; # 260 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/c++/10/cstdlib" 1 3 # 39 "/usr/include/c++/10/cstdlib" 3 # 40 "/usr/include/c++/10/cstdlib" 3 # 268 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 295 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/unistd.h" 1 3 4 # 27 "/usr/include/unistd.h" 3 4 extern "C" { # 202 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4 # 203 "/usr/include/unistd.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4 # 207 "/usr/include/unistd.h" 2 3 4 # 226 "/usr/include/unistd.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 227 "/usr/include/unistd.h" 2 3 4 # 267 "/usr/include/unistd.h" 3 4 typedef __intptr_t intptr_t; typedef __socklen_t socklen_t; # 287 "/usr/include/unistd.h" 3 4 extern int access (const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1))); extern int euidaccess (const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1))); extern int eaccess (const char *__name, int __type) throw () __attribute__ ((__nonnull__ (1))); extern int faccessat (int __fd, const char *__file, int __type, int __flag) throw () __attribute__ ((__nonnull__ (2))) ; # 334 "/usr/include/unistd.h" 3 4 extern __off_t lseek (int __fd, __off_t __offset, int __whence) throw (); # 345 "/usr/include/unistd.h" 3 4 extern __off64_t lseek64 (int __fd, __off64_t __offset, int __whence) throw (); extern int close (int __fd); extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ; extern ssize_t write (int __fd, const void *__buf, size_t __n) ; # 376 "/usr/include/unistd.h" 3 4 extern ssize_t pread (int __fd, void *__buf, size_t __nbytes, __off_t __offset) ; extern ssize_t pwrite (int __fd, const void *__buf, size_t __n, __off_t __offset) ; # 404 "/usr/include/unistd.h" 3 4 extern ssize_t pread64 (int __fd, void *__buf, size_t __nbytes, __off64_t __offset) ; extern ssize_t pwrite64 (int __fd, const void *__buf, size_t __n, __off64_t __offset) ; extern int pipe (int __pipedes[2]) throw () ; extern int pipe2 (int __pipedes[2], int __flags) throw () ; # 432 "/usr/include/unistd.h" 3 4 extern unsigned int alarm (unsigned int __seconds) throw (); # 444 "/usr/include/unistd.h" 3 4 extern unsigned int sleep (unsigned int __seconds); extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval) throw (); extern int usleep (__useconds_t __useconds); # 469 "/usr/include/unistd.h" 3 4 extern int pause (void); extern int chown (const char *__file, __uid_t __owner, __gid_t __group) throw () __attribute__ ((__nonnull__ (1))) ; extern int fchown (int __fd, __uid_t __owner, __gid_t __group) throw () ; extern int lchown (const char *__file, __uid_t __owner, __gid_t __group) throw () __attribute__ ((__nonnull__ (1))) ; extern int fchownat (int __fd, const char *__file, __uid_t __owner, __gid_t __group, int __flag) throw () __attribute__ ((__nonnull__ (2))) ; extern int chdir (const char *__path) throw () __attribute__ ((__nonnull__ (1))) ; extern int fchdir (int __fd) throw () ; # 511 "/usr/include/unistd.h" 3 4 extern char *getcwd (char *__buf, size_t __size) throw () ; extern char *get_current_dir_name (void) throw (); extern char *getwd (char *__buf) throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ; extern int dup (int __fd) throw () ; extern int dup2 (int __fd, int __fd2) throw (); extern int dup3 (int __fd, int __fd2, int __flags) throw (); extern char **__environ; extern char **environ; extern int execve (const char *__path, char *const __argv[], char *const __envp[]) throw () __attribute__ ((__nonnull__ (1, 2))); extern int fexecve (int __fd, char *const __argv[], char *const __envp[]) throw () __attribute__ ((__nonnull__ (2))); extern int execv (const char *__path, char *const __argv[]) throw () __attribute__ ((__nonnull__ (1, 2))); extern int execle (const char *__path, const char *__arg, ...) throw () __attribute__ ((__nonnull__ (1, 2))); extern int execl (const char *__path, const char *__arg, ...) throw () __attribute__ ((__nonnull__ (1, 2))); extern int execvp (const char *__file, char *const __argv[]) throw () __attribute__ ((__nonnull__ (1, 2))); extern int execlp (const char *__file, const char *__arg, ...) throw () __attribute__ ((__nonnull__ (1, 2))); extern int execvpe (const char *__file, char *const __argv[], char *const __envp[]) throw () __attribute__ ((__nonnull__ (1, 2))); extern int nice (int __inc) throw () ; extern void _exit (int __status) __attribute__ ((__noreturn__)); # 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4 enum { _PC_LINK_MAX, _PC_MAX_CANON, _PC_MAX_INPUT, _PC_NAME_MAX, _PC_PATH_MAX, _PC_PIPE_BUF, _PC_CHOWN_RESTRICTED, _PC_NO_TRUNC, _PC_VDISABLE, _PC_SYNC_IO, _PC_ASYNC_IO, _PC_PRIO_IO, _PC_SOCK_MAXBUF, _PC_FILESIZEBITS, _PC_REC_INCR_XFER_SIZE, _PC_REC_MAX_XFER_SIZE, _PC_REC_MIN_XFER_SIZE, _PC_REC_XFER_ALIGN, _PC_ALLOC_SIZE_MIN, _PC_SYMLINK_MAX, _PC_2_SYMLINKS }; enum { _SC_ARG_MAX, _SC_CHILD_MAX, _SC_CLK_TCK, _SC_NGROUPS_MAX, _SC_OPEN_MAX, _SC_STREAM_MAX, _SC_TZNAME_MAX, _SC_JOB_CONTROL, _SC_SAVED_IDS, _SC_REALTIME_SIGNALS, _SC_PRIORITY_SCHEDULING, _SC_TIMERS, _SC_ASYNCHRONOUS_IO, _SC_PRIORITIZED_IO, _SC_SYNCHRONIZED_IO, _SC_FSYNC, _SC_MAPPED_FILES, _SC_MEMLOCK, _SC_MEMLOCK_RANGE, _SC_MEMORY_PROTECTION, _SC_MESSAGE_PASSING, _SC_SEMAPHORES, _SC_SHARED_MEMORY_OBJECTS, _SC_AIO_LISTIO_MAX, _SC_AIO_MAX, _SC_AIO_PRIO_DELTA_MAX, _SC_DELAYTIMER_MAX, _SC_MQ_OPEN_MAX, _SC_MQ_PRIO_MAX, _SC_VERSION, _SC_PAGESIZE, _SC_RTSIG_MAX, _SC_SEM_NSEMS_MAX, _SC_SEM_VALUE_MAX, _SC_SIGQUEUE_MAX, _SC_TIMER_MAX, _SC_BC_BASE_MAX, _SC_BC_DIM_MAX, _SC_BC_SCALE_MAX, _SC_BC_STRING_MAX, _SC_COLL_WEIGHTS_MAX, _SC_EQUIV_CLASS_MAX, _SC_EXPR_NEST_MAX, _SC_LINE_MAX, _SC_RE_DUP_MAX, _SC_CHARCLASS_NAME_MAX, _SC_2_VERSION, _SC_2_C_BIND, _SC_2_C_DEV, _SC_2_FORT_DEV, _SC_2_FORT_RUN, _SC_2_SW_DEV, _SC_2_LOCALEDEF, _SC_PII, _SC_PII_XTI, _SC_PII_SOCKET, _SC_PII_INTERNET, _SC_PII_OSI, _SC_POLL, _SC_SELECT, _SC_UIO_MAXIOV, _SC_IOV_MAX = _SC_UIO_MAXIOV, _SC_PII_INTERNET_STREAM, _SC_PII_INTERNET_DGRAM, _SC_PII_OSI_COTS, _SC_PII_OSI_CLTS, _SC_PII_OSI_M, _SC_T_IOV_MAX, _SC_THREADS, _SC_THREAD_SAFE_FUNCTIONS, _SC_GETGR_R_SIZE_MAX, _SC_GETPW_R_SIZE_MAX, _SC_LOGIN_NAME_MAX, _SC_TTY_NAME_MAX, _SC_THREAD_DESTRUCTOR_ITERATIONS, _SC_THREAD_KEYS_MAX, _SC_THREAD_STACK_MIN, _SC_THREAD_THREADS_MAX, _SC_THREAD_ATTR_STACKADDR, _SC_THREAD_ATTR_STACKSIZE, _SC_THREAD_PRIORITY_SCHEDULING, _SC_THREAD_PRIO_INHERIT, _SC_THREAD_PRIO_PROTECT, _SC_THREAD_PROCESS_SHARED, _SC_NPROCESSORS_CONF, _SC_NPROCESSORS_ONLN, _SC_PHYS_PAGES, _SC_AVPHYS_PAGES, _SC_ATEXIT_MAX, _SC_PASS_MAX, _SC_XOPEN_VERSION, _SC_XOPEN_XCU_VERSION, _SC_XOPEN_UNIX, _SC_XOPEN_CRYPT, _SC_XOPEN_ENH_I18N, _SC_XOPEN_SHM, _SC_2_CHAR_TERM, _SC_2_C_VERSION, _SC_2_UPE, _SC_XOPEN_XPG2, _SC_XOPEN_XPG3, _SC_XOPEN_XPG4, _SC_CHAR_BIT, _SC_CHAR_MAX, _SC_CHAR_MIN, _SC_INT_MAX, _SC_INT_MIN, _SC_LONG_BIT, _SC_WORD_BIT, _SC_MB_LEN_MAX, _SC_NZERO, _SC_SSIZE_MAX, _SC_SCHAR_MAX, _SC_SCHAR_MIN, _SC_SHRT_MAX, _SC_SHRT_MIN, _SC_UCHAR_MAX, _SC_UINT_MAX, _SC_ULONG_MAX, _SC_USHRT_MAX, _SC_NL_ARGMAX, _SC_NL_LANGMAX, _SC_NL_MSGMAX, _SC_NL_NMAX, _SC_NL_SETMAX, _SC_NL_TEXTMAX, _SC_XBS5_ILP32_OFF32, _SC_XBS5_ILP32_OFFBIG, _SC_XBS5_LP64_OFF64, _SC_XBS5_LPBIG_OFFBIG, _SC_XOPEN_LEGACY, _SC_XOPEN_REALTIME, _SC_XOPEN_REALTIME_THREADS, _SC_ADVISORY_INFO, _SC_BARRIERS, _SC_BASE, _SC_C_LANG_SUPPORT, _SC_C_LANG_SUPPORT_R, _SC_CLOCK_SELECTION, _SC_CPUTIME, _SC_THREAD_CPUTIME, _SC_DEVICE_IO, _SC_DEVICE_SPECIFIC, _SC_DEVICE_SPECIFIC_R, _SC_FD_MGMT, _SC_FIFO, _SC_PIPE, _SC_FILE_ATTRIBUTES, _SC_FILE_LOCKING, _SC_FILE_SYSTEM, _SC_MONOTONIC_CLOCK, _SC_MULTI_PROCESS, _SC_SINGLE_PROCESS, _SC_NETWORKING, _SC_READER_WRITER_LOCKS, _SC_SPIN_LOCKS, _SC_REGEXP, _SC_REGEX_VERSION, _SC_SHELL, _SC_SIGNALS, _SC_SPAWN, _SC_SPORADIC_SERVER, _SC_THREAD_SPORADIC_SERVER, _SC_SYSTEM_DATABASE, _SC_SYSTEM_DATABASE_R, _SC_TIMEOUTS, _SC_TYPED_MEMORY_OBJECTS, _SC_USER_GROUPS, _SC_USER_GROUPS_R, _SC_2_PBS, _SC_2_PBS_ACCOUNTING, _SC_2_PBS_LOCATE, _SC_2_PBS_MESSAGE, _SC_2_PBS_TRACK, _SC_SYMLOOP_MAX, _SC_STREAMS, _SC_2_PBS_CHECKPOINT, _SC_V6_ILP32_OFF32, _SC_V6_ILP32_OFFBIG, _SC_V6_LP64_OFF64, _SC_V6_LPBIG_OFFBIG, _SC_HOST_NAME_MAX, _SC_TRACE, _SC_TRACE_EVENT_FILTER, _SC_TRACE_INHERIT, _SC_TRACE_LOG, _SC_LEVEL1_ICACHE_SIZE, _SC_LEVEL1_ICACHE_ASSOC, _SC_LEVEL1_ICACHE_LINESIZE, _SC_LEVEL1_DCACHE_SIZE, _SC_LEVEL1_DCACHE_ASSOC, _SC_LEVEL1_DCACHE_LINESIZE, _SC_LEVEL2_CACHE_SIZE, _SC_LEVEL2_CACHE_ASSOC, _SC_LEVEL2_CACHE_LINESIZE, _SC_LEVEL3_CACHE_SIZE, _SC_LEVEL3_CACHE_ASSOC, _SC_LEVEL3_CACHE_LINESIZE, _SC_LEVEL4_CACHE_SIZE, _SC_LEVEL4_CACHE_ASSOC, _SC_LEVEL4_CACHE_LINESIZE, _SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50, _SC_RAW_SOCKETS, _SC_V7_ILP32_OFF32, _SC_V7_ILP32_OFFBIG, _SC_V7_LP64_OFF64, _SC_V7_LPBIG_OFFBIG, _SC_SS_REPL_MAX, _SC_TRACE_EVENT_NAME_MAX, _SC_TRACE_NAME_MAX, _SC_TRACE_SYS_MAX, _SC_TRACE_USER_EVENT_MAX, _SC_XOPEN_STREAMS, _SC_THREAD_ROBUST_PRIO_INHERIT, _SC_THREAD_ROBUST_PRIO_PROTECT }; enum { _CS_PATH, _CS_V6_WIDTH_RESTRICTED_ENVS, _CS_GNU_LIBC_VERSION, _CS_GNU_LIBPTHREAD_VERSION, _CS_V5_WIDTH_RESTRICTED_ENVS, _CS_V7_WIDTH_RESTRICTED_ENVS, _CS_LFS_CFLAGS = 1000, _CS_LFS_LDFLAGS, _CS_LFS_LIBS, _CS_LFS_LINTFLAGS, _CS_LFS64_CFLAGS, _CS_LFS64_LDFLAGS, _CS_LFS64_LIBS, _CS_LFS64_LINTFLAGS, _CS_XBS5_ILP32_OFF32_CFLAGS = 1100, _CS_XBS5_ILP32_OFF32_LDFLAGS, _CS_XBS5_ILP32_OFF32_LIBS, _CS_XBS5_ILP32_OFF32_LINTFLAGS, _CS_XBS5_ILP32_OFFBIG_CFLAGS, _CS_XBS5_ILP32_OFFBIG_LDFLAGS, _CS_XBS5_ILP32_OFFBIG_LIBS, _CS_XBS5_ILP32_OFFBIG_LINTFLAGS, _CS_XBS5_LP64_OFF64_CFLAGS, _CS_XBS5_LP64_OFF64_LDFLAGS, _CS_XBS5_LP64_OFF64_LIBS, _CS_XBS5_LP64_OFF64_LINTFLAGS, _CS_XBS5_LPBIG_OFFBIG_CFLAGS, _CS_XBS5_LPBIG_OFFBIG_LDFLAGS, _CS_XBS5_LPBIG_OFFBIG_LIBS, _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V6_ILP32_OFF32_CFLAGS, _CS_POSIX_V6_ILP32_OFF32_LDFLAGS, _CS_POSIX_V6_ILP32_OFF32_LIBS, _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V6_ILP32_OFFBIG_LIBS, _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V6_LP64_OFF64_CFLAGS, _CS_POSIX_V6_LP64_OFF64_LDFLAGS, _CS_POSIX_V6_LP64_OFF64_LIBS, _CS_POSIX_V6_LP64_OFF64_LINTFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V6_LPBIG_OFFBIG_LIBS, _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS, _CS_POSIX_V7_ILP32_OFF32_CFLAGS, _CS_POSIX_V7_ILP32_OFF32_LDFLAGS, _CS_POSIX_V7_ILP32_OFF32_LIBS, _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS, _CS_POSIX_V7_ILP32_OFFBIG_LIBS, _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS, _CS_POSIX_V7_LP64_OFF64_CFLAGS, _CS_POSIX_V7_LP64_OFF64_LDFLAGS, _CS_POSIX_V7_LP64_OFF64_LIBS, _CS_POSIX_V7_LP64_OFF64_LINTFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS, _CS_POSIX_V7_LPBIG_OFFBIG_LIBS, _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS, _CS_V6_ENV, _CS_V7_ENV }; # 610 "/usr/include/unistd.h" 2 3 4 extern long int pathconf (const char *__path, int __name) throw () __attribute__ ((__nonnull__ (1))); extern long int fpathconf (int __fd, int __name) throw (); extern long int sysconf (int __name) throw (); extern size_t confstr (int __name, char *__buf, size_t __len) throw (); extern __pid_t getpid (void) throw (); extern __pid_t getppid (void) throw (); extern __pid_t getpgrp (void) throw (); extern __pid_t __getpgid (__pid_t __pid) throw (); extern __pid_t getpgid (__pid_t __pid) throw (); extern int setpgid (__pid_t __pid, __pid_t __pgid) throw (); # 660 "/usr/include/unistd.h" 3 4 extern int setpgrp (void) throw (); extern __pid_t setsid (void) throw (); extern __pid_t getsid (__pid_t __pid) throw (); extern __uid_t getuid (void) throw (); extern __uid_t geteuid (void) throw (); extern __gid_t getgid (void) throw (); extern __gid_t getegid (void) throw (); extern int getgroups (int __size, __gid_t __list[]) throw () ; extern int group_member (__gid_t __gid) throw (); extern int setuid (__uid_t __uid) throw () ; extern int setreuid (__uid_t __ruid, __uid_t __euid) throw () ; extern int seteuid (__uid_t __uid) throw () ; extern int setgid (__gid_t __gid) throw () ; extern int setregid (__gid_t __rgid, __gid_t __egid) throw () ; extern int setegid (__gid_t __gid) throw () ; extern int getresuid (__uid_t *__ruid, __uid_t *__euid, __uid_t *__suid) throw (); extern int getresgid (__gid_t *__rgid, __gid_t *__egid, __gid_t *__sgid) throw (); extern int setresuid (__uid_t __ruid, __uid_t __euid, __uid_t __suid) throw () ; extern int setresgid (__gid_t __rgid, __gid_t __egid, __gid_t __sgid) throw () ; extern __pid_t fork (void) throw (); extern __pid_t vfork (void) throw (); extern char *ttyname (int __fd) throw (); extern int ttyname_r (int __fd, char *__buf, size_t __buflen) throw () __attribute__ ((__nonnull__ (2))) ; extern int isatty (int __fd) throw (); extern int ttyslot (void) throw (); extern int link (const char *__from, const char *__to) throw () __attribute__ ((__nonnull__ (1, 2))) ; extern int linkat (int __fromfd, const char *__from, int __tofd, const char *__to, int __flags) throw () __attribute__ ((__nonnull__ (2, 4))) ; extern int symlink (const char *__from, const char *__to) throw () __attribute__ ((__nonnull__ (1, 2))) ; extern ssize_t readlink (const char *__restrict __path, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (1, 2))) ; extern int symlinkat (const char *__from, int __tofd, const char *__to) throw () __attribute__ ((__nonnull__ (1, 3))) ; extern ssize_t readlinkat (int __fd, const char *__restrict __path, char *__restrict __buf, size_t __len) throw () __attribute__ ((__nonnull__ (2, 3))) ; extern int unlink (const char *__name) throw () __attribute__ ((__nonnull__ (1))); extern int unlinkat (int __fd, const char *__name, int __flag) throw () __attribute__ ((__nonnull__ (2))); extern int rmdir (const char *__path) throw () __attribute__ ((__nonnull__ (1))); extern __pid_t tcgetpgrp (int __fd) throw (); extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) throw (); extern char *getlogin (void); extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1))); extern int setlogin (const char *__name) throw () __attribute__ ((__nonnull__ (1))); # 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern "C" { extern char *optarg; # 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern int optind; extern int opterr; extern int optopt; # 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4 extern int getopt (int ___argc, char *const *___argv, const char *__shortopts) throw () __attribute__ ((__nonnull__ (2, 3))); } # 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4 extern "C" { # 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4 } # 870 "/usr/include/unistd.h" 2 3 4 extern int gethostname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1))); extern int sethostname (const char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1))) ; extern int sethostid (long int __id) throw () ; extern int getdomainname (char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1))) ; extern int setdomainname (const char *__name, size_t __len) throw () __attribute__ ((__nonnull__ (1))) ; extern int vhangup (void) throw (); extern int revoke (const char *__file) throw () __attribute__ ((__nonnull__ (1))) ; extern int profil (unsigned short int *__sample_buffer, size_t __size, size_t __offset, unsigned int __scale) throw () __attribute__ ((__nonnull__ (1))); extern int acct (const char *__name) throw (); extern char *getusershell (void) throw (); extern void endusershell (void) throw (); extern void setusershell (void) throw (); extern int daemon (int __nochdir, int __noclose) throw () ; extern int chroot (const char *__path) throw () __attribute__ ((__nonnull__ (1))) ; extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1))); extern int fsync (int __fd); extern int syncfs (int __fd) throw (); extern long int gethostid (void); extern void sync (void) throw (); extern int getpagesize (void) throw () __attribute__ ((__const__)); extern int getdtablesize (void) throw (); # 991 "/usr/include/unistd.h" 3 4 extern int truncate (const char *__file, __off_t __length) throw () __attribute__ ((__nonnull__ (1))) ; # 1003 "/usr/include/unistd.h" 3 4 extern int truncate64 (const char *__file, __off64_t __length) throw () __attribute__ ((__nonnull__ (1))) ; # 1014 "/usr/include/unistd.h" 3 4 extern int ftruncate (int __fd, __off_t __length) throw () ; # 1024 "/usr/include/unistd.h" 3 4 extern int ftruncate64 (int __fd, __off64_t __length) throw () ; # 1035 "/usr/include/unistd.h" 3 4 extern int brk (void *__addr) throw () ; extern void *sbrk (intptr_t __delta) throw (); # 1056 "/usr/include/unistd.h" 3 4 extern long int syscall (long int __sysno, ...) throw (); # 1079 "/usr/include/unistd.h" 3 4 extern int lockf (int __fd, int __cmd, __off_t __len) ; # 1089 "/usr/include/unistd.h" 3 4 extern int lockf64 (int __fd, int __cmd, __off64_t __len) ; # 1107 "/usr/include/unistd.h" 3 4 ssize_t copy_file_range (int __infd, __off64_t *__pinoff, int __outfd, __off64_t *__poutoff, size_t __length, unsigned int __flags); extern int fdatasync (int __fildes); # 1124 "/usr/include/unistd.h" 3 4 extern char *crypt (const char *__key, const char *__salt) throw () __attribute__ ((__nonnull__ (1, 2))); extern void swab (const void *__restrict __from, void *__restrict __to, ssize_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); # 1161 "/usr/include/unistd.h" 3 4 int getentropy (void *__buffer, size_t __length) ; # 1170 "/usr/include/unistd.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 1 3 4 # 34 "/usr/include/x86_64-linux-gnu/bits/unistd_ext.h" 3 4 extern __pid_t gettid (void) throw (); # 1171 "/usr/include/unistd.h" 2 3 4 } # 296 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/x86_64-linux-gnu/sys/param.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/sys/param.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4 # 34 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/syslimits.h" 1 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4 # 195 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 3 4 # 1 "/usr/include/limits.h" 1 3 4 # 26 "/usr/include/limits.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/limits.h" 2 3 4 # 183 "/usr/include/limits.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4 # 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4 # 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4 # 1 "/usr/include/linux/limits.h" 1 3 4 # 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4 # 162 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4 # 184 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/posix2_lim.h" 1 3 4 # 188 "/usr/include/limits.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 1 3 4 # 64 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/uio_lim.h" 1 3 4 # 65 "/usr/include/x86_64-linux-gnu/bits/xopen_lim.h" 2 3 4 # 192 "/usr/include/limits.h" 2 3 4 # 196 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 2 3 4 # 8 "/usr/lib/gcc/x86_64-linux-gnu/10/include/syslimits.h" 2 3 4 # 35 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 2 3 4 # 27 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4 # 1 "/usr/include/signal.h" 1 3 4 # 27 "/usr/include/signal.h" 3 4 extern "C" { # 1 "/usr/include/x86_64-linux-gnu/bits/signum.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/signum.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/signum.h" 2 3 4 # 31 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4 typedef __sig_atomic_t sig_atomic_t; # 33 "/usr/include/signal.h" 2 3 4 # 57 "/usr/include/signal.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4 union sigval { int sival_int; void *sival_ptr; }; typedef union sigval __sigval_t; # 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4 # 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4 # 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4 # 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4 typedef struct { int si_signo; int si_errno; int si_code; int __pad0; union { int _pad[((128 / sizeof (int)) - 4)]; struct { __pid_t si_pid; __uid_t si_uid; } _kill; struct { int si_tid; int si_overrun; __sigval_t si_sigval; } _timer; struct { __pid_t si_pid; __uid_t si_uid; __sigval_t si_sigval; } _rt; struct { __pid_t si_pid; __uid_t si_uid; int si_status; __clock_t si_utime; __clock_t si_stime; } _sigchld; struct { void *si_addr; short int si_addr_lsb; union { struct { void *_lower; void *_upper; } _addr_bnd; __uint32_t _pkey; } _bounds; } _sigfault; struct { long int si_band; int si_fd; } _sigpoll; struct { void *_call_addr; int _syscall; unsigned int _arch; } _sigsys; } _sifields; } siginfo_t ; # 58 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4 enum { SI_ASYNCNL = -60, SI_DETHREAD = -7, SI_TKILL, SI_SIGIO, SI_ASYNCIO, SI_MESGQ, SI_TIMER, SI_QUEUE, SI_USER, SI_KERNEL = 0x80 # 66 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4 }; enum { ILL_ILLOPC = 1, ILL_ILLOPN, ILL_ILLADR, ILL_ILLTRP, ILL_PRVOPC, ILL_PRVREG, ILL_COPROC, ILL_BADSTK, ILL_BADIADDR }; enum { FPE_INTDIV = 1, FPE_INTOVF, FPE_FLTDIV, FPE_FLTOVF, FPE_FLTUND, FPE_FLTRES, FPE_FLTINV, FPE_FLTSUB, FPE_FLTUNK = 14, FPE_CONDTRAP }; enum { SEGV_MAPERR = 1, SEGV_ACCERR, SEGV_BNDERR, SEGV_PKUERR, SEGV_ACCADI, SEGV_ADIDERR, SEGV_ADIPERR }; enum { BUS_ADRALN = 1, BUS_ADRERR, BUS_OBJERR, BUS_MCEERR_AR, BUS_MCEERR_AO }; enum { TRAP_BRKPT = 1, TRAP_TRACE, TRAP_BRANCH, TRAP_HWBKPT, TRAP_UNK }; enum { CLD_EXITED = 1, CLD_KILLED, CLD_DUMPED, CLD_TRAPPED, CLD_STOPPED, CLD_CONTINUED }; enum { POLL_IN = 1, POLL_OUT, POLL_MSG, POLL_ERR, POLL_PRI, POLL_HUP }; # 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts-arch.h" 1 3 4 # 210 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 2 3 4 # 59 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4 # 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4 typedef __sigval_t sigval_t; # 63 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4 # 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4 typedef struct sigevent { __sigval_t sigev_value; int sigev_signo; int sigev_notify; union { int _pad[((64 / sizeof (int)) - 4)]; __pid_t _tid; struct { void (*_function) (__sigval_t); pthread_attr_t *_attribute; } _sigev_thread; } _sigev_un; } sigevent_t; # 67 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4 enum { SIGEV_SIGNAL = 0, SIGEV_NONE, SIGEV_THREAD, SIGEV_THREAD_ID = 4 }; # 68 "/usr/include/signal.h" 2 3 4 typedef void (*__sighandler_t) (int); extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler) throw (); extern __sighandler_t sysv_signal (int __sig, __sighandler_t __handler) throw (); extern __sighandler_t signal (int __sig, __sighandler_t __handler) throw (); # 112 "/usr/include/signal.h" 3 4 extern int kill (__pid_t __pid, int __sig) throw (); extern int killpg (__pid_t __pgrp, int __sig) throw (); extern int raise (int __sig) throw (); extern __sighandler_t ssignal (int __sig, __sighandler_t __handler) throw (); extern int gsignal (int __sig) throw (); extern void psignal (int __sig, const char *__s); extern void psiginfo (const siginfo_t *__pinfo, const char *__s); # 151 "/usr/include/signal.h" 3 4 extern int sigpause (int __sig) __asm__ ("__xpg_sigpause"); # 170 "/usr/include/signal.h" 3 4 extern int sigblock (int __mask) throw () __attribute__ ((__deprecated__)); extern int sigsetmask (int __mask) throw () __attribute__ ((__deprecated__)); extern int siggetmask (void) throw () __attribute__ ((__deprecated__)); # 185 "/usr/include/signal.h" 3 4 typedef __sighandler_t sighandler_t; typedef __sighandler_t sig_t; extern int sigemptyset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1))); extern int sigfillset (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1))); extern int sigaddset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1))); extern int sigdelset (sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1))); extern int sigismember (const sigset_t *__set, int __signo) throw () __attribute__ ((__nonnull__ (1))); extern int sigisemptyset (const sigset_t *__set) throw () __attribute__ ((__nonnull__ (1))); extern int sigandset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3))); extern int sigorset (sigset_t *__set, const sigset_t *__left, const sigset_t *__right) throw () __attribute__ ((__nonnull__ (1, 2, 3))); # 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4 struct sigaction { union { __sighandler_t sa_handler; void (*sa_sigaction) (int, siginfo_t *, void *); } __sigaction_handler; __sigset_t sa_mask; int sa_flags; void (*sa_restorer) (void); }; # 227 "/usr/include/signal.h" 2 3 4 extern int sigprocmask (int __how, const sigset_t *__restrict __set, sigset_t *__restrict __oset) throw (); extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1))); extern int sigaction (int __sig, const struct sigaction *__restrict __act, struct sigaction *__restrict __oact) throw (); extern int sigpending (sigset_t *__set) throw () __attribute__ ((__nonnull__ (1))); extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig) __attribute__ ((__nonnull__ (1, 2))); extern int sigwaitinfo (const sigset_t *__restrict __set, siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1))); extern int sigtimedwait (const sigset_t *__restrict __set, siginfo_t *__restrict __info, const struct timespec *__restrict __timeout) __attribute__ ((__nonnull__ (1))); extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val) throw (); # 286 "/usr/include/signal.h" 3 4 extern const char *const _sys_siglist[(64 + 1)]; extern const char *const sys_siglist[(64 + 1)]; # 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4 struct _fpx_sw_bytes { __uint32_t magic1; __uint32_t extended_size; __uint64_t xstate_bv; __uint32_t xstate_size; __uint32_t __glibc_reserved1[7]; }; struct _fpreg { unsigned short significand[4]; unsigned short exponent; }; struct _fpxreg { unsigned short significand[4]; unsigned short exponent; unsigned short __glibc_reserved1[3]; }; struct _xmmreg { __uint32_t element[4]; }; # 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4 struct _fpstate { __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _fpxreg _st[8]; struct _xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; struct sigcontext { __uint64_t r8; __uint64_t r9; __uint64_t r10; __uint64_t r11; __uint64_t r12; __uint64_t r13; __uint64_t r14; __uint64_t r15; __uint64_t rdi; __uint64_t rsi; __uint64_t rbp; __uint64_t rbx; __uint64_t rdx; __uint64_t rax; __uint64_t rcx; __uint64_t rsp; __uint64_t rip; __uint64_t eflags; unsigned short cs; unsigned short gs; unsigned short fs; unsigned short __pad0; __uint64_t err; __uint64_t trapno; __uint64_t oldmask; __uint64_t cr2; __extension__ union { struct _fpstate * fpstate; __uint64_t __fpstate_word; }; __uint64_t __reserved1 [8]; }; struct _xsave_hdr { __uint64_t xstate_bv; __uint64_t __glibc_reserved1[2]; __uint64_t __glibc_reserved2[5]; }; struct _ymmh_state { __uint32_t ymmh_space[64]; }; struct _xstate { struct _fpstate fpstate; struct _xsave_hdr xstate_hdr; struct _ymmh_state ymmh; }; # 292 "/usr/include/signal.h" 2 3 4 extern int sigreturn (struct sigcontext *__scp) throw (); # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 302 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4 typedef struct { void *ss_sp; int ss_flags; size_t ss_size; } stack_t; # 304 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4 # 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4 __extension__ typedef long long int greg_t; # 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4 typedef greg_t gregset_t[23]; enum { REG_R8 = 0, REG_R9, REG_R10, REG_R11, REG_R12, REG_R13, REG_R14, REG_R15, REG_RDI, REG_RSI, REG_RBP, REG_RBX, REG_RDX, REG_RAX, REG_RCX, REG_RSP, REG_RIP, REG_EFL, REG_CSGSFS, REG_ERR, REG_TRAPNO, REG_OLDMASK, REG_CR2 }; struct _libc_fpxreg { unsigned short int significand[4]; unsigned short int exponent; unsigned short int __glibc_reserved1[3]; }; struct _libc_xmmreg { __uint32_t element[4]; }; struct _libc_fpstate { __uint16_t cwd; __uint16_t swd; __uint16_t ftw; __uint16_t fop; __uint64_t rip; __uint64_t rdp; __uint32_t mxcsr; __uint32_t mxcr_mask; struct _libc_fpxreg _st[8]; struct _libc_xmmreg _xmm[16]; __uint32_t __glibc_reserved1[24]; }; typedef struct _libc_fpstate *fpregset_t; typedef struct { gregset_t gregs; fpregset_t fpregs; __extension__ unsigned long long __reserved1 [8]; } mcontext_t; typedef struct ucontext_t { unsigned long int uc_flags; struct ucontext_t *uc_link; stack_t uc_stack; mcontext_t uc_mcontext; sigset_t uc_sigmask; struct _libc_fpstate __fpregs_mem; __extension__ unsigned long long int __ssp[4]; } ucontext_t; # 307 "/usr/include/signal.h" 2 3 4 extern int siginterrupt (int __sig, int __interrupt) throw (); # 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4 # 317 "/usr/include/signal.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4 enum { SS_ONSTACK = 1, SS_DISABLE }; # 318 "/usr/include/signal.h" 2 3 4 extern int sigaltstack (const stack_t *__restrict __ss, stack_t *__restrict __oss) throw (); # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4 struct sigstack { void *ss_sp; int ss_onstack; }; # 328 "/usr/include/signal.h" 2 3 4 extern int sigstack (struct sigstack *__ss, struct sigstack *__oss) throw () __attribute__ ((__deprecated__)); extern int sighold (int __sig) throw (); extern int sigrelse (int __sig) throw (); extern int sigignore (int __sig) throw (); extern __sighandler_t sigset (int __sig, __sighandler_t __disp) throw (); # 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4 extern int pthread_sigmask (int __how, const __sigset_t *__restrict __newmask, __sigset_t *__restrict __oldmask)throw (); extern int pthread_kill (pthread_t __threadid, int __signo) throw (); extern int pthread_sigqueue (pthread_t __threadid, int __signo, const union sigval __value) throw (); # 360 "/usr/include/signal.h" 2 3 4 extern int __libc_current_sigrtmin (void) throw (); extern int __libc_current_sigrtmax (void) throw (); # 1 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 1 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/signal_ext.h" 3 4 extern int tgkill (__pid_t __tgid, __pid_t __tid, int __signal); # 375 "/usr/include/signal.h" 2 3 4 } # 29 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/param.h" 1 3 4 # 28 "/usr/include/x86_64-linux-gnu/bits/param.h" 3 4 # 1 "/usr/include/linux/param.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/param.h" 1 3 4 # 1 "/usr/include/asm-generic/param.h" 1 3 4 # 2 "/usr/include/x86_64-linux-gnu/asm/param.h" 2 3 4 # 6 "/usr/include/linux/param.h" 2 3 4 # 29 "/usr/include/x86_64-linux-gnu/bits/param.h" 2 3 4 # 32 "/usr/include/x86_64-linux-gnu/sys/param.h" 2 3 4 # 300 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4 # 307 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 337 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4 # 34 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 extern "C" { # 52 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 struct timezone { int tz_minuteswest; int tz_dsttime; }; # 66 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 extern int gettimeofday (struct timeval *__restrict __tv, void *__restrict __tz) throw () __attribute__ ((__nonnull__ (1))); extern int settimeofday (const struct timeval *__tv, const struct timezone *__tz) throw (); extern int adjtime (const struct timeval *__delta, struct timeval *__olddelta) throw (); enum __itimer_which { ITIMER_REAL = 0, ITIMER_VIRTUAL = 1, ITIMER_PROF = 2 }; struct itimerval { struct timeval it_interval; struct timeval it_value; }; typedef int __itimer_which_t; extern int getitimer (__itimer_which_t __which, struct itimerval *__value) throw (); extern int setitimer (__itimer_which_t __which, const struct itimerval *__restrict __new, struct itimerval *__restrict __old) throw (); extern int utimes (const char *__file, const struct timeval __tvp[2]) throw () __attribute__ ((__nonnull__ (1))); extern int lutimes (const char *__file, const struct timeval __tvp[2]) throw () __attribute__ ((__nonnull__ (1))); extern int futimes (int __fd, const struct timeval __tvp[2]) throw (); extern int futimesat (int __fd, const char *__file, const struct timeval __tvp[2]) throw (); # 187 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4 } # 338 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/time.h" 1 3 4 # 29 "/usr/include/time.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 30 "/usr/include/time.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4 # 73 "/usr/include/x86_64-linux-gnu/bits/time.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/timex.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/timex.h" 3 4 struct timex { unsigned int modes; __syscall_slong_t offset; __syscall_slong_t freq; __syscall_slong_t maxerror; __syscall_slong_t esterror; int status; __syscall_slong_t constant; __syscall_slong_t precision; __syscall_slong_t tolerance; struct timeval time; __syscall_slong_t tick; __syscall_slong_t ppsfreq; __syscall_slong_t jitter; int shift; __syscall_slong_t stabil; __syscall_slong_t jitcnt; __syscall_slong_t calcnt; __syscall_slong_t errcnt; __syscall_slong_t stbcnt; int tai; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; int :32; }; # 74 "/usr/include/x86_64-linux-gnu/bits/time.h" 2 3 4 extern "C" { extern int clock_adjtime (__clockid_t __clock_id, struct timex *__utx) throw (); } # 34 "/usr/include/time.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h" 1 3 4 struct tm { int tm_sec; int tm_min; int tm_hour; int tm_mday; int tm_mon; int tm_year; int tm_wday; int tm_yday; int tm_isdst; long int tm_gmtoff; const char *tm_zone; }; # 40 "/usr/include/time.h" 2 3 4 # 48 "/usr/include/time.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h" 1 3 4 struct itimerspec { struct timespec it_interval; struct timespec it_value; }; # 49 "/usr/include/time.h" 2 3 4 struct sigevent; # 68 "/usr/include/time.h" 3 4 extern "C" { extern clock_t clock (void) throw (); extern time_t time (time_t *__timer) throw (); extern double difftime (time_t __time1, time_t __time0) throw () __attribute__ ((__const__)); extern time_t mktime (struct tm *__tp) throw (); extern size_t strftime (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp) throw (); extern char *strptime (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp) throw (); extern size_t strftime_l (char *__restrict __s, size_t __maxsize, const char *__restrict __format, const struct tm *__restrict __tp, locale_t __loc) throw (); extern char *strptime_l (const char *__restrict __s, const char *__restrict __fmt, struct tm *__tp, locale_t __loc) throw (); extern struct tm *gmtime (const time_t *__timer) throw (); extern struct tm *localtime (const time_t *__timer) throw (); extern struct tm *gmtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) throw (); extern struct tm *localtime_r (const time_t *__restrict __timer, struct tm *__restrict __tp) throw (); extern char *asctime (const struct tm *__tp) throw (); extern char *ctime (const time_t *__timer) throw (); extern char *asctime_r (const struct tm *__restrict __tp, char *__restrict __buf) throw (); extern char *ctime_r (const time_t *__restrict __timer, char *__restrict __buf) throw (); extern char *__tzname[2]; extern int __daylight; extern long int __timezone; extern char *tzname[2]; extern void tzset (void) throw (); extern int daylight; extern long int timezone; # 190 "/usr/include/time.h" 3 4 extern time_t timegm (struct tm *__tp) throw (); extern time_t timelocal (struct tm *__tp) throw (); extern int dysize (int __year) throw () __attribute__ ((__const__)); # 205 "/usr/include/time.h" 3 4 extern int nanosleep (const struct timespec *__requested_time, struct timespec *__remaining); extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw (); extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw (); extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp) throw (); extern int clock_nanosleep (clockid_t __clock_id, int __flags, const struct timespec *__req, struct timespec *__rem); extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw (); extern int timer_create (clockid_t __clock_id, struct sigevent *__restrict __evp, timer_t *__restrict __timerid) throw (); extern int timer_delete (timer_t __timerid) throw (); extern int timer_settime (timer_t __timerid, int __flags, const struct itimerspec *__restrict __value, struct itimerspec *__restrict __ovalue) throw (); extern int timer_gettime (timer_t __timerid, struct itimerspec *__value) throw (); extern int timer_getoverrun (timer_t __timerid) throw (); extern int timespec_get (struct timespec *__ts, int __base) throw () __attribute__ ((__nonnull__ (1))); # 274 "/usr/include/time.h" 3 4 extern int getdate_err; # 283 "/usr/include/time.h" 3 4 extern struct tm *getdate (const char *__string); # 297 "/usr/include/time.h" 3 4 extern int getdate_r (const char *__restrict __string, struct tm *__restrict __resbufp); } # 339 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 350 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/fcntl.h" 1 3 4 # 28 "/usr/include/fcntl.h" 3 4 extern "C" { # 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4 struct flock { short int l_type; short int l_whence; __off_t l_start; __off_t l_len; __pid_t l_pid; }; struct flock64 { short int l_type; short int l_whence; __off64_t l_start; __off64_t l_len; __pid_t l_pid; }; # 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4 # 38 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4 # 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4 struct iovec { void *iov_base; size_t iov_len; }; # 39 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4 # 265 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4 enum __pid_type { F_OWNER_TID = 0, F_OWNER_PID, F_OWNER_PGRP, F_OWNER_GID = F_OWNER_PGRP }; struct f_owner_ex { enum __pid_type type; __pid_t pid; }; # 353 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4 # 1 "/usr/include/linux/falloc.h" 1 3 4 # 354 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 2 3 4 struct file_handle { unsigned int handle_bytes; int handle_type; unsigned char f_handle[0]; }; # 392 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4 extern "C" { extern __ssize_t readahead (int __fd, __off64_t __offset, size_t __count) throw (); extern int sync_file_range (int __fd, __off64_t __offset, __off64_t __count, unsigned int __flags); extern __ssize_t vmsplice (int __fdout, const struct iovec *__iov, size_t __count, unsigned int __flags); extern __ssize_t splice (int __fdin, __off64_t *__offin, int __fdout, __off64_t *__offout, size_t __len, unsigned int __flags); extern __ssize_t tee (int __fdin, int __fdout, size_t __len, unsigned int __flags); extern int fallocate (int __fd, int __mode, __off_t __offset, __off_t __len); # 447 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4 extern int fallocate64 (int __fd, int __mode, __off64_t __offset, __off64_t __len); extern int name_to_handle_at (int __dfd, const char *__name, struct file_handle *__handle, int *__mnt_id, int __flags) throw (); extern int open_by_handle_at (int __mountdirfd, struct file_handle *__handle, int __flags); } # 62 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4 # 36 "/usr/include/fcntl.h" 2 3 4 # 78 "/usr/include/fcntl.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4 # 46 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4 struct stat { __dev_t st_dev; __ino_t st_ino; __nlink_t st_nlink; __mode_t st_mode; __uid_t st_uid; __gid_t st_gid; int __pad0; __dev_t st_rdev; __off_t st_size; __blksize_t st_blksize; __blkcnt_t st_blocks; # 91 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4 struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 106 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4 __syscall_slong_t __glibc_reserved[3]; # 115 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4 }; struct stat64 { __dev_t st_dev; __ino64_t st_ino; __nlink_t st_nlink; __mode_t st_mode; __uid_t st_uid; __gid_t st_gid; int __pad0; __dev_t st_rdev; __off_t st_size; __blksize_t st_blksize; __blkcnt64_t st_blocks; struct timespec st_atim; struct timespec st_mtim; struct timespec st_ctim; # 164 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4 __syscall_slong_t __glibc_reserved[3]; }; # 79 "/usr/include/fcntl.h" 2 3 4 # 148 "/usr/include/fcntl.h" 3 4 extern int fcntl (int __fd, int __cmd, ...); # 157 "/usr/include/fcntl.h" 3 4 extern int fcntl64 (int __fd, int __cmd, ...); # 168 "/usr/include/fcntl.h" 3 4 extern int open (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1))); # 178 "/usr/include/fcntl.h" 3 4 extern int open64 (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1))); # 192 "/usr/include/fcntl.h" 3 4 extern int openat (int __fd, const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (2))); # 203 "/usr/include/fcntl.h" 3 4 extern int openat64 (int __fd, const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (2))); # 214 "/usr/include/fcntl.h" 3 4 extern int creat (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1))); # 224 "/usr/include/fcntl.h" 3 4 extern int creat64 (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1))); # 260 "/usr/include/fcntl.h" 3 4 extern int posix_fadvise (int __fd, off_t __offset, off_t __len, int __advise) throw (); # 272 "/usr/include/fcntl.h" 3 4 extern int posix_fadvise64 (int __fd, off64_t __offset, off64_t __len, int __advise) throw (); # 282 "/usr/include/fcntl.h" 3 4 extern int posix_fallocate (int __fd, off_t __offset, off_t __len); # 293 "/usr/include/fcntl.h" 3 4 extern int posix_fallocate64 (int __fd, off64_t __offset, off64_t __len); # 304 "/usr/include/fcntl.h" 3 4 } # 351 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 397 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4 extern "C" { # 77 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4 extern __pid_t wait (int *__stat_loc); # 100 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4 extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options); # 121 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4 extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop, int __options); struct rusage; extern __pid_t wait3 (int *__stat_loc, int __options, struct rusage * __usage) throw (); extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options, struct rusage *__usage) throw (); } # 398 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 428 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/x86_64-linux-gnu/sys/mman.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/sys/mman.h" 2 3 4 # 41 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mman.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/bits/mman.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mman-map-flags-generic.h" 1 3 4 # 32 "/usr/include/x86_64-linux-gnu/bits/mman.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 1 3 4 # 113 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/mman-shared.h" 1 3 4 # 46 "/usr/include/x86_64-linux-gnu/bits/mman-shared.h" 3 4 extern "C" { int memfd_create (const char *__name, unsigned int __flags) throw (); int mlock2 (const void *__addr, size_t __length, unsigned int __flags) throw (); int pkey_alloc (unsigned int __flags, unsigned int __access_rights) throw (); int pkey_set (int __key, unsigned int __access_rights) throw (); int pkey_get (int __key) throw (); int pkey_free (int __key) throw (); int pkey_mprotect (void *__addr, size_t __len, int __prot, int __pkey) throw (); } # 114 "/usr/include/x86_64-linux-gnu/bits/mman-linux.h" 2 3 4 # 35 "/usr/include/x86_64-linux-gnu/bits/mman.h" 2 3 4 # 42 "/usr/include/x86_64-linux-gnu/sys/mman.h" 2 3 4 extern "C" { # 57 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4 extern void *mmap (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off_t __offset) throw (); # 70 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4 extern void *mmap64 (void *__addr, size_t __len, int __prot, int __flags, int __fd, __off64_t __offset) throw (); extern int munmap (void *__addr, size_t __len) throw (); extern int mprotect (void *__addr, size_t __len, int __prot) throw (); extern int msync (void *__addr, size_t __len, int __flags); extern int madvise (void *__addr, size_t __len, int __advice) throw (); extern int posix_madvise (void *__addr, size_t __len, int __advice) throw (); extern int mlock (const void *__addr, size_t __len) throw (); extern int munlock (const void *__addr, size_t __len) throw (); extern int mlockall (int __flags) throw (); extern int munlockall (void) throw (); extern int mincore (void *__start, size_t __len, unsigned char *__vec) throw (); # 133 "/usr/include/x86_64-linux-gnu/sys/mman.h" 3 4 extern void *mremap (void *__addr, size_t __old_len, size_t __new_len, int __flags, ...) throw (); extern int remap_file_pages (void *__start, size_t __size, int __prot, size_t __pgoff, int __flags) throw (); extern int shm_open (const char *__name, int __oflag, mode_t __mode); extern int shm_unlink (const char *__name); } # 429 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/x86_64-linux-gnu/sys/resource.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/resource.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4 enum __rlimit_resource { RLIMIT_CPU = 0, RLIMIT_FSIZE = 1, RLIMIT_DATA = 2, RLIMIT_STACK = 3, RLIMIT_CORE = 4, __RLIMIT_RSS = 5, RLIMIT_NOFILE = 7, __RLIMIT_OFILE = RLIMIT_NOFILE, RLIMIT_AS = 9, __RLIMIT_NPROC = 6, __RLIMIT_MEMLOCK = 8, __RLIMIT_LOCKS = 10, __RLIMIT_SIGPENDING = 11, __RLIMIT_MSGQUEUE = 12, __RLIMIT_NICE = 13, __RLIMIT_RTPRIO = 14, __RLIMIT_RTTIME = 15, __RLIMIT_NLIMITS = 16, __RLIM_NLIMITS = __RLIMIT_NLIMITS }; # 131 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4 typedef __rlim_t rlim_t; typedef __rlim64_t rlim64_t; struct rlimit { rlim_t rlim_cur; rlim_t rlim_max; }; struct rlimit64 { rlim64_t rlim_cur; rlim64_t rlim_max; }; enum __rusage_who { RUSAGE_SELF = 0, RUSAGE_CHILDREN = -1 , RUSAGE_THREAD = 1 }; # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 1 3 4 # 33 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 3 4 struct rusage { struct timeval ru_utime; struct timeval ru_stime; __extension__ union { long int ru_maxrss; __syscall_slong_t __ru_maxrss_word; }; __extension__ union { long int ru_ixrss; __syscall_slong_t __ru_ixrss_word; }; __extension__ union { long int ru_idrss; __syscall_slong_t __ru_idrss_word; }; __extension__ union { long int ru_isrss; __syscall_slong_t __ru_isrss_word; }; __extension__ union { long int ru_minflt; __syscall_slong_t __ru_minflt_word; }; __extension__ union { long int ru_majflt; __syscall_slong_t __ru_majflt_word; }; __extension__ union { long int ru_nswap; __syscall_slong_t __ru_nswap_word; }; __extension__ union { long int ru_inblock; __syscall_slong_t __ru_inblock_word; }; __extension__ union { long int ru_oublock; __syscall_slong_t __ru_oublock_word; }; __extension__ union { long int ru_msgsnd; __syscall_slong_t __ru_msgsnd_word; }; __extension__ union { long int ru_msgrcv; __syscall_slong_t __ru_msgrcv_word; }; __extension__ union { long int ru_nsignals; __syscall_slong_t __ru_nsignals_word; }; __extension__ union { long int ru_nvcsw; __syscall_slong_t __ru_nvcsw_word; }; __extension__ union { long int ru_nivcsw; __syscall_slong_t __ru_nivcsw_word; }; }; # 180 "/usr/include/x86_64-linux-gnu/bits/resource.h" 2 3 4 enum __priority_which { PRIO_PROCESS = 0, PRIO_PGRP = 1, PRIO_USER = 2 }; extern "C" { extern int prlimit (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit *__new_limit, struct rlimit *__old_limit) throw (); # 217 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4 extern int prlimit64 (__pid_t __pid, enum __rlimit_resource __resource, const struct rlimit64 *__new_limit, struct rlimit64 *__old_limit) throw (); } # 25 "/usr/include/x86_64-linux-gnu/sys/resource.h" 2 3 4 extern "C" { # 42 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4 typedef int __rlimit_resource_t; typedef int __rusage_who_t; typedef int __priority_which_t; extern int getrlimit (__rlimit_resource_t __resource, struct rlimit *__rlimits) throw (); # 61 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4 extern int getrlimit64 (__rlimit_resource_t __resource, struct rlimit64 *__rlimits) throw (); extern int setrlimit (__rlimit_resource_t __resource, const struct rlimit *__rlimits) throw (); # 81 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4 extern int setrlimit64 (__rlimit_resource_t __resource, const struct rlimit64 *__rlimits) throw (); extern int getrusage (__rusage_who_t __who, struct rusage *__usage) throw (); extern int getpriority (__priority_which_t __which, id_t __who) throw (); extern int setpriority (__priority_which_t __which, id_t __who, int __prio) throw (); } # 441 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/x86_64-linux-gnu/sys/times.h" 1 3 4 # 29 "/usr/include/x86_64-linux-gnu/sys/times.h" 3 4 extern "C" { struct tms { clock_t tms_utime; clock_t tms_stime; clock_t tms_cutime; clock_t tms_cstime; }; extern clock_t times (struct tms *__buffer) throw (); } # 445 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" extern "C" { # 521 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" } # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 1 3 4 # 9 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 3 4 # 1 "/usr/include/stdint.h" 1 3 4 # 26 "/usr/include/stdint.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 27 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4 # 29 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4 # 30 "/usr/include/stdint.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4 # 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4 typedef __uint8_t uint8_t; typedef __uint16_t uint16_t; typedef __uint32_t uint32_t; typedef __uint64_t uint64_t; # 38 "/usr/include/stdint.h" 2 3 4 typedef __int_least8_t int_least8_t; typedef __int_least16_t int_least16_t; typedef __int_least32_t int_least32_t; typedef __int_least64_t int_least64_t; typedef __uint_least8_t uint_least8_t; typedef __uint_least16_t uint_least16_t; typedef __uint_least32_t uint_least32_t; typedef __uint_least64_t uint_least64_t; typedef signed char int_fast8_t; typedef long int int_fast16_t; typedef long int int_fast32_t; typedef long int int_fast64_t; # 71 "/usr/include/stdint.h" 3 4 typedef unsigned char uint_fast8_t; typedef unsigned long int uint_fast16_t; typedef unsigned long int uint_fast32_t; typedef unsigned long int uint_fast64_t; # 90 "/usr/include/stdint.h" 3 4 typedef unsigned long int uintptr_t; # 101 "/usr/include/stdint.h" 3 4 typedef __intmax_t intmax_t; typedef __uintmax_t uintmax_t; # 10 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stdint.h" 2 3 4 # 526 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/inttypes.h" 1 3 4 # 266 "/usr/include/inttypes.h" 3 4 extern "C" { typedef struct { long int quot; long int rem; } imaxdiv_t; # 290 "/usr/include/inttypes.h" 3 4 extern intmax_t imaxabs (intmax_t __n) throw () __attribute__ ((__const__)); extern imaxdiv_t imaxdiv (intmax_t __numer, intmax_t __denom) throw () __attribute__ ((__const__)); extern intmax_t strtoimax (const char *__restrict __nptr, char **__restrict __endptr, int __base) throw (); extern uintmax_t strtoumax (const char *__restrict __nptr, char ** __restrict __endptr, int __base) throw (); extern intmax_t wcstoimax (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); extern uintmax_t wcstoumax (const wchar_t *__restrict __nptr, wchar_t ** __restrict __endptr, int __base) throw (); extern long int __strtol_internal (const char *__restrict __nptr, char **__restrict __endptr, int __base, int __group) throw () __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__gnu_inline__)) intmax_t __attribute__ ((__leaf__)) strtoimax (const char *__restrict nptr, char **__restrict endptr, int base) throw () { return __strtol_internal (nptr, endptr, base, 0); } extern unsigned long int __strtoul_internal (const char *__restrict __nptr, char ** __restrict __endptr, int __base, int __group) throw () __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__gnu_inline__)) uintmax_t __attribute__ ((__leaf__)) strtoumax (const char *__restrict nptr, char **__restrict endptr, int base) throw () { return __strtoul_internal (nptr, endptr, base, 0); } extern long int __wcstol_internal (const wchar_t * __restrict __nptr, wchar_t **__restrict __endptr, int __base, int __group) throw () __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__gnu_inline__)) intmax_t __attribute__ ((__leaf__)) wcstoimax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw () { return __wcstol_internal (nptr, endptr, base, 0); } extern unsigned long int __wcstoul_internal (const wchar_t * __restrict __nptr, wchar_t ** __restrict __endptr, int __base, int __group) throw () __attribute__ ((__nonnull__ (1))) ; extern __inline __attribute__ ((__gnu_inline__)) uintmax_t __attribute__ ((__leaf__)) wcstoumax (const wchar_t *__restrict nptr, wchar_t **__restrict endptr, int base) throw () { return __wcstoul_internal (nptr, endptr, base, 0); } # 432 "/usr/include/inttypes.h" 3 4 } # 530 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 533 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" extern "C" { # 576 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" } # 599 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4 # 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 # 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern "C" { # 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4 # 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4 # 205 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int stat (const char *__restrict __file, struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); extern int fstat (int __fd, struct stat *__buf) throw () __attribute__ ((__nonnull__ (2))); # 224 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int stat64 (const char *__restrict __file, struct stat64 *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); extern int fstat64 (int __fd, struct stat64 *__buf) throw () __attribute__ ((__nonnull__ (2))); extern int fstatat (int __fd, const char *__restrict __file, struct stat *__restrict __buf, int __flag) throw () __attribute__ ((__nonnull__ (2, 3))); # 249 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int fstatat64 (int __fd, const char *__restrict __file, struct stat64 *__restrict __buf, int __flag) throw () __attribute__ ((__nonnull__ (2, 3))); extern int lstat (const char *__restrict __file, struct stat *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); # 272 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int lstat64 (const char *__restrict __file, struct stat64 *__restrict __buf) throw () __attribute__ ((__nonnull__ (1, 2))); extern int chmod (const char *__file, __mode_t __mode) throw () __attribute__ ((__nonnull__ (1))); extern int lchmod (const char *__file, __mode_t __mode) throw () __attribute__ ((__nonnull__ (1))); extern int fchmod (int __fd, __mode_t __mode) throw (); extern int fchmodat (int __fd, const char *__file, __mode_t __mode, int __flag) throw () __attribute__ ((__nonnull__ (2))) ; extern __mode_t umask (__mode_t __mask) throw (); extern __mode_t getumask (void) throw (); extern int mkdir (const char *__path, __mode_t __mode) throw () __attribute__ ((__nonnull__ (1))); extern int mkdirat (int __fd, const char *__path, __mode_t __mode) throw () __attribute__ ((__nonnull__ (2))); extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev) throw () __attribute__ ((__nonnull__ (1))); extern int mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev) throw () __attribute__ ((__nonnull__ (2))); extern int mkfifo (const char *__path, __mode_t __mode) throw () __attribute__ ((__nonnull__ (1))); extern int mkfifoat (int __fd, const char *__path, __mode_t __mode) throw () __attribute__ ((__nonnull__ (2))); extern int utimensat (int __fd, const char *__path, const struct timespec __times[2], int __flags) throw () __attribute__ ((__nonnull__ (2))); extern int futimens (int __fd, const struct timespec __times[2]) throw (); # 395 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (3))); extern int __xstat (int __ver, const char *__filename, struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); extern int __lxstat (int __ver, const char *__filename, struct stat *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); extern int __fxstatat (int __ver, int __fildes, const char *__filename, struct stat *__stat_buf, int __flag) throw () __attribute__ ((__nonnull__ (3, 4))); # 428 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4 extern int __fxstat64 (int __ver, int __fildes, struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (3))); extern int __xstat64 (int __ver, const char *__filename, struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); extern int __lxstat64 (int __ver, const char *__filename, struct stat64 *__stat_buf) throw () __attribute__ ((__nonnull__ (2, 3))); extern int __fxstatat64 (int __ver, int __fildes, const char *__filename, struct stat64 *__stat_buf, int __flag) throw () __attribute__ ((__nonnull__ (3, 4))); extern int __xmknod (int __ver, const char *__path, __mode_t __mode, __dev_t *__dev) throw () __attribute__ ((__nonnull__ (2, 4))); extern int __xmknodat (int __ver, int __fd, const char *__path, __mode_t __mode, __dev_t *__dev) throw () __attribute__ ((__nonnull__ (3, 5))); # 1 "/usr/include/x86_64-linux-gnu/bits/statx.h" 1 3 4 # 31 "/usr/include/x86_64-linux-gnu/bits/statx.h" 3 4 # 1 "/usr/include/linux/stat.h" 1 3 4 # 1 "/usr/include/linux/types.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/types.h" 1 3 4 # 1 "/usr/include/asm-generic/types.h" 1 3 4 # 1 "/usr/include/asm-generic/int-ll64.h" 1 3 4 # 12 "/usr/include/asm-generic/int-ll64.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 3 4 # 1 "/usr/include/asm-generic/bitsperlong.h" 1 3 4 # 12 "/usr/include/x86_64-linux-gnu/asm/bitsperlong.h" 2 3 4 # 13 "/usr/include/asm-generic/int-ll64.h" 2 3 4 typedef __signed__ char __s8; typedef unsigned char __u8; typedef __signed__ short __s16; typedef unsigned short __u16; typedef __signed__ int __s32; typedef unsigned int __u32; __extension__ typedef __signed__ long long __s64; __extension__ typedef unsigned long long __u64; # 8 "/usr/include/asm-generic/types.h" 2 3 4 # 2 "/usr/include/x86_64-linux-gnu/asm/types.h" 2 3 4 # 6 "/usr/include/linux/types.h" 2 3 4 # 1 "/usr/include/linux/posix_types.h" 1 3 4 # 1 "/usr/include/linux/stddef.h" 1 3 4 # 6 "/usr/include/linux/posix_types.h" 2 3 4 # 25 "/usr/include/linux/posix_types.h" 3 4 typedef struct { unsigned long fds_bits[1024 / (8 * sizeof(long))]; } __kernel_fd_set; typedef void (*__kernel_sighandler_t)(int); typedef int __kernel_key_t; typedef int __kernel_mqd_t; # 1 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 1 3 4 # 1 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 1 3 4 # 11 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 3 4 typedef unsigned short __kernel_old_uid_t; typedef unsigned short __kernel_old_gid_t; typedef unsigned long __kernel_old_dev_t; # 1 "/usr/include/asm-generic/posix_types.h" 1 3 4 # 15 "/usr/include/asm-generic/posix_types.h" 3 4 typedef long __kernel_long_t; typedef unsigned long __kernel_ulong_t; typedef __kernel_ulong_t __kernel_ino_t; typedef unsigned int __kernel_mode_t; typedef int __kernel_pid_t; typedef int __kernel_ipc_pid_t; typedef unsigned int __kernel_uid_t; typedef unsigned int __kernel_gid_t; typedef __kernel_long_t __kernel_suseconds_t; typedef int __kernel_daddr_t; typedef unsigned int __kernel_uid32_t; typedef unsigned int __kernel_gid32_t; # 72 "/usr/include/asm-generic/posix_types.h" 3 4 typedef __kernel_ulong_t __kernel_size_t; typedef __kernel_long_t __kernel_ssize_t; typedef __kernel_long_t __kernel_ptrdiff_t; typedef struct { int val[2]; } __kernel_fsid_t; typedef __kernel_long_t __kernel_off_t; typedef long long __kernel_loff_t; typedef __kernel_long_t __kernel_old_time_t; typedef __kernel_long_t __kernel_time_t; typedef long long __kernel_time64_t; typedef __kernel_long_t __kernel_clock_t; typedef int __kernel_timer_t; typedef int __kernel_clockid_t; typedef char * __kernel_caddr_t; typedef unsigned short __kernel_uid16_t; typedef unsigned short __kernel_gid16_t; # 19 "/usr/include/x86_64-linux-gnu/asm/posix_types_64.h" 2 3 4 # 8 "/usr/include/x86_64-linux-gnu/asm/posix_types.h" 2 3 4 # 37 "/usr/include/linux/posix_types.h" 2 3 4 # 10 "/usr/include/linux/types.h" 2 3 4 # 24 "/usr/include/linux/types.h" 3 4 typedef __u16 __le16; typedef __u16 __be16; typedef __u32 __le32; typedef __u32 __be32; typedef __u64 __le64; typedef __u64 __be64; typedef __u16 __sum16; typedef __u32 __wsum; # 47 "/usr/include/linux/types.h" 3 4 typedef unsigned __poll_t; # 6 "/usr/include/linux/stat.h" 2 3 4 # 56 "/usr/include/linux/stat.h" 3 4 struct statx_timestamp { __s64 tv_sec; __u32 tv_nsec; __s32 __reserved; }; # 99 "/usr/include/linux/stat.h" 3 4 struct statx { __u32 stx_mask; __u32 stx_blksize; __u64 stx_attributes; __u32 stx_nlink; __u32 stx_uid; __u32 stx_gid; __u16 stx_mode; __u16 __spare0[1]; __u64 stx_ino; __u64 stx_size; __u64 stx_blocks; __u64 stx_attributes_mask; struct statx_timestamp stx_atime; struct statx_timestamp stx_btime; struct statx_timestamp stx_ctime; struct statx_timestamp stx_mtime; __u32 stx_rdev_major; __u32 stx_rdev_minor; __u32 stx_dev_major; __u32 stx_dev_minor; __u64 __spare2[14]; }; # 32 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 1 3 4 # 25 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx_timestamp.h" 1 3 4 # 26 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_statx.h" 1 3 4 # 27 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 2 3 4 # 53 "/usr/include/x86_64-linux-gnu/bits/statx-generic.h" 3 4 extern "C" { int statx (int __dirfd, const char *__restrict __path, int __flags, unsigned int __mask, struct statx *__restrict __buf) throw () __attribute__ ((__nonnull__ (2, 5))); } # 40 "/usr/include/x86_64-linux-gnu/bits/statx.h" 2 3 4 # 447 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4 extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) stat (const char *__path, struct stat *__statbuf) throw () { return __xstat (1, __path, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) lstat (const char *__path, struct stat *__statbuf) throw () { return __lxstat (1, __path, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) fstat (int __fd, struct stat *__statbuf) throw () { return __fxstat (1, __fd, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) fstatat (int __fd, const char *__filename, struct stat *__statbuf, int __flag) throw () { return __fxstatat (1, __fd, __filename, __statbuf, __flag); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) mknod (const char *__path, __mode_t __mode, __dev_t __dev) throw () { return __xmknod (0, __path, __mode, &__dev); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) mknodat (int __fd, const char *__path, __mode_t __mode, __dev_t __dev) throw () { return __xmknodat (0, __fd, __path, __mode, &__dev); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) stat64 (const char *__path, struct stat64 *__statbuf) throw () { return __xstat64 (1, __path, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) lstat64 (const char *__path, struct stat64 *__statbuf) throw () { return __lxstat64 (1, __path, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) fstat64 (int __fd, struct stat64 *__statbuf) throw () { return __fxstat64 (1, __fd, __statbuf); } extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) fstatat64 (int __fd, const char *__filename, struct stat64 *__statbuf, int __flag) throw () { return __fxstatat64 (1, __fd, __filename, __statbuf, __flag); } } # 600 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 671 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" 1 # 29 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 1 # 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" # 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" extern "C" { # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/ansidecl.h" 1 # 40 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 2 typedef unsigned int hashval_t; typedef hashval_t (*htab_hash) (const void *); typedef int (*htab_eq) (const void *, const void *); typedef void (*htab_del) (void *); typedef int (*htab_trav) (void **, void *); typedef void *(*htab_alloc) (size_t, size_t); typedef void (*htab_free) (void *); typedef void *(*htab_alloc_with_arg) (void *, size_t, size_t); typedef void (*htab_free_with_arg) (void *, void *); # 95 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" struct htab { htab_hash hash_f; htab_eq eq_f; htab_del del_f; void **entries; size_t size; size_t n_elements; size_t n_deleted; unsigned int searches; unsigned int collisions; htab_alloc alloc_f; htab_free free_f; void *alloc_arg; htab_alloc_with_arg alloc_with_arg_f; htab_free_with_arg free_with_arg_f; unsigned int size_prime_index; }; typedef struct htab *htab_t; enum insert_option {NO_INSERT, INSERT}; extern htab_t htab_create_alloc (size_t, htab_hash, htab_eq, htab_del, htab_alloc, htab_free); extern htab_t htab_create_alloc_ex (size_t, htab_hash, htab_eq, htab_del, void *, htab_alloc_with_arg, htab_free_with_arg); extern htab_t htab_create_typed_alloc (size_t, htab_hash, htab_eq, htab_del, htab_alloc, htab_alloc, htab_free); extern htab_t htab_create (size_t, htab_hash, htab_eq, htab_del); extern htab_t htab_try_create (size_t, htab_hash, htab_eq, htab_del); extern void htab_set_functions_ex (htab_t, htab_hash, htab_eq, htab_del, void *, htab_alloc_with_arg, htab_free_with_arg); extern void htab_delete (htab_t); extern void htab_empty (htab_t); extern void * htab_find (htab_t, const void *); extern void ** htab_find_slot (htab_t, const void *, enum insert_option); extern void * htab_find_with_hash (htab_t, const void *, hashval_t); extern void ** htab_find_slot_with_hash (htab_t, const void *, hashval_t, enum insert_option); extern void htab_clear_slot (htab_t, void **); extern void htab_remove_elt (htab_t, const void *); extern void htab_remove_elt_with_hash (htab_t, const void *, hashval_t); extern void htab_traverse (htab_t, htab_trav, void *); extern void htab_traverse_noresize (htab_t, htab_trav, void *); extern size_t htab_size (htab_t); extern size_t htab_elements (htab_t); extern double htab_collisions (htab_t); extern htab_hash htab_hash_pointer; extern htab_eq htab_eq_pointer; extern hashval_t htab_hash_string (const void *); extern hashval_t iterative_hash (const void *, size_t, hashval_t); } # 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" 2 extern "C" { # 84 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/filenames.h" extern int filename_cmp (const char *s1, const char *s2); extern int filename_ncmp (const char *s1, const char *s2, size_t n); extern hashval_t filename_hash (const void *s); extern int filename_eq (const void *s1, const void *s2); extern int canonical_filename_eq (const char *a, const char *b); } # 672 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 683 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/usr/include/dlfcn.h" 1 3 4 # 24 "/usr/include/dlfcn.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 25 "/usr/include/dlfcn.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 1 3 4 # 57 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 3 4 # 57 "/usr/include/x86_64-linux-gnu/bits/dlfcn.h" 3 4 extern "C" { extern void _dl_mcount_wrapper_check (void *__selfpc) throw (); } # 28 "/usr/include/dlfcn.h" 2 3 4 # 44 "/usr/include/dlfcn.h" 3 4 typedef long int Lmid_t; extern "C" { extern void *dlopen (const char *__file, int __mode) throw (); extern int dlclose (void *__handle) throw () __attribute__ ((__nonnull__ (1))); extern void *dlsym (void *__restrict __handle, const char *__restrict __name) throw () __attribute__ ((__nonnull__ (2))); extern void *dlmopen (Lmid_t __nsid, const char *__file, int __mode) throw (); extern void *dlvsym (void *__restrict __handle, const char *__restrict __name, const char *__restrict __version) throw () __attribute__ ((__nonnull__ (2, 3))); extern char *dlerror (void) throw (); typedef struct { const char *dli_fname; void *dli_fbase; const char *dli_sname; void *dli_saddr; } Dl_info; extern int dladdr (const void *__address, Dl_info *__info) throw () __attribute__ ((__nonnull__ (2))); extern int dladdr1 (const void *__address, Dl_info *__info, void **__extra_info, int __flags) throw () __attribute__ ((__nonnull__ (2))); enum { RTLD_DL_SYMENT = 1, RTLD_DL_LINKMAP = 2 }; extern int dlinfo (void *__restrict __handle, int __request, void *__restrict __arg) throw () __attribute__ ((__nonnull__ (1, 3))); enum { RTLD_DI_LMID = 1, RTLD_DI_LINKMAP = 2, RTLD_DI_CONFIGADDR = 3, RTLD_DI_SERINFO = 4, RTLD_DI_SERINFOSIZE = 5, RTLD_DI_ORIGIN = 6, RTLD_DI_PROFILENAME = 7, RTLD_DI_PROFILEOUT = 8, RTLD_DI_TLS_MODID = 9, RTLD_DI_TLS_DATA = 10, RTLD_DI_MAX = 10 }; typedef struct { char *dls_name; unsigned int dls_flags; } Dl_serpath; typedef struct { size_t dls_size; unsigned int dls_cnt; __extension__ union { Dl_serpath dls_serpath[0]; Dl_serpath __dls_serpath_pad[1]; }; } Dl_serinfo; } # 684 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/usr/include/x86_64-linux-gnu/gmp.h" 1 3 4 # 34 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 # 1 "/usr/include/c++/10/iosfwd" 1 3 4 # 36 "/usr/include/c++/10/iosfwd" 3 4 # 37 "/usr/include/c++/10/iosfwd" 3 # 1 "/usr/include/c++/10/bits/stringfwd.h" 1 3 # 37 "/usr/include/c++/10/bits/stringfwd.h" 3 # 38 "/usr/include/c++/10/bits/stringfwd.h" 3 # 1 "/usr/include/c++/10/bits/memoryfwd.h" 1 3 # 46 "/usr/include/c++/10/bits/memoryfwd.h" 3 # 47 "/usr/include/c++/10/bits/memoryfwd.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 63 "/usr/include/c++/10/bits/memoryfwd.h" 3 template<typename> class allocator; template<> class allocator<void>; template<typename, typename> struct uses_allocator; } # 41 "/usr/include/c++/10/bits/stringfwd.h" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { template<class _CharT> struct char_traits; template<> struct char_traits<char>; template<> struct char_traits<wchar_t>; template<> struct char_traits<char16_t>; template<> struct char_traits<char32_t>; namespace __cxx11 { template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_string; } typedef basic_string<char> string; typedef basic_string<wchar_t> wstring; # 93 "/usr/include/c++/10/bits/stringfwd.h" 3 typedef basic_string<char16_t> u16string; typedef basic_string<char32_t> u32string; } # 40 "/usr/include/c++/10/iosfwd" 2 3 # 1 "/usr/include/c++/10/bits/postypes.h" 1 3 # 38 "/usr/include/c++/10/bits/postypes.h" 3 # 39 "/usr/include/c++/10/bits/postypes.h" 3 # 1 "/usr/include/c++/10/cwchar" 1 3 # 39 "/usr/include/c++/10/cwchar" 3 # 40 "/usr/include/c++/10/cwchar" 3 # 1 "/usr/include/wchar.h" 1 3 4 # 27 "/usr/include/wchar.h" 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4 # 28 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 36 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/wint_t.h" 1 3 4 # 20 "/usr/include/x86_64-linux-gnu/bits/types/wint_t.h" 3 4 typedef unsigned int wint_t; # 42 "/usr/include/wchar.h" 2 3 4 # 1 "/usr/include/x86_64-linux-gnu/bits/types/mbstate_t.h" 1 3 4 typedef __mbstate_t mbstate_t; # 43 "/usr/include/wchar.h" 2 3 4 # 79 "/usr/include/wchar.h" 3 4 extern "C" { struct tm; extern wchar_t *wcscpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern wchar_t *wcsncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern wchar_t *wcscat (wchar_t *__restrict __dest, const wchar_t *__restrict __src) throw () __attribute__ ((__nonnull__ (1, 2))); extern wchar_t *wcsncat (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) throw () __attribute__ ((__nonnull__ (1, 2))); extern int wcscmp (const wchar_t *__s1, const wchar_t *__s2) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int wcsncmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) throw () __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2))); extern int wcscasecmp (const wchar_t *__s1, const wchar_t *__s2) throw (); extern int wcsncasecmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) throw (); extern int wcscasecmp_l (const wchar_t *__s1, const wchar_t *__s2, locale_t __loc) throw (); extern int wcsncasecmp_l (const wchar_t *__s1, const wchar_t *__s2, size_t __n, locale_t __loc) throw (); extern int wcscoll (const wchar_t *__s1, const wchar_t *__s2) throw (); extern size_t wcsxfrm (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) throw (); extern int wcscoll_l (const wchar_t *__s1, const wchar_t *__s2, locale_t __loc) throw (); extern size_t wcsxfrm_l (wchar_t *__s1, const wchar_t *__s2, size_t __n, locale_t __loc) throw (); extern wchar_t *wcsdup (const wchar_t *__s) throw () __attribute__ ((__malloc__)); extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc) throw () __asm ("wcschr") __attribute__ ((__pure__)); extern "C++" const wchar_t *wcschr (const wchar_t *__wcs, wchar_t __wc) throw () __asm ("wcschr") __attribute__ ((__pure__)); extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc) throw () __asm ("wcsrchr") __attribute__ ((__pure__)); extern "C++" const wchar_t *wcsrchr (const wchar_t *__wcs, wchar_t __wc) throw () __asm ("wcsrchr") __attribute__ ((__pure__)); # 181 "/usr/include/wchar.h" 3 4 extern wchar_t *wcschrnul (const wchar_t *__s, wchar_t __wc) throw () __attribute__ ((__pure__)); extern size_t wcscspn (const wchar_t *__wcs, const wchar_t *__reject) throw () __attribute__ ((__pure__)); extern size_t wcsspn (const wchar_t *__wcs, const wchar_t *__accept) throw () __attribute__ ((__pure__)); extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, const wchar_t *__accept) throw () __asm ("wcspbrk") __attribute__ ((__pure__)); extern "C++" const wchar_t *wcspbrk (const wchar_t *__wcs, const wchar_t *__accept) throw () __asm ("wcspbrk") __attribute__ ((__pure__)); extern "C++" wchar_t *wcsstr (wchar_t *__haystack, const wchar_t *__needle) throw () __asm ("wcsstr") __attribute__ ((__pure__)); extern "C++" const wchar_t *wcsstr (const wchar_t *__haystack, const wchar_t *__needle) throw () __asm ("wcsstr") __attribute__ ((__pure__)); extern wchar_t *wcstok (wchar_t *__restrict __s, const wchar_t *__restrict __delim, wchar_t **__restrict __ptr) throw (); extern size_t wcslen (const wchar_t *__s) throw () __attribute__ ((__pure__)); extern "C++" wchar_t *wcswcs (wchar_t *__haystack, const wchar_t *__needle) throw () __asm ("wcswcs") __attribute__ ((__pure__)); extern "C++" const wchar_t *wcswcs (const wchar_t *__haystack, const wchar_t *__needle) throw () __asm ("wcswcs") __attribute__ ((__pure__)); # 240 "/usr/include/wchar.h" 3 4 extern size_t wcsnlen (const wchar_t *__s, size_t __maxlen) throw () __attribute__ ((__pure__)); extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n) throw () __asm ("wmemchr") __attribute__ ((__pure__)); extern "C++" const wchar_t *wmemchr (const wchar_t *__s, wchar_t __c, size_t __n) throw () __asm ("wmemchr") __attribute__ ((__pure__)); extern int wmemcmp (const wchar_t *__s1, const wchar_t *__s2, size_t __n) throw () __attribute__ ((__pure__)); extern wchar_t *wmemcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) throw (); extern wchar_t *wmemmove (wchar_t *__s1, const wchar_t *__s2, size_t __n) throw (); extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw (); extern wchar_t *wmempcpy (wchar_t *__restrict __s1, const wchar_t *__restrict __s2, size_t __n) throw (); extern wint_t btowc (int __c) throw (); extern int wctob (wint_t __c) throw (); extern int mbsinit (const mbstate_t *__ps) throw () __attribute__ ((__pure__)); extern size_t mbrtowc (wchar_t *__restrict __pwc, const char *__restrict __s, size_t __n, mbstate_t *__restrict __p) throw (); extern size_t wcrtomb (char *__restrict __s, wchar_t __wc, mbstate_t *__restrict __ps) throw (); extern size_t __mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw (); extern size_t mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw (); extern wint_t __btowc_alias (int __c) __asm ("btowc"); extern __inline __attribute__ ((__gnu_inline__)) wint_t __attribute__ ((__leaf__)) btowc (int __c) throw () { return (__builtin_constant_p (__c) && __c >= '\0' && __c <= '\x7f' ? (wint_t) __c : __btowc_alias (__c)); } extern int __wctob_alias (wint_t __c) __asm ("wctob"); extern __inline __attribute__ ((__gnu_inline__)) int __attribute__ ((__leaf__)) wctob (wint_t __wc) throw () { return (__builtin_constant_p (__wc) && __wc >= L'\0' && __wc <= L'\x7f' ? (int) __wc : __wctob_alias (__wc)); } extern __inline __attribute__ ((__gnu_inline__)) size_t __attribute__ ((__leaf__)) mbrlen (const char *__restrict __s, size_t __n, mbstate_t *__restrict __ps) throw () { return (__ps != __null ? mbrtowc (__null, __s, __n, __ps) : __mbrlen (__s, __n, __null)); } extern size_t mbsrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw (); extern size_t wcsrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __len, mbstate_t *__restrict __ps) throw (); extern size_t mbsnrtowcs (wchar_t *__restrict __dst, const char **__restrict __src, size_t __nmc, size_t __len, mbstate_t *__restrict __ps) throw (); extern size_t wcsnrtombs (char *__restrict __dst, const wchar_t **__restrict __src, size_t __nwc, size_t __len, mbstate_t *__restrict __ps) throw (); extern int wcwidth (wchar_t __c) throw (); extern int wcswidth (const wchar_t *__s, size_t __n) throw (); extern double wcstod (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern float wcstof (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern long double wcstold (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); # 396 "/usr/include/wchar.h" 3 4 extern _Float32 wcstof32 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern _Float64 wcstof64 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern _Float128 wcstof128 (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern _Float32x wcstof32x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); extern _Float64x wcstof64x (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr) throw (); # 428 "/usr/include/wchar.h" 3 4 extern long int wcstol (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); extern unsigned long int wcstoul (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); __extension__ extern long long int wcstoll (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); __extension__ extern unsigned long long int wcstoull (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); __extension__ extern long long int wcstoq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); __extension__ extern unsigned long long int wcstouq (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base) throw (); extern long int wcstol_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, locale_t __loc) throw (); extern unsigned long int wcstoul_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, locale_t __loc) throw (); __extension__ extern long long int wcstoll_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, locale_t __loc) throw (); __extension__ extern unsigned long long int wcstoull_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, int __base, locale_t __loc) throw (); extern double wcstod_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern float wcstof_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern long double wcstold_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); # 511 "/usr/include/wchar.h" 3 4 extern _Float32 wcstof32_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern _Float64 wcstof64_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern _Float128 wcstof128_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern _Float32x wcstof32x_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); extern _Float64x wcstof64x_l (const wchar_t *__restrict __nptr, wchar_t **__restrict __endptr, locale_t __loc) throw (); # 551 "/usr/include/wchar.h" 3 4 extern wchar_t *wcpcpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src) throw (); extern wchar_t *wcpncpy (wchar_t *__restrict __dest, const wchar_t *__restrict __src, size_t __n) throw (); # 567 "/usr/include/wchar.h" 3 4 extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw (); extern int fwide (__FILE *__fp, int __mode) throw (); extern int fwprintf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) ; extern int wprintf (const wchar_t *__restrict __format, ...) ; extern int swprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, ...) throw () ; extern int vfwprintf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vwprintf (const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vswprintf (wchar_t *__restrict __s, size_t __n, const wchar_t *__restrict __format, __gnuc_va_list __arg) throw () ; extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) ; extern int wscanf (const wchar_t *__restrict __format, ...) ; extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) throw () ; extern int fwscanf (__FILE *__restrict __stream, const wchar_t *__restrict __format, ...) __asm__ ("" "__isoc99_fwscanf") ; extern int wscanf (const wchar_t *__restrict __format, ...) __asm__ ("" "__isoc99_wscanf") ; extern int swscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, ...) throw () __asm__ ("" "__isoc99_swscanf") ; # 671 "/usr/include/wchar.h" 3 4 extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) ; extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) throw () ; extern int vfwscanf (__FILE *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfwscanf") ; extern int vwscanf (const wchar_t *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vwscanf") ; extern int vswscanf (const wchar_t *__restrict __s, const wchar_t *__restrict __format, __gnuc_va_list __arg) throw () __asm__ ("" "__isoc99_vswscanf") ; # 726 "/usr/include/wchar.h" 3 4 extern wint_t fgetwc (__FILE *__stream); extern wint_t getwc (__FILE *__stream); extern wint_t getwchar (void); extern wint_t fputwc (wchar_t __wc, __FILE *__stream); extern wint_t putwc (wchar_t __wc, __FILE *__stream); extern wint_t putwchar (wchar_t __wc); extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); extern int fputws (const wchar_t *__restrict __ws, __FILE *__restrict __stream); extern wint_t ungetwc (wint_t __wc, __FILE *__stream); # 781 "/usr/include/wchar.h" 3 4 extern wint_t getwc_unlocked (__FILE *__stream); extern wint_t getwchar_unlocked (void); extern wint_t fgetwc_unlocked (__FILE *__stream); extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream); # 807 "/usr/include/wchar.h" 3 4 extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream); extern wint_t putwchar_unlocked (wchar_t __wc); # 817 "/usr/include/wchar.h" 3 4 extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n, __FILE *__restrict __stream); extern int fputws_unlocked (const wchar_t *__restrict __ws, __FILE *__restrict __stream); extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp) throw (); extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize, const wchar_t *__restrict __format, const struct tm *__restrict __tp, locale_t __loc) throw (); # 856 "/usr/include/wchar.h" 3 4 } # 45 "/usr/include/c++/10/cwchar" 2 3 # 62 "/usr/include/c++/10/cwchar" 3 namespace std { using ::mbstate_t; } # 135 "/usr/include/c++/10/cwchar" 3 extern "C++" { namespace std __attribute__ ((__visibility__ ("default"))) { using ::wint_t; using ::btowc; using ::fgetwc; using ::fgetws; using ::fputwc; using ::fputws; using ::fwide; using ::fwprintf; using ::fwscanf; using ::getwc; using ::getwchar; using ::mbrlen; using ::mbrtowc; using ::mbsinit; using ::mbsrtowcs; using ::putwc; using ::putwchar; using ::swprintf; using ::swscanf; using ::ungetwc; using ::vfwprintf; using ::vfwscanf; using ::vswprintf; using ::vswscanf; using ::vwprintf; using ::vwscanf; using ::wcrtomb; using ::wcscat; using ::wcscmp; using ::wcscoll; using ::wcscpy; using ::wcscspn; using ::wcsftime; using ::wcslen; using ::wcsncat; using ::wcsncmp; using ::wcsncpy; using ::wcsrtombs; using ::wcsspn; using ::wcstod; using ::wcstof; using ::wcstok; using ::wcstol; using ::wcstoul; using ::wcsxfrm; using ::wctob; using ::wmemcmp; using ::wmemcpy; using ::wmemmove; using ::wmemset; using ::wprintf; using ::wscanf; using ::wcschr; using ::wcspbrk; using ::wcsrchr; using ::wcsstr; using ::wmemchr; # 234 "/usr/include/c++/10/cwchar" 3 } } namespace __gnu_cxx { using ::wcstold; # 260 "/usr/include/c++/10/cwchar" 3 using ::wcstoll; using ::wcstoull; } namespace std { using ::__gnu_cxx::wcstold; using ::__gnu_cxx::wcstoll; using ::__gnu_cxx::wcstoull; } # 280 "/usr/include/c++/10/cwchar" 3 namespace std { using std::wcstof; using std::vfwscanf; using std::vswscanf; using std::vwscanf; using std::wcstold; using std::wcstoll; using std::wcstoull; } # 41 "/usr/include/c++/10/bits/postypes.h" 2 3 # 68 "/usr/include/c++/10/bits/postypes.h" 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 88 "/usr/include/c++/10/bits/postypes.h" 3 typedef long streamoff; # 98 "/usr/include/c++/10/bits/postypes.h" 3 typedef ptrdiff_t streamsize; # 111 "/usr/include/c++/10/bits/postypes.h" 3 template<typename _StateT> class fpos { private: streamoff _M_off; _StateT _M_state; public: fpos() : _M_off(0), _M_state() { } # 133 "/usr/include/c++/10/bits/postypes.h" 3 fpos(streamoff __off) : _M_off(__off), _M_state() { } fpos(const fpos&) = default; fpos& operator=(const fpos&) = default; ~fpos() = default; operator streamoff() const { return _M_off; } void state(_StateT __st) { _M_state = __st; } _StateT state() const { return _M_state; } fpos& operator+=(streamoff __off) { _M_off += __off; return *this; } fpos& operator-=(streamoff __off) { _M_off -= __off; return *this; } fpos operator+(streamoff __off) const { fpos __pos(*this); __pos += __off; return __pos; } fpos operator-(streamoff __off) const { fpos __pos(*this); __pos -= __off; return __pos; } streamoff operator-(const fpos& __other) const { return _M_off - __other._M_off; } }; template<typename _StateT> inline bool operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) { return streamoff(__lhs) == streamoff(__rhs); } template<typename _StateT> inline bool operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs) { return streamoff(__lhs) != streamoff(__rhs); } typedef fpos<mbstate_t> streampos; typedef fpos<mbstate_t> wstreampos; # 245 "/usr/include/c++/10/bits/postypes.h" 3 typedef fpos<mbstate_t> u16streampos; typedef fpos<mbstate_t> u32streampos; } # 41 "/usr/include/c++/10/iosfwd" 2 3 namespace std __attribute__ ((__visibility__ ("default"))) { # 74 "/usr/include/c++/10/iosfwd" 3 class ios_base; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_ios; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_streambuf; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_istream; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_ostream; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_iostream; namespace __cxx11 { template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_stringbuf; template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_istringstream; template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_ostringstream; template<typename _CharT, typename _Traits = char_traits<_CharT>, typename _Alloc = allocator<_CharT> > class basic_stringstream; } template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_filebuf; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_ifstream; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_ofstream; template<typename _CharT, typename _Traits = char_traits<_CharT> > class basic_fstream; template<typename _CharT, typename _Traits = char_traits<_CharT> > class istreambuf_iterator; template<typename _CharT, typename _Traits = char_traits<_CharT> > class ostreambuf_iterator; typedef basic_ios<char> ios; typedef basic_streambuf<char> streambuf; typedef basic_istream<char> istream; typedef basic_ostream<char> ostream; typedef basic_iostream<char> iostream; typedef basic_stringbuf<char> stringbuf; typedef basic_istringstream<char> istringstream; typedef basic_ostringstream<char> ostringstream; typedef basic_stringstream<char> stringstream; typedef basic_filebuf<char> filebuf; typedef basic_ifstream<char> ifstream; typedef basic_ofstream<char> ofstream; typedef basic_fstream<char> fstream; typedef basic_ios<wchar_t> wios; typedef basic_streambuf<wchar_t> wstreambuf; typedef basic_istream<wchar_t> wistream; typedef basic_ostream<wchar_t> wostream; typedef basic_iostream<wchar_t> wiostream; typedef basic_stringbuf<wchar_t> wstringbuf; typedef basic_istringstream<wchar_t> wistringstream; typedef basic_ostringstream<wchar_t> wostringstream; typedef basic_stringstream<wchar_t> wstringstream; typedef basic_filebuf<wchar_t> wfilebuf; typedef basic_ifstream<wchar_t> wifstream; typedef basic_ofstream<wchar_t> wofstream; typedef basic_fstream<wchar_t> wfstream; } # 35 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4 # 1 "/usr/include/c++/10/cstdio" 1 3 4 # 39 "/usr/include/c++/10/cstdio" 3 4 # 40 "/usr/include/c++/10/cstdio" 3 # 96 "/usr/include/c++/10/cstdio" 3 namespace std { using ::FILE; using ::fpos_t; using ::clearerr; using ::fclose; using ::feof; using ::ferror; using ::fflush; using ::fgetc; using ::fgetpos; using ::fgets; using ::fopen; using ::fprintf; using ::fputc; using ::fputs; using ::fread; using ::freopen; using ::fscanf; using ::fseek; using ::fsetpos; using ::ftell; using ::fwrite; using ::getc; using ::getchar; using ::perror; using ::printf; using ::putc; using ::putchar; using ::puts; using ::remove; using ::rename; using ::rewind; using ::scanf; using ::setbuf; using ::setvbuf; using ::sprintf; using ::sscanf; using ::tmpfile; using ::tmpnam; using ::ungetc; using ::vfprintf; using ::vprintf; using ::vsprintf; } # 157 "/usr/include/c++/10/cstdio" 3 namespace __gnu_cxx { # 175 "/usr/include/c++/10/cstdio" 3 using ::snprintf; using ::vfscanf; using ::vscanf; using ::vsnprintf; using ::vsscanf; } namespace std { using ::__gnu_cxx::snprintf; using ::__gnu_cxx::vfscanf; using ::__gnu_cxx::vscanf; using ::__gnu_cxx::vsnprintf; using ::__gnu_cxx::vsscanf; } # 36 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4 # 55 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 56 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4 # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/limits.h" 1 3 4 # 57 "/usr/include/x86_64-linux-gnu/gmp.h" 2 3 4 # 141 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 typedef unsigned long int mp_limb_t; typedef long int mp_limb_signed_t; typedef unsigned long int mp_bitcnt_t; typedef struct { int _mp_alloc; int _mp_size; mp_limb_t *_mp_d; } __mpz_struct; typedef __mpz_struct MP_INT; typedef __mpz_struct mpz_t[1]; typedef mp_limb_t * mp_ptr; typedef const mp_limb_t * mp_srcptr; typedef long int mp_size_t; typedef long int mp_exp_t; typedef struct { __mpz_struct _mp_num; __mpz_struct _mp_den; } __mpq_struct; typedef __mpq_struct MP_RAT; typedef __mpq_struct mpq_t[1]; typedef struct { int _mp_prec; int _mp_size; mp_exp_t _mp_exp; mp_limb_t *_mp_d; } __mpf_struct; typedef __mpf_struct mpf_t[1]; typedef enum { GMP_RAND_ALG_DEFAULT = 0, GMP_RAND_ALG_LC = GMP_RAND_ALG_DEFAULT } gmp_randalg_t; typedef struct { mpz_t _mp_seed; gmp_randalg_t _mp_alg; union { void *_mp_lc; } _mp_algdata; } __gmp_randstate_struct; typedef __gmp_randstate_struct gmp_randstate_t[1]; typedef const __mpz_struct *mpz_srcptr; typedef __mpz_struct *mpz_ptr; typedef const __mpf_struct *mpf_srcptr; typedef __mpf_struct *mpf_ptr; typedef const __mpq_struct *mpq_srcptr; typedef __mpq_struct *mpq_ptr; # 472 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 extern "C" { using std::FILE; void __gmp_set_memory_functions (void *(*) (size_t), void *(*) (void *, size_t, size_t), void (*) (void *, size_t)) noexcept; void __gmp_get_memory_functions (void *(**) (size_t), void *(**) (void *, size_t, size_t), void (**) (void *, size_t)) noexcept; extern const int __gmp_bits_per_limb; extern int __gmp_errno; extern const char * const __gmp_version; void __gmp_randinit (gmp_randstate_t, gmp_randalg_t, ...); void __gmp_randinit_default (gmp_randstate_t); void __gmp_randinit_lc_2exp (gmp_randstate_t, mpz_srcptr, unsigned long int, mp_bitcnt_t); int __gmp_randinit_lc_2exp_size (gmp_randstate_t, mp_bitcnt_t); void __gmp_randinit_mt (gmp_randstate_t); void __gmp_randinit_set (gmp_randstate_t, const __gmp_randstate_struct *); void __gmp_randseed (gmp_randstate_t, mpz_srcptr); void __gmp_randseed_ui (gmp_randstate_t, unsigned long int); void __gmp_randclear (gmp_randstate_t); unsigned long __gmp_urandomb_ui (gmp_randstate_t, unsigned long); unsigned long __gmp_urandomm_ui (gmp_randstate_t, unsigned long); int __gmp_asprintf (char **, const char *, ...); int __gmp_fprintf (FILE *, const char *, ...); # 554 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 int __gmp_printf (const char *, ...); int __gmp_snprintf (char *, size_t, const char *, ...); int __gmp_sprintf (char *, const char *, ...); int __gmp_vasprintf (char **, const char *, va_list); int __gmp_vfprintf (FILE *, const char *, va_list); int __gmp_vprintf (const char *, va_list); int __gmp_vsnprintf (char *, size_t, const char *, va_list); int __gmp_vsprintf (char *, const char *, va_list); int __gmp_fscanf (FILE *, const char *, ...); int __gmp_scanf (const char *, ...); int __gmp_sscanf (const char *, const char *, ...); int __gmp_vfscanf (FILE *, const char *, va_list); int __gmp_vscanf (const char *, va_list); int __gmp_vsscanf (const char *, const char *, va_list); void *__gmpz_realloc (mpz_ptr, mp_size_t); void __gmpz_abs (mpz_ptr, mpz_srcptr); void __gmpz_add (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_add_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_addmul (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_addmul_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_and (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_array_init (mpz_ptr, mp_size_t, mp_size_t); void __gmpz_bin_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_bin_uiui (mpz_ptr, unsigned long int, unsigned long int); void __gmpz_cdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_cdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_cdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_cdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); unsigned long int __gmpz_cdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_cdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_cdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_cdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int); unsigned long int __gmpz_cdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__)); void __gmpz_clear (mpz_ptr); void __gmpz_clears (mpz_ptr, ...); void __gmpz_clrbit (mpz_ptr, mp_bitcnt_t); int __gmpz_cmp (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_cmp_d (mpz_srcptr, double) __attribute__ ((__pure__)); int __gmpz_cmp_si (mpz_srcptr, signed long int) noexcept __attribute__ ((__pure__)); int __gmpz_cmp_ui (mpz_srcptr, unsigned long int) noexcept __attribute__ ((__pure__)); int __gmpz_cmpabs (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_cmpabs_d (mpz_srcptr, double) __attribute__ ((__pure__)); int __gmpz_cmpabs_ui (mpz_srcptr, unsigned long int) noexcept __attribute__ ((__pure__)); void __gmpz_com (mpz_ptr, mpz_srcptr); void __gmpz_combit (mpz_ptr, mp_bitcnt_t); int __gmpz_congruent_p (mpz_srcptr, mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__)); int __gmpz_congruent_2exp_p (mpz_srcptr, mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__)); int __gmpz_congruent_ui_p (mpz_srcptr, unsigned long, unsigned long) __attribute__ ((__pure__)); void __gmpz_divexact (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_divexact_ui (mpz_ptr, mpz_srcptr, unsigned long); int __gmpz_divisible_p (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__)); int __gmpz_divisible_ui_p (mpz_srcptr, unsigned long) __attribute__ ((__pure__)); int __gmpz_divisible_2exp_p (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__)); void __gmpz_dump (mpz_srcptr); void *__gmpz_export (void *, size_t *, int, size_t, int, size_t, mpz_srcptr); void __gmpz_fac_ui (mpz_ptr, unsigned long int); void __gmpz_2fac_ui (mpz_ptr, unsigned long int); void __gmpz_mfac_uiui (mpz_ptr, unsigned long int, unsigned long int); void __gmpz_primorial_ui (mpz_ptr, unsigned long int); void __gmpz_fdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_fdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_fdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_fdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); unsigned long int __gmpz_fdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_fdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_fdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_fdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int); unsigned long int __gmpz_fdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__)); void __gmpz_fib_ui (mpz_ptr, unsigned long int); void __gmpz_fib2_ui (mpz_ptr, mpz_ptr, unsigned long int); int __gmpz_fits_sint_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_fits_slong_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_fits_sshort_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_fits_uint_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_fits_ulong_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpz_fits_ushort_p (mpz_srcptr) noexcept __attribute__ ((__pure__)); void __gmpz_gcd (mpz_ptr, mpz_srcptr, mpz_srcptr); unsigned long int __gmpz_gcd_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_gcdext (mpz_ptr, mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); double __gmpz_get_d (mpz_srcptr) __attribute__ ((__pure__)); double __gmpz_get_d_2exp (signed long int *, mpz_srcptr); long int __gmpz_get_si (mpz_srcptr) noexcept __attribute__ ((__pure__)); char *__gmpz_get_str (char *, int, mpz_srcptr); unsigned long int __gmpz_get_ui (mpz_srcptr) noexcept __attribute__ ((__pure__)); mp_limb_t __gmpz_getlimbn (mpz_srcptr, mp_size_t) noexcept __attribute__ ((__pure__)); mp_bitcnt_t __gmpz_hamdist (mpz_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__)); void __gmpz_import (mpz_ptr, size_t, int, size_t, int, size_t, const void *); void __gmpz_init (mpz_ptr) noexcept; void __gmpz_init2 (mpz_ptr, mp_bitcnt_t); void __gmpz_inits (mpz_ptr, ...) noexcept; void __gmpz_init_set (mpz_ptr, mpz_srcptr); void __gmpz_init_set_d (mpz_ptr, double); void __gmpz_init_set_si (mpz_ptr, signed long int); int __gmpz_init_set_str (mpz_ptr, const char *, int); void __gmpz_init_set_ui (mpz_ptr, unsigned long int); size_t __gmpz_inp_raw (mpz_ptr, FILE *); size_t __gmpz_inp_str (mpz_ptr, FILE *, int); int __gmpz_invert (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_ior (mpz_ptr, mpz_srcptr, mpz_srcptr); int __gmpz_jacobi (mpz_srcptr, mpz_srcptr) __attribute__ ((__pure__)); int __gmpz_kronecker_si (mpz_srcptr, long) __attribute__ ((__pure__)); int __gmpz_kronecker_ui (mpz_srcptr, unsigned long) __attribute__ ((__pure__)); int __gmpz_si_kronecker (long, mpz_srcptr) __attribute__ ((__pure__)); int __gmpz_ui_kronecker (unsigned long, mpz_srcptr) __attribute__ ((__pure__)); void __gmpz_lcm (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_lcm_ui (mpz_ptr, mpz_srcptr, unsigned long); void __gmpz_lucnum_ui (mpz_ptr, unsigned long int); void __gmpz_lucnum2_ui (mpz_ptr, mpz_ptr, unsigned long int); int __gmpz_millerrabin (mpz_srcptr, int) __attribute__ ((__pure__)); void __gmpz_mod (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_mul (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_mul_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); void __gmpz_mul_si (mpz_ptr, mpz_srcptr, long int); void __gmpz_mul_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_neg (mpz_ptr, mpz_srcptr); void __gmpz_nextprime (mpz_ptr, mpz_srcptr); size_t __gmpz_out_raw (FILE *, mpz_srcptr); size_t __gmpz_out_str (FILE *, int, mpz_srcptr); int __gmpz_perfect_power_p (mpz_srcptr) __attribute__ ((__pure__)); int __gmpz_perfect_square_p (mpz_srcptr) __attribute__ ((__pure__)); mp_bitcnt_t __gmpz_popcount (mpz_srcptr) noexcept __attribute__ ((__pure__)); void __gmpz_pow_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_powm (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr); void __gmpz_powm_sec (mpz_ptr, mpz_srcptr, mpz_srcptr, mpz_srcptr); void __gmpz_powm_ui (mpz_ptr, mpz_srcptr, unsigned long int, mpz_srcptr); int __gmpz_probab_prime_p (mpz_srcptr, int) __attribute__ ((__pure__)); void __gmpz_random (mpz_ptr, mp_size_t); void __gmpz_random2 (mpz_ptr, mp_size_t); void __gmpz_realloc2 (mpz_ptr, mp_bitcnt_t); mp_bitcnt_t __gmpz_remove (mpz_ptr, mpz_srcptr, mpz_srcptr); int __gmpz_root (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_rootrem (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_rrandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t); mp_bitcnt_t __gmpz_scan0 (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__)); mp_bitcnt_t __gmpz_scan1 (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__)); void __gmpz_set (mpz_ptr, mpz_srcptr); void __gmpz_set_d (mpz_ptr, double); void __gmpz_set_f (mpz_ptr, mpf_srcptr); void __gmpz_set_q (mpz_ptr, mpq_srcptr); void __gmpz_set_si (mpz_ptr, signed long int); int __gmpz_set_str (mpz_ptr, const char *, int); void __gmpz_set_ui (mpz_ptr, unsigned long int); void __gmpz_setbit (mpz_ptr, mp_bitcnt_t); size_t __gmpz_size (mpz_srcptr) noexcept __attribute__ ((__pure__)); size_t __gmpz_sizeinbase (mpz_srcptr, int) noexcept __attribute__ ((__pure__)); void __gmpz_sqrt (mpz_ptr, mpz_srcptr); void __gmpz_sqrtrem (mpz_ptr, mpz_ptr, mpz_srcptr); void __gmpz_sub (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_sub_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_ui_sub (mpz_ptr, unsigned long int, mpz_srcptr); void __gmpz_submul (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_submul_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_swap (mpz_ptr, mpz_ptr) noexcept; unsigned long int __gmpz_tdiv_ui (mpz_srcptr, unsigned long int) __attribute__ ((__pure__)); void __gmpz_tdiv_q (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_tdiv_q_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_tdiv_q_ui (mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_tdiv_qr (mpz_ptr, mpz_ptr, mpz_srcptr, mpz_srcptr); unsigned long int __gmpz_tdiv_qr_ui (mpz_ptr, mpz_ptr, mpz_srcptr, unsigned long int); void __gmpz_tdiv_r (mpz_ptr, mpz_srcptr, mpz_srcptr); void __gmpz_tdiv_r_2exp (mpz_ptr, mpz_srcptr, mp_bitcnt_t); unsigned long int __gmpz_tdiv_r_ui (mpz_ptr, mpz_srcptr, unsigned long int); int __gmpz_tstbit (mpz_srcptr, mp_bitcnt_t) noexcept __attribute__ ((__pure__)); void __gmpz_ui_pow_ui (mpz_ptr, unsigned long int, unsigned long int); void __gmpz_urandomb (mpz_ptr, gmp_randstate_t, mp_bitcnt_t); void __gmpz_urandomm (mpz_ptr, gmp_randstate_t, mpz_srcptr); void __gmpz_xor (mpz_ptr, mpz_srcptr, mpz_srcptr); mp_srcptr __gmpz_limbs_read (mpz_srcptr); mp_ptr __gmpz_limbs_write (mpz_ptr, mp_size_t); mp_ptr __gmpz_limbs_modify (mpz_ptr, mp_size_t); void __gmpz_limbs_finish (mpz_ptr, mp_size_t); mpz_srcptr __gmpz_roinit_n (mpz_ptr, mp_srcptr, mp_size_t); void __gmpq_abs (mpq_ptr, mpq_srcptr); void __gmpq_add (mpq_ptr, mpq_srcptr, mpq_srcptr); void __gmpq_canonicalize (mpq_ptr); void __gmpq_clear (mpq_ptr); void __gmpq_clears (mpq_ptr, ...); int __gmpq_cmp (mpq_srcptr, mpq_srcptr) __attribute__ ((__pure__)); int __gmpq_cmp_si (mpq_srcptr, long, unsigned long) __attribute__ ((__pure__)); int __gmpq_cmp_ui (mpq_srcptr, unsigned long int, unsigned long int) __attribute__ ((__pure__)); int __gmpq_cmp_z (mpq_srcptr, mpz_srcptr) __attribute__ ((__pure__)); void __gmpq_div (mpq_ptr, mpq_srcptr, mpq_srcptr); void __gmpq_div_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t); int __gmpq_equal (mpq_srcptr, mpq_srcptr) noexcept __attribute__ ((__pure__)); void __gmpq_get_num (mpz_ptr, mpq_srcptr); void __gmpq_get_den (mpz_ptr, mpq_srcptr); double __gmpq_get_d (mpq_srcptr) __attribute__ ((__pure__)); char *__gmpq_get_str (char *, int, mpq_srcptr); void __gmpq_init (mpq_ptr); void __gmpq_inits (mpq_ptr, ...); size_t __gmpq_inp_str (mpq_ptr, FILE *, int); void __gmpq_inv (mpq_ptr, mpq_srcptr); void __gmpq_mul (mpq_ptr, mpq_srcptr, mpq_srcptr); void __gmpq_mul_2exp (mpq_ptr, mpq_srcptr, mp_bitcnt_t); void __gmpq_neg (mpq_ptr, mpq_srcptr); size_t __gmpq_out_str (FILE *, int, mpq_srcptr); void __gmpq_set (mpq_ptr, mpq_srcptr); void __gmpq_set_d (mpq_ptr, double); void __gmpq_set_den (mpq_ptr, mpz_srcptr); void __gmpq_set_f (mpq_ptr, mpf_srcptr); void __gmpq_set_num (mpq_ptr, mpz_srcptr); void __gmpq_set_si (mpq_ptr, signed long int, unsigned long int); int __gmpq_set_str (mpq_ptr, const char *, int); void __gmpq_set_ui (mpq_ptr, unsigned long int, unsigned long int); void __gmpq_set_z (mpq_ptr, mpz_srcptr); void __gmpq_sub (mpq_ptr, mpq_srcptr, mpq_srcptr); void __gmpq_swap (mpq_ptr, mpq_ptr) noexcept; void __gmpf_abs (mpf_ptr, mpf_srcptr); void __gmpf_add (mpf_ptr, mpf_srcptr, mpf_srcptr); void __gmpf_add_ui (mpf_ptr, mpf_srcptr, unsigned long int); void __gmpf_ceil (mpf_ptr, mpf_srcptr); void __gmpf_clear (mpf_ptr); void __gmpf_clears (mpf_ptr, ...); int __gmpf_cmp (mpf_srcptr, mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_cmp_z (mpf_srcptr, mpz_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_cmp_d (mpf_srcptr, double) __attribute__ ((__pure__)); int __gmpf_cmp_si (mpf_srcptr, signed long int) noexcept __attribute__ ((__pure__)); int __gmpf_cmp_ui (mpf_srcptr, unsigned long int) noexcept __attribute__ ((__pure__)); void __gmpf_div (mpf_ptr, mpf_srcptr, mpf_srcptr); void __gmpf_div_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t); void __gmpf_div_ui (mpf_ptr, mpf_srcptr, unsigned long int); void __gmpf_dump (mpf_srcptr); int __gmpf_eq (mpf_srcptr, mpf_srcptr, mp_bitcnt_t) __attribute__ ((__pure__)); int __gmpf_fits_sint_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_fits_slong_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_fits_sshort_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_fits_uint_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_fits_ulong_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); int __gmpf_fits_ushort_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); void __gmpf_floor (mpf_ptr, mpf_srcptr); double __gmpf_get_d (mpf_srcptr) __attribute__ ((__pure__)); double __gmpf_get_d_2exp (signed long int *, mpf_srcptr); mp_bitcnt_t __gmpf_get_default_prec (void) noexcept __attribute__ ((__pure__)); mp_bitcnt_t __gmpf_get_prec (mpf_srcptr) noexcept __attribute__ ((__pure__)); long __gmpf_get_si (mpf_srcptr) noexcept __attribute__ ((__pure__)); char *__gmpf_get_str (char *, mp_exp_t *, int, size_t, mpf_srcptr); unsigned long __gmpf_get_ui (mpf_srcptr) noexcept __attribute__ ((__pure__)); void __gmpf_init (mpf_ptr); void __gmpf_init2 (mpf_ptr, mp_bitcnt_t); void __gmpf_inits (mpf_ptr, ...); void __gmpf_init_set (mpf_ptr, mpf_srcptr); void __gmpf_init_set_d (mpf_ptr, double); void __gmpf_init_set_si (mpf_ptr, signed long int); int __gmpf_init_set_str (mpf_ptr, const char *, int); void __gmpf_init_set_ui (mpf_ptr, unsigned long int); size_t __gmpf_inp_str (mpf_ptr, FILE *, int); int __gmpf_integer_p (mpf_srcptr) noexcept __attribute__ ((__pure__)); void __gmpf_mul (mpf_ptr, mpf_srcptr, mpf_srcptr); void __gmpf_mul_2exp (mpf_ptr, mpf_srcptr, mp_bitcnt_t); void __gmpf_mul_ui (mpf_ptr, mpf_srcptr, unsigned long int); void __gmpf_neg (mpf_ptr, mpf_srcptr); size_t __gmpf_out_str (FILE *, int, size_t, mpf_srcptr); void __gmpf_pow_ui (mpf_ptr, mpf_srcptr, unsigned long int); void __gmpf_random2 (mpf_ptr, mp_size_t, mp_exp_t); void __gmpf_reldiff (mpf_ptr, mpf_srcptr, mpf_srcptr); void __gmpf_set (mpf_ptr, mpf_srcptr); void __gmpf_set_d (mpf_ptr, double); void __gmpf_set_default_prec (mp_bitcnt_t) noexcept; void __gmpf_set_prec (mpf_ptr, mp_bitcnt_t); void __gmpf_set_prec_raw (mpf_ptr, mp_bitcnt_t) noexcept; void __gmpf_set_q (mpf_ptr, mpq_srcptr); void __gmpf_set_si (mpf_ptr, signed long int); int __gmpf_set_str (mpf_ptr, const char *, int); void __gmpf_set_ui (mpf_ptr, unsigned long int); void __gmpf_set_z (mpf_ptr, mpz_srcptr); size_t __gmpf_size (mpf_srcptr) noexcept __attribute__ ((__pure__)); void __gmpf_sqrt (mpf_ptr, mpf_srcptr); void __gmpf_sqrt_ui (mpf_ptr, unsigned long int); void __gmpf_sub (mpf_ptr, mpf_srcptr, mpf_srcptr); void __gmpf_sub_ui (mpf_ptr, mpf_srcptr, unsigned long int); void __gmpf_swap (mpf_ptr, mpf_ptr) noexcept; void __gmpf_trunc (mpf_ptr, mpf_srcptr); void __gmpf_ui_div (mpf_ptr, unsigned long int, mpf_srcptr); void __gmpf_ui_sub (mpf_ptr, unsigned long int, mpf_srcptr); void __gmpf_urandomb (mpf_t, gmp_randstate_t, mp_bitcnt_t); # 1465 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 mp_limb_t __gmpn_add (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t); mp_limb_t __gmpn_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) noexcept; mp_limb_t __gmpn_add_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_addmul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t); int __gmpn_cmp (mp_srcptr, mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__)); int __gmpn_zero_p (mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__)); void __gmpn_divexact_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t); mp_limb_t __gmpn_divexact_by3c (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t); mp_limb_t __gmpn_divrem (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr, mp_size_t); mp_limb_t __gmpn_divrem_1 (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_limb_t); mp_limb_t __gmpn_divrem_2 (mp_ptr, mp_size_t, mp_ptr, mp_size_t, mp_srcptr); mp_limb_t __gmpn_div_qr_1 (mp_ptr, mp_limb_t *, mp_srcptr, mp_size_t, mp_limb_t); mp_limb_t __gmpn_div_qr_2 (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_srcptr); mp_size_t __gmpn_gcd (mp_ptr, mp_ptr, mp_size_t, mp_ptr, mp_size_t); mp_limb_t __gmpn_gcd_11 (mp_limb_t, mp_limb_t) __attribute__ ((__pure__)); mp_limb_t __gmpn_gcd_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__)); mp_limb_t __gmpn_gcdext_1 (mp_limb_signed_t *, mp_limb_signed_t *, mp_limb_t, mp_limb_t); mp_size_t __gmpn_gcdext (mp_ptr, mp_ptr, mp_size_t *, mp_ptr, mp_size_t, mp_ptr, mp_size_t); size_t __gmpn_get_str (unsigned char *, int, mp_ptr, mp_size_t); mp_bitcnt_t __gmpn_hamdist (mp_srcptr, mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__)); mp_limb_t __gmpn_lshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int); mp_limb_t __gmpn_mod_1 (mp_srcptr, mp_size_t, mp_limb_t) __attribute__ ((__pure__)); mp_limb_t __gmpn_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t); mp_limb_t __gmpn_mul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t); void __gmpn_mul_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_sqr (mp_ptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_neg (mp_ptr, mp_srcptr, mp_size_t); void __gmpn_com (mp_ptr, mp_srcptr, mp_size_t); int __gmpn_perfect_square_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__)); int __gmpn_perfect_power_p (mp_srcptr, mp_size_t) __attribute__ ((__pure__)); mp_bitcnt_t __gmpn_popcount (mp_srcptr, mp_size_t) noexcept __attribute__ ((__pure__)); mp_size_t __gmpn_pow_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr); mp_limb_t __gmpn_preinv_mod_1 (mp_srcptr, mp_size_t, mp_limb_t, mp_limb_t) __attribute__ ((__pure__)); void __gmpn_random (mp_ptr, mp_size_t); void __gmpn_random2 (mp_ptr, mp_size_t); mp_limb_t __gmpn_rshift (mp_ptr, mp_srcptr, mp_size_t, unsigned int); mp_bitcnt_t __gmpn_scan0 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__)); mp_bitcnt_t __gmpn_scan1 (mp_srcptr, mp_bitcnt_t) __attribute__ ((__pure__)); mp_size_t __gmpn_set_str (mp_ptr, const unsigned char *, size_t, int); size_t __gmpn_sizeinbase (mp_srcptr, mp_size_t, int); mp_size_t __gmpn_sqrtrem (mp_ptr, mp_ptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_sub (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t); mp_limb_t __gmpn_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t) noexcept; mp_limb_t __gmpn_sub_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_submul_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t); void __gmpn_tdiv_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t); void __gmpn_and_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_andn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_nand_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_ior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_iorn_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_nior_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_xor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_xnor_n (mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); void __gmpn_copyi (mp_ptr, mp_srcptr, mp_size_t); void __gmpn_copyd (mp_ptr, mp_srcptr, mp_size_t); void __gmpn_zero (mp_ptr, mp_size_t); mp_limb_t __gmpn_cnd_add_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_cnd_sub_n (mp_limb_t, mp_ptr, mp_srcptr, mp_srcptr, mp_size_t); mp_limb_t __gmpn_sec_add_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr); mp_size_t __gmpn_sec_add_1_itch (mp_size_t) __attribute__ ((__pure__)); mp_limb_t __gmpn_sec_sub_1 (mp_ptr, mp_srcptr, mp_size_t, mp_limb_t, mp_ptr); mp_size_t __gmpn_sec_sub_1_itch (mp_size_t) __attribute__ ((__pure__)); void __gmpn_cnd_swap (mp_limb_t, volatile mp_limb_t *, volatile mp_limb_t *, mp_size_t); void __gmpn_sec_mul (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr); mp_size_t __gmpn_sec_mul_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__)); void __gmpn_sec_sqr (mp_ptr, mp_srcptr, mp_size_t, mp_ptr); mp_size_t __gmpn_sec_sqr_itch (mp_size_t) __attribute__ ((__pure__)); void __gmpn_sec_powm (mp_ptr, mp_srcptr, mp_size_t, mp_srcptr, mp_bitcnt_t, mp_srcptr, mp_size_t, mp_ptr); mp_size_t __gmpn_sec_powm_itch (mp_size_t, mp_bitcnt_t, mp_size_t) __attribute__ ((__pure__)); void __gmpn_sec_tabselect (volatile mp_limb_t *, volatile const mp_limb_t *, mp_size_t, mp_size_t, mp_size_t); mp_limb_t __gmpn_sec_div_qr (mp_ptr, mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr); mp_size_t __gmpn_sec_div_qr_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__)); void __gmpn_sec_div_r (mp_ptr, mp_size_t, mp_srcptr, mp_size_t, mp_ptr); mp_size_t __gmpn_sec_div_r_itch (mp_size_t, mp_size_t) __attribute__ ((__pure__)); int __gmpn_sec_invert (mp_ptr, mp_ptr, mp_srcptr, mp_size_t, mp_bitcnt_t, mp_ptr); mp_size_t __gmpn_sec_invert_itch (mp_size_t) __attribute__ ((__pure__)); # 1714 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 extern __inline__ __attribute__ ((__gnu_inline__)) void __gmpz_abs (mpz_ptr __gmp_w, mpz_srcptr __gmp_u) { if (__gmp_w != __gmp_u) __gmpz_set (__gmp_w, __gmp_u); __gmp_w->_mp_size = ((__gmp_w->_mp_size) >= 0 ? (__gmp_w->_mp_size) : -(__gmp_w->_mp_size)); } # 1738 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpz_fits_uint_p (mpz_srcptr __gmp_z) noexcept { mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fffffff * 2U + 1U)));; } extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpz_fits_ulong_p (mpz_srcptr __gmp_z) noexcept { mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fffffffffffffffL * 2UL + 1UL)));; } extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpz_fits_ushort_p (mpz_srcptr __gmp_z) noexcept { mp_size_t __gmp_n = __gmp_z->_mp_size; mp_ptr __gmp_p = __gmp_z->_mp_d; return (__gmp_n == 0 || (__gmp_n == 1 && __gmp_p[0] <= (0x7fff * 2 + 1)));; } extern __inline__ __attribute__ ((__gnu_inline__)) unsigned long __gmpz_get_ui (mpz_srcptr __gmp_z) noexcept { mp_ptr __gmp_p = __gmp_z->_mp_d; mp_size_t __gmp_n = __gmp_z->_mp_size; mp_limb_t __gmp_l = __gmp_p[0]; return (__gmp_n != 0 ? __gmp_l : 0); # 1794 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 } extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpz_getlimbn (mpz_srcptr __gmp_z, mp_size_t __gmp_n) noexcept { mp_limb_t __gmp_result = 0; if (__builtin_expect ((__gmp_n >= 0 && __gmp_n < ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size))) != 0, 1)) __gmp_result = __gmp_z->_mp_d[__gmp_n]; return __gmp_result; } extern __inline__ __attribute__ ((__gnu_inline__)) void __gmpz_neg (mpz_ptr __gmp_w, mpz_srcptr __gmp_u) { if (__gmp_w != __gmp_u) __gmpz_set (__gmp_w, __gmp_u); __gmp_w->_mp_size = - __gmp_w->_mp_size; } extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpz_perfect_square_p (mpz_srcptr __gmp_a) { mp_size_t __gmp_asize; int __gmp_result; __gmp_asize = __gmp_a->_mp_size; __gmp_result = (__gmp_asize >= 0); if (__builtin_expect ((__gmp_asize > 0) != 0, 1)) __gmp_result = __gmpn_perfect_square_p (__gmp_a->_mp_d, __gmp_asize); return __gmp_result; } extern __inline__ __attribute__ ((__gnu_inline__)) mp_bitcnt_t __gmpz_popcount (mpz_srcptr __gmp_u) noexcept { mp_size_t __gmp_usize; mp_bitcnt_t __gmp_result; __gmp_usize = __gmp_u->_mp_size; __gmp_result = (__gmp_usize < 0 ? ~ (static_cast<mp_bitcnt_t> (0)) : (static_cast<mp_bitcnt_t> (0))); if (__builtin_expect ((__gmp_usize > 0) != 0, 1)) __gmp_result = __gmpn_popcount (__gmp_u->_mp_d, __gmp_usize); return __gmp_result; } extern __inline__ __attribute__ ((__gnu_inline__)) void __gmpz_set_q (mpz_ptr __gmp_w, mpq_srcptr __gmp_u) { __gmpz_tdiv_q (__gmp_w, (&((__gmp_u)->_mp_num)), (&((__gmp_u)->_mp_den))); } extern __inline__ __attribute__ ((__gnu_inline__)) size_t __gmpz_size (mpz_srcptr __gmp_z) noexcept { return ((__gmp_z->_mp_size) >= 0 ? (__gmp_z->_mp_size) : -(__gmp_z->_mp_size)); } extern __inline__ __attribute__ ((__gnu_inline__)) void __gmpq_abs (mpq_ptr __gmp_w, mpq_srcptr __gmp_u) { if (__gmp_w != __gmp_u) __gmpq_set (__gmp_w, __gmp_u); __gmp_w->_mp_num._mp_size = ((__gmp_w->_mp_num._mp_size) >= 0 ? (__gmp_w->_mp_num._mp_size) : -(__gmp_w->_mp_num._mp_size)); } extern __inline__ __attribute__ ((__gnu_inline__)) void __gmpq_neg (mpq_ptr __gmp_w, mpq_srcptr __gmp_u) { if (__gmp_w != __gmp_u) __gmpq_set (__gmp_w, __gmp_u); __gmp_w->_mp_num._mp_size = - __gmp_w->_mp_num._mp_size; } # 2136 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpn_add (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize) { mp_limb_t __gmp_c; do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_add_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x + 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)) == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0); return __gmp_c; } extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpn_add_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) noexcept { mp_limb_t __gmp_c; do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x + (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_r) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x + 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_r) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0); return __gmp_c; } extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpn_cmp (mp_srcptr __gmp_xp, mp_srcptr __gmp_yp, mp_size_t __gmp_size) noexcept { int __gmp_result; do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_y; (__gmp_result) = 0; __gmp_i = (__gmp_size); while (--__gmp_i >= 0) { __gmp_x = (__gmp_xp)[__gmp_i]; __gmp_y = (__gmp_yp)[__gmp_i]; if (__gmp_x != __gmp_y) { (__gmp_result) = (__gmp_x > __gmp_y ? 1 : -1); break; } } } while (0); return __gmp_result; } extern __inline__ __attribute__ ((__gnu_inline__)) int __gmpn_zero_p (mp_srcptr __gmp_p, mp_size_t __gmp_n) noexcept { do { if (__gmp_p[--__gmp_n] != 0) return 0; } while (__gmp_n != 0); return 1; } extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpn_sub (mp_ptr __gmp_wp, mp_srcptr __gmp_xp, mp_size_t __gmp_xsize, mp_srcptr __gmp_yp, mp_size_t __gmp_ysize) { mp_limb_t __gmp_c; do { mp_size_t __gmp_i; mp_limb_t __gmp_x; __gmp_i = (__gmp_ysize); if (__gmp_i != 0) { if (__gmpn_sub_n (__gmp_wp, __gmp_xp, __gmp_yp, __gmp_i)) { do { if (__gmp_i >= (__gmp_xsize)) { (__gmp_c) = 1; goto __gmp_done; } __gmp_x = (__gmp_xp)[__gmp_i]; } while ((((__gmp_wp)[__gmp_i++] = (__gmp_x - 1) & ((~ (static_cast<mp_limb_t> (0))) >> 0)), __gmp_x == 0)); } } if ((__gmp_wp) != (__gmp_xp)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_xsize); __gmp_j++) (__gmp_wp)[__gmp_j] = (__gmp_xp)[__gmp_j]; } while (0); (__gmp_c) = 0; __gmp_done: ; } while (0); return __gmp_c; } extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpn_sub_1 (mp_ptr __gmp_dst, mp_srcptr __gmp_src, mp_size_t __gmp_size, mp_limb_t __gmp_n) noexcept { mp_limb_t __gmp_c; do { mp_size_t __gmp_i; mp_limb_t __gmp_x, __gmp_r; __gmp_x = (__gmp_src)[0]; __gmp_r = __gmp_x - (__gmp_n); (__gmp_dst)[0] = __gmp_r; if (((__gmp_x) < ((__gmp_n)))) { (__gmp_c) = 1; for (__gmp_i = 1; __gmp_i < (__gmp_size);) { __gmp_x = (__gmp_src)[__gmp_i]; __gmp_r = __gmp_x - 1; (__gmp_dst)[__gmp_i] = __gmp_r; ++__gmp_i; if (!((__gmp_x) < (1))) { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (__gmp_i); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; break; } } } else { if ((__gmp_src) != (__gmp_dst)) do { mp_size_t __gmp_j; ; for (__gmp_j = (1); __gmp_j < (__gmp_size); __gmp_j++) (__gmp_dst)[__gmp_j] = (__gmp_src)[__gmp_j]; } while (0); (__gmp_c) = 0; } } while (0); return __gmp_c; } extern __inline__ __attribute__ ((__gnu_inline__)) mp_limb_t __gmpn_neg (mp_ptr __gmp_rp, mp_srcptr __gmp_up, mp_size_t __gmp_n) { while (*__gmp_up == 0) { *__gmp_rp = 0; if (!--__gmp_n) return 0; ++__gmp_up; ++__gmp_rp; } *__gmp_rp = (- *__gmp_up) & ((~ (static_cast<mp_limb_t> (0))) >> 0); if (--__gmp_n) __gmpn_com (++__gmp_rp, ++__gmp_up, __gmp_n); return 1; } } # 2285 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 std::ostream& operator<< (std::ostream &, mpz_srcptr); std::ostream& operator<< (std::ostream &, mpq_srcptr); std::ostream& operator<< (std::ostream &, mpf_srcptr); std::istream& operator>> (std::istream &, mpz_ptr); std::istream& operator>> (std::istream &, mpq_ptr); std::istream& operator>> (std::istream &, mpf_ptr); # 2316 "/usr/include/x86_64-linux-gnu/gmp.h" 3 4 enum { GMP_ERROR_NONE = 0, GMP_ERROR_UNSUPPORTED_ARGUMENT = 1, GMP_ERROR_DIVISION_BY_ZERO = 2, GMP_ERROR_SQRT_OF_NEGATIVE = 4, GMP_ERROR_INVALID_ARGUMENT = 8 }; # 689 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" 1 # 39 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" # 39 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern "C" { # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" 2 # 55 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern void unlock_stream (FILE *); extern void unlock_std_streams (void); extern FILE *fopen_unlocked (const char *, const char *); extern FILE *fdopen_unlocked (int, const char *); extern FILE *freopen_unlocked (const char *, const char *, FILE *); extern char **buildargv (const char *) __attribute__ ((__malloc__)); extern void freeargv (char **); extern char **dupargv (char * const *) __attribute__ ((__malloc__)); extern void expandargv (int *, char ***); extern int writeargv (char * const *, FILE *); extern int countargv (char * const *); # 123 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const char *lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))); extern const char *dos_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))); extern const char *unix_lbasename (const char *) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))); extern char *lrealpath (const char *); extern int is_valid_fd (int fd); extern char *concat (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__)); # 157 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern char *reconcat (char *, const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__)); extern unsigned long concat_length (const char *, ...) __attribute__ ((__sentinel__)); extern char *concat_copy (char *, const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__sentinel__)); extern char *concat_copy2 (const char *, ...) __attribute__ ((__returns_nonnull__)) __attribute__ ((__sentinel__)); extern char *libiberty_concat_ptr; # 193 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern int fdmatch (int fd1, int fd2); # 205 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern char * getpwd (void); # 218 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern long get_run_time (void); extern char *make_relative_prefix (const char *, const char *, const char *) __attribute__ ((__malloc__)); extern char *make_relative_prefix_ignore_links (const char *, const char *, const char *) __attribute__ ((__malloc__)); extern const char *choose_tmpdir (void) __attribute__ ((__returns_nonnull__)); extern char *choose_temp_base (void) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)); extern char *make_temp_file (const char *) __attribute__ ((__malloc__)); extern char *make_temp_file_with_prefix (const char *, const char *) __attribute__ ((__malloc__)); extern int unlink_if_ordinary (const char *); extern const char *spaces (int count); extern int errno_max (void); extern const char *strerrno (int); extern int strtoerrno (const char *); extern char *xstrerror (int) __attribute__ ((__returns_nonnull__)); extern int signo_max (void); # 292 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const char *strsigno (int); extern int strtosigno (const char *); extern int xatexit (void (*fn) (void)); extern void xexit (int status) __attribute__ ((__noreturn__)); extern void xmalloc_set_program_name (const char *); extern void xmalloc_failed (size_t) __attribute__ ((__noreturn__)); extern void *xmalloc (size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1))) __attribute__ ((warn_unused_result)); extern void *xrealloc (void *, size_t) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (2))) __attribute__ ((warn_unused_result)); extern void *xcalloc (size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((alloc_size (1, 2))) __attribute__ ((warn_unused_result)); extern char *xstrdup (const char *) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result)); extern char *xstrndup (const char *, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result)); extern void *xmemdup (const void *, size_t, size_t) __attribute__ ((__malloc__)) __attribute__ ((__returns_nonnull__)) __attribute__ ((warn_unused_result)); extern double physmem_total (void); extern double physmem_available (void); extern unsigned int xcrc32 (const unsigned char *, int, unsigned int); # 391 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const unsigned char _hex_value[256]; extern void hex_init (void); # 428 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern struct pex_obj *pex_init (int flags, const char *pname, const char *tempbase) __attribute__ ((__returns_nonnull__)); # 528 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const char *pex_run (struct pex_obj *obj, int flags, const char *executable, char * const *argv, const char *outname, const char *errname, int *err); # 543 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const char *pex_run_in_environment (struct pex_obj *obj, int flags, const char *executable, char * const *argv, char * const *env, const char *outname, const char *errname, int *err); extern FILE *pex_input_file (struct pex_obj *obj, int flags, const char *in_name); extern FILE *pex_input_pipe (struct pex_obj *obj, int binary); extern FILE *pex_read_output (struct pex_obj *, int binary); extern FILE *pex_read_err (struct pex_obj *, int binary); extern int pex_get_status (struct pex_obj *, int count, int *vector); struct pex_time { unsigned long user_seconds; unsigned long user_microseconds; unsigned long system_seconds; unsigned long system_microseconds; }; extern int pex_get_times (struct pex_obj *, int count, struct pex_time *vector); extern void pex_free (struct pex_obj *); # 618 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern const char *pex_one (int flags, const char *executable, char * const *argv, const char *pname, const char *outname, const char *errname, int *status, int *err); # 637 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern int pexecute (const char *, char * const *, const char *, const char *, char **, char **, int); extern int pwait (int, int *, int); extern void *bsearch_r (const void *, const void *, size_t, size_t, int (*)(const void *, const void *, void *), void *); # 661 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern char *xasprintf (const char *, ...) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 2))) __attribute__ ((__nonnull__ (1))); # 673 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern char *xvasprintf (const char *, va_list) __attribute__ ((__malloc__)) __attribute__ ((__format__ (__printf__, 1, 0))) __attribute__ ((__nonnull__ (1))); # 722 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern void setproctitle (const char *name, ...); extern void stack_limit_increase (unsigned long); # 735 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" extern void *C_alloca (size_t) __attribute__ ((__malloc__)); # 762 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/libiberty.h" } # 693 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 # 763 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" extern void fancy_abort (const char *, int, const char *) __attribute__ ((__noreturn__)) __attribute__ ((__cold__)); # 894 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 963 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1055 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1073 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1091 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1107 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1224 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" 1 # 77 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" typedef long __gcc_host_wide_int__; # 141 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" static inline unsigned long least_bit_hwi (unsigned long x) { return (x & -x); } static inline bool pow2_or_zerop (unsigned long x) { return least_bit_hwi (x) == x; } static inline bool pow2p_hwi (unsigned long x) { return x && pow2_or_zerop (x); } # 184 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" static inline int clz_hwi (unsigned long x) { if (x == 0) return 64; return __builtin_clzl (x); } static inline int ctz_hwi (unsigned long x) { if (x == 0) return 64; return __builtin_ctzl (x); } static inline int ffs_hwi (unsigned long x) { return __builtin_ffsl (x); } static inline int popcount_hwi (unsigned long x) { return __builtin_popcountl (x); } static inline int floor_log2 (unsigned long x) { return 64 - 1 - clz_hwi (x); } static inline int ceil_log2 (unsigned long x) { return x == 0 ? 0 : floor_log2 (x - 1) + 1; } static inline int exact_log2 (unsigned long x) { return pow2p_hwi (x) ? ctz_hwi (x) : -1; } extern long abs_hwi (long); extern unsigned long absu_hwi (long); extern long gcd (long, long); extern long pos_mul_hwi (long, long); extern long mul_hwi (long, long); extern long least_common_multiple (long, long); static inline int ctz_or_zero (unsigned long x) { return ffs_hwi (x) - 1; } static inline long sext_hwi (long src, unsigned int prec) { if (prec == 64) return src; else { ((void)(!(prec < 64) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 291, __FUNCTION__), 0 : 0)); int shift = 64 - prec; return ((long) ((unsigned long) src << shift)) >> shift; } # 304 "/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h" } static inline unsigned long zext_hwi (unsigned long src, unsigned int prec) { if (prec == 64) return src; else { ((void)(!(prec < 64) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 314, __FUNCTION__), 0 : 0)); return src & ((1UL << prec) - 1); } } inline long abs_hwi (long x) { ((void)(!(x != (long) (1UL << (64 - 1))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hwint.h", 324, __FUNCTION__), 0 : 0)); return x >= 0 ? x : -x; } inline unsigned long absu_hwi (long x) { return x >= 0 ? (unsigned long)x : -(unsigned long)x; } # 1225 "/home/giulianob/gcc_git_gnu/gcc/gcc/system.h" 2 typedef int sort_r_cmp_fn (const void *, const void *, void *); void qsort_chk (void *, size_t, size_t, sort_r_cmp_fn *, void *); void gcc_sort_r (void *, size_t, size_t, sort_r_cmp_fn *, void *); void gcc_qsort (void *, size_t, size_t, int (*)(const void *, const void *)); void gcc_stablesort (void *, size_t, size_t, int (*)(const void *, const void *)); # 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 1 # 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" typedef int64_t gcov_type; typedef uint64_t gcov_type_unsigned; struct bitmap_obstack; class bitmap_head; typedef class bitmap_head *bitmap; typedef const class bitmap_head *const_bitmap; struct simple_bitmap_def; typedef struct simple_bitmap_def *sbitmap; typedef const struct simple_bitmap_def *const_sbitmap; struct rtx_def; typedef struct rtx_def *rtx; typedef const struct rtx_def *const_rtx; class scalar_mode; class scalar_int_mode; class scalar_float_mode; class complex_mode; class fixed_size_mode; template<typename> class opt_mode; typedef opt_mode<scalar_mode> opt_scalar_mode; typedef opt_mode<scalar_int_mode> opt_scalar_int_mode; typedef opt_mode<scalar_float_mode> opt_scalar_float_mode; template<typename> struct pod_mode; typedef pod_mode<scalar_mode> scalar_mode_pod; typedef pod_mode<scalar_int_mode> scalar_int_mode_pod; typedef pod_mode<fixed_size_mode> fixed_size_mode_pod; struct rtx_def; struct rtx_expr_list; struct rtx_insn_list; struct rtx_sequence; struct rtx_insn; struct rtx_debug_insn; struct rtx_nonjump_insn; struct rtx_jump_insn; struct rtx_call_insn; struct rtx_jump_table_data; struct rtx_barrier; struct rtx_code_label; struct rtx_note; struct rtvec_def; typedef struct rtvec_def *rtvec; typedef const struct rtvec_def *const_rtvec; struct hwivec_def; typedef struct hwivec_def *hwivec; typedef const struct hwivec_def *const_hwivec; union tree_node; typedef union tree_node *tree; typedef const union tree_node *const_tree; struct gimple; typedef gimple *gimple_seq; struct gimple_stmt_iterator; struct gcond; struct gdebug; struct ggoto; struct glabel; struct gswitch; struct gassign; struct gasm; struct gcall; struct gtransaction; struct greturn; struct gbind; struct gcatch; struct geh_filter; struct geh_mnt; struct geh_else; struct gresx; struct geh_dispatch; struct gphi; struct gtry; struct gomp_atomic_load; struct gomp_atomic_store; struct gomp_continue; struct gomp_critical; struct gomp_ordered; struct gomp_for; struct gomp_parallel; struct gomp_task; struct gomp_sections; struct gomp_single; struct gomp_target; struct gomp_teams; struct symtab_node; struct cgraph_node; struct varpool_node; struct cgraph_edge; union section; typedef union section section; struct gcc_options; struct cl_target_option; struct cl_optimization; struct cl_option; struct cl_decoded_option; struct cl_option_handlers; struct diagnostic_context; class pretty_printer; class diagnostic_event_id_t; template<typename T> struct array_traits; template<typename T, typename Traits = array_traits<T>, bool has_constant_size = Traits::has_constant_size> class bitmap_view; typedef unsigned char addr_space_t; enum ir_type { IR_GIMPLE, IR_RTL_CFGRTL, IR_RTL_CFGLAYOUT }; struct cpp_reader; struct cpp_token; enum tls_model { TLS_MODEL_NONE, TLS_MODEL_EMULATED, TLS_MODEL_REAL, TLS_MODEL_GLOBAL_DYNAMIC = TLS_MODEL_REAL, TLS_MODEL_LOCAL_DYNAMIC, TLS_MODEL_INITIAL_EXEC, TLS_MODEL_LOCAL_EXEC }; enum offload_abi { OFFLOAD_ABI_UNSET, OFFLOAD_ABI_LP64, OFFLOAD_ABI_ILP32 }; enum profile_update { PROFILE_UPDATE_SINGLE, PROFILE_UPDATE_ATOMIC, PROFILE_UPDATE_PREFER_ATOMIC }; enum profile_reproducibility { PROFILE_REPRODUCIBILITY_SERIAL, PROFILE_REPRODUCIBILITY_PARALLEL_RUNS, PROFILE_REPRODUCIBILITY_MULTITHREADED }; enum unwind_info_type { UI_NONE, UI_SJLJ, UI_DWARF2, UI_TARGET, UI_SEH }; enum node_frequency { NODE_FREQUENCY_UNLIKELY_EXECUTED, NODE_FREQUENCY_EXECUTED_ONCE, NODE_FREQUENCY_NORMAL, NODE_FREQUENCY_HOT }; enum optimization_type { OPTIMIZE_FOR_SPEED, OPTIMIZE_FOR_BOTH, OPTIMIZE_FOR_SIZE }; enum pad_direction { PAD_NONE, PAD_UPWARD, PAD_DOWNWARD }; enum var_init_status { VAR_INIT_STATUS_UNKNOWN, VAR_INIT_STATUS_UNINITIALIZED, VAR_INIT_STATUS_INITIALIZED }; enum warn_strict_overflow_code { WARN_STRICT_OVERFLOW_ALL = 1, WARN_STRICT_OVERFLOW_CONDITIONAL = 2, WARN_STRICT_OVERFLOW_COMPARISON = 3, WARN_STRICT_OVERFLOW_MISC = 4, WARN_STRICT_OVERFLOW_MAGNITUDE = 5 }; typedef int alias_set_type; class edge_def; typedef class edge_def *edge; typedef const class edge_def *const_edge; struct basic_block_def; typedef struct basic_block_def *basic_block; typedef const struct basic_block_def *const_basic_block; # 343 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" typedef int reg_class_t; class rtl_opt_pass; namespace gcc { class context; } typedef std::pair <tree, tree> tree_pair; typedef std::pair <const char *, int> string_int_pair; template <typename ValueType> struct kv_pair { const char *const name; const ValueType value; }; template<typename T> struct iterator_range { public: iterator_range (const T &begin, const T &end) : m_begin (begin), m_end (end) {} T begin () const { return m_begin; } T end () const { return m_end; } private: T m_begin; T m_end; }; # 402 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" enum function_class { function_c94, function_c99_misc, function_c99_math_complex, function_sincos, function_c11_misc, function_c2x_misc }; enum symbol_visibility { VISIBILITY_DEFAULT, VISIBILITY_PROTECTED, VISIBILITY_HIDDEN, VISIBILITY_INTERNAL }; enum flt_eval_method { FLT_EVAL_METHOD_UNPREDICTABLE = -1, FLT_EVAL_METHOD_PROMOTE_TO_FLOAT = 0, FLT_EVAL_METHOD_PROMOTE_TO_DOUBLE = 1, FLT_EVAL_METHOD_PROMOTE_TO_LONG_DOUBLE = 2, FLT_EVAL_METHOD_PROMOTE_TO_FLOAT16 = 16 }; enum excess_precision_type { EXCESS_PRECISION_TYPE_IMPLICIT, EXCESS_PRECISION_TYPE_STANDARD, EXCESS_PRECISION_TYPE_FAST }; typedef void (*gt_pointer_operator) (void *, void *); typedef unsigned char uchar; # 1 "./insn-modes.h" 1 enum machine_mode { E_VOIDmode, E_BLKmode, E_CCmode, E_CCGCmode, E_CCGOCmode, E_CCNOmode, E_CCGZmode, E_CCAmode, E_CCCmode, E_CCOmode, E_CCPmode, E_CCSmode, E_CCZmode, E_CCFPmode, E_BImode, E_QImode, E_HImode, E_SImode, E_DImode, E_TImode, E_OImode, E_XImode, E_P2QImode, E_P2HImode, E_POImode, E_QQmode, E_HQmode, E_SQmode, E_DQmode, E_TQmode, E_UQQmode, E_UHQmode, E_USQmode, E_UDQmode, E_UTQmode, E_HAmode, E_SAmode, E_DAmode, E_TAmode, E_UHAmode, E_USAmode, E_UDAmode, E_UTAmode, E_SFmode, E_DFmode, E_XFmode, E_TFmode, E_SDmode, E_DDmode, E_TDmode, E_CQImode, E_CP2QImode, E_CHImode, E_CP2HImode, E_CSImode, E_CDImode, E_CTImode, E_CPOImode, E_COImode, E_CXImode, E_SCmode, E_DCmode, E_XCmode, E_TCmode, E_V2QImode, E_V4QImode, E_V2HImode, E_V1SImode, E_V8QImode, E_V4HImode, E_V2SImode, E_V1DImode, E_V12QImode, E_V6HImode, E_V14QImode, E_V16QImode, E_V8HImode, E_V4SImode, E_V2DImode, E_V1TImode, E_V32QImode, E_V16HImode, E_V8SImode, E_V4DImode, E_V2TImode, E_V64QImode, E_V32HImode, E_V16SImode, E_V8DImode, E_V4TImode, E_V128QImode, E_V64HImode, E_V32SImode, E_V16DImode, E_V8TImode, E_V64SImode, E_V2SFmode, E_V4SFmode, E_V2DFmode, E_V8SFmode, E_V4DFmode, E_V2TFmode, E_V16SFmode, E_V8DFmode, E_V4TFmode, E_V32SFmode, E_V16DFmode, E_V8TFmode, E_V64SFmode, E_V32DFmode, E_V16TFmode, MAX_MACHINE_MODE, MIN_MODE_RANDOM = E_VOIDmode, MAX_MODE_RANDOM = E_BLKmode, MIN_MODE_CC = E_CCmode, MAX_MODE_CC = E_CCFPmode, MIN_MODE_INT = E_QImode, MAX_MODE_INT = E_XImode, MIN_MODE_PARTIAL_INT = E_P2QImode, MAX_MODE_PARTIAL_INT = E_POImode, MIN_MODE_FRACT = E_QQmode, MAX_MODE_FRACT = E_TQmode, MIN_MODE_UFRACT = E_UQQmode, MAX_MODE_UFRACT = E_UTQmode, MIN_MODE_ACCUM = E_HAmode, MAX_MODE_ACCUM = E_TAmode, MIN_MODE_UACCUM = E_UHAmode, MAX_MODE_UACCUM = E_UTAmode, MIN_MODE_FLOAT = E_SFmode, MAX_MODE_FLOAT = E_TFmode, MIN_MODE_DECIMAL_FLOAT = E_SDmode, MAX_MODE_DECIMAL_FLOAT = E_TDmode, MIN_MODE_COMPLEX_INT = E_CQImode, MAX_MODE_COMPLEX_INT = E_CXImode, MIN_MODE_COMPLEX_FLOAT = E_SCmode, MAX_MODE_COMPLEX_FLOAT = E_TCmode, MIN_MODE_VECTOR_BOOL = E_VOIDmode, MAX_MODE_VECTOR_BOOL = E_VOIDmode, MIN_MODE_VECTOR_INT = E_V2QImode, MAX_MODE_VECTOR_INT = E_V64SImode, MIN_MODE_VECTOR_FRACT = E_VOIDmode, MAX_MODE_VECTOR_FRACT = E_VOIDmode, MIN_MODE_VECTOR_UFRACT = E_VOIDmode, MAX_MODE_VECTOR_UFRACT = E_VOIDmode, MIN_MODE_VECTOR_ACCUM = E_VOIDmode, MAX_MODE_VECTOR_ACCUM = E_VOIDmode, MIN_MODE_VECTOR_UACCUM = E_VOIDmode, MAX_MODE_VECTOR_UACCUM = E_VOIDmode, MIN_MODE_VECTOR_FLOAT = E_V2SFmode, MAX_MODE_VECTOR_FLOAT = E_V16TFmode, NUM_MACHINE_MODES = MAX_MACHINE_MODE }; # 450 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/signop.h" 1 # 28 "/home/giulianob/gcc_git_gnu/gcc/gcc/signop.h" enum signop { SIGNED, UNSIGNED }; # 451 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 1 # 314 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename T> class generic_wide_int; template <int N> class fixed_wide_int_storage; class wide_int_storage; typedef generic_wide_int <wide_int_storage> wide_int; typedef generic_wide_int < fixed_wide_int_storage <((64 + 4 + 64 - 1) & ~(64 - 1))> > offset_int; typedef generic_wide_int < fixed_wide_int_storage <(((160 + 64) / 64) * 64)> > widest_int; typedef generic_wide_int < fixed_wide_int_storage <(((160 + 64) / 64) * 64) * 2> > widest2_int; template <bool SE, bool HDP = true> class wide_int_ref_storage; typedef generic_wide_int <wide_int_ref_storage <false> > wide_int_ref; # 348 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" namespace wi { # 358 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" enum overflow_type { OVF_NONE = 0, OVF_UNDERFLOW = -1, OVF_OVERFLOW = 1, OVF_UNKNOWN = 2 }; enum precision_type { FLEXIBLE_PRECISION, VAR_PRECISION, CONST_PRECISION }; # 403 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename T> struct int_traits; template <typename T1, typename T2, enum precision_type P1 = int_traits <T1>::precision_type, enum precision_type P2 = int_traits <T2>::precision_type> struct binary_traits; template <typename T1, typename T2> struct binary_traits <T1, T2, FLEXIBLE_PRECISION, FLEXIBLE_PRECISION> { typedef widest_int result_type; }; template <typename T1, typename T2> struct binary_traits <T1, T2, FLEXIBLE_PRECISION, VAR_PRECISION> { typedef wide_int result_type; typedef result_type operator_result; typedef bool predicate_result; }; template <typename T1, typename T2> struct binary_traits <T1, T2, FLEXIBLE_PRECISION, CONST_PRECISION> { typedef generic_wide_int < fixed_wide_int_storage <int_traits <T2>::precision> > result_type; typedef result_type operator_result; typedef bool predicate_result; typedef result_type signed_shift_result_type; typedef bool signed_predicate_result; }; template <typename T1, typename T2> struct binary_traits <T1, T2, VAR_PRECISION, FLEXIBLE_PRECISION> { typedef wide_int result_type; typedef result_type operator_result; typedef bool predicate_result; }; template <typename T1, typename T2> struct binary_traits <T1, T2, CONST_PRECISION, FLEXIBLE_PRECISION> { typedef generic_wide_int < fixed_wide_int_storage <int_traits <T1>::precision> > result_type; typedef result_type operator_result; typedef bool predicate_result; typedef result_type signed_shift_result_type; typedef bool signed_predicate_result; }; template <typename T1, typename T2> struct binary_traits <T1, T2, CONST_PRECISION, CONST_PRECISION> { static_assert ((int_traits <T1>::precision == int_traits <T2>::precision), "int_traits <T1>::precision == int_traits <T2>::precision"); typedef generic_wide_int < fixed_wide_int_storage <int_traits <T1>::precision> > result_type; typedef result_type operator_result; typedef bool predicate_result; typedef result_type signed_shift_result_type; typedef bool signed_predicate_result; }; template <typename T1, typename T2> struct binary_traits <T1, T2, VAR_PRECISION, VAR_PRECISION> { typedef wide_int result_type; typedef result_type operator_result; typedef bool predicate_result; }; } namespace wi { template <typename T> unsigned int get_precision (const T &); template <typename T1, typename T2> unsigned int get_binary_precision (const T1 &, const T2 &); template <typename T1, typename T2> void copy (T1 &, const T2 &); # 512 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename T> bool fits_shwi_p (const T &); template <typename T> bool fits_uhwi_p (const T &); template <typename T> bool neg_p (const T &, signop = SIGNED); template <typename T> long sign_mask (const T &); template <typename T1, typename T2> bool eq_p (const T1 &, const T2 &); template <typename T1, typename T2> bool ne_p (const T1 &, const T2 &); template <typename T1, typename T2> bool lt_p (const T1 &, const T2 &, signop); template <typename T1, typename T2> bool lts_p (const T1 &, const T2 &); template <typename T1, typename T2> bool ltu_p (const T1 &, const T2 &); template <typename T1, typename T2> bool le_p (const T1 &, const T2 &, signop); template <typename T1, typename T2> bool les_p (const T1 &, const T2 &); template <typename T1, typename T2> bool leu_p (const T1 &, const T2 &); template <typename T1, typename T2> bool gt_p (const T1 &, const T2 &, signop); template <typename T1, typename T2> bool gts_p (const T1 &, const T2 &); template <typename T1, typename T2> bool gtu_p (const T1 &, const T2 &); template <typename T1, typename T2> bool ge_p (const T1 &, const T2 &, signop); template <typename T1, typename T2> bool ges_p (const T1 &, const T2 &); template <typename T1, typename T2> bool geu_p (const T1 &, const T2 &); template <typename T1, typename T2> int cmp (const T1 &, const T2 &, signop); template <typename T1, typename T2> int cmps (const T1 &, const T2 &); template <typename T1, typename T2> int cmpu (const T1 &, const T2 &); template <typename T> typename wi::binary_traits <T, T>::result_type bit_not (const T &); template <typename T> typename wi::binary_traits <T, T>::result_type neg (const T &); template <typename T> typename wi::binary_traits <T, T>::result_type neg (const T &, overflow_type *); template <typename T> typename wi::binary_traits <T, T>::result_type abs (const T &); template <typename T> typename wi::binary_traits <T, T>::result_type ext (const T &, unsigned int, signop); template <typename T> typename wi::binary_traits <T, T>::result_type sext (const T &, unsigned int); template <typename T> typename wi::binary_traits <T, T>::result_type zext (const T &, unsigned int); template <typename T> typename wi::binary_traits <T, T>::result_type set_bit (const T &, unsigned int); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type min (const T1 &, const T2 &, signop); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smin (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umin (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type max (const T1 &, const T2 &, signop); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smax (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umax (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_and (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_and_not (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_or (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_or_not (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type bit_xor (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type add (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type add (const T1 &, const T2 &, signop, overflow_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sub (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sub (const T1 &, const T2 &, signop, overflow_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul (const T1 &, const T2 &, signop, overflow_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smul (const T1 &, const T2 &, overflow_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umul (const T1 &, const T2 &, overflow_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mul_high (const T1 &, const T2 &, signop); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_trunc (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sdiv_trunc (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_trunc (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_floor (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_floor (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type sdiv_floor (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_ceil (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type udiv_ceil (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type div_round (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type divmod_trunc (const T1 &, const T2 &, signop, typename wi::binary_traits <T1, T2>::result_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type gcd (const T1 &, const T2 &, signop = UNSIGNED); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_trunc (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type smod_trunc (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umod_trunc (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_floor (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type umod_floor (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_ceil (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T2>::result_type mod_round (const T1 &, const T2 &, signop, overflow_type * = 0); template <typename T1, typename T2> bool multiple_of_p (const T1 &, const T2 &, signop); template <typename T1, typename T2> bool multiple_of_p (const T1 &, const T2 &, signop, typename wi::binary_traits <T1, T2>::result_type *); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lshift (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lrshift (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type arshift (const T1 &, const T2 &); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type rshift (const T1 &, const T2 &, signop sgn); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type lrotate (const T1 &, const T2 &, unsigned int = 0); template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type rrotate (const T1 &, const T2 &, unsigned int = 0); bool only_sign_bit_p (const wide_int_ref &, unsigned int); bool only_sign_bit_p (const wide_int_ref &); int clz (const wide_int_ref &); int clrsb (const wide_int_ref &); int ctz (const wide_int_ref &); int exact_log2 (const wide_int_ref &); int floor_log2 (const wide_int_ref &); int ffs (const wide_int_ref &); int popcount (const wide_int_ref &); int parity (const wide_int_ref &); template <typename T> unsigned long extract_uhwi (const T &, unsigned int, unsigned int); template <typename T> unsigned int min_precision (const T &, signop); static inline void accumulate_overflow (overflow_type &, overflow_type); } namespace wi { class storage_ref { public: storage_ref () {} storage_ref (const long *, unsigned int, unsigned int); const long *val; unsigned int len; unsigned int precision; unsigned int get_len () const; unsigned int get_precision () const; const long *get_val () const; }; } inline::wi::storage_ref::storage_ref (const long *val_in, unsigned int len_in, unsigned int precision_in) : val (val_in), len (len_in), precision (precision_in) { } inline unsigned int wi::storage_ref::get_len () const { return len; } inline unsigned int wi::storage_ref::get_precision () const { return precision; } inline const long * wi::storage_ref::get_val () const { return val; } # 711 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename storage> class generic_wide_int : public storage { public: generic_wide_int (); template <typename T> generic_wide_int (const T &); template <typename T> generic_wide_int (const T &, unsigned int); long to_shwi (unsigned int) const; long to_shwi () const; unsigned long to_uhwi (unsigned int) const; unsigned long to_uhwi () const; long to_short_addr () const; long sign_mask () const; long elt (unsigned int) const; long sext_elt (unsigned int) const; unsigned long ulow () const; unsigned long uhigh () const; long slow () const; long shigh () const; template <typename T> generic_wide_int &operator = (const T &); # 754 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename T> generic_wide_int &operator &= (const T &c) { return (*this = wi::bit_and (*this, c)); } template <typename T> generic_wide_int &operator |= (const T &c) { return (*this = wi::bit_or (*this, c)); } template <typename T> generic_wide_int &operator ^= (const T &c) { return (*this = wi::bit_xor (*this, c)); } template <typename T> generic_wide_int &operator += (const T &c) { return (*this = wi::add (*this, c)); } template <typename T> generic_wide_int &operator -= (const T &c) { return (*this = wi::sub (*this, c)); } template <typename T> generic_wide_int &operator *= (const T &c) { return (*this = wi::mul (*this, c)); } template <typename T> generic_wide_int &operator <<= (const T &c) { return (*this = wi::lshift (*this, c)); } template <typename T> generic_wide_int &operator >>= (const T &c) { return (*this = *this >> c); } generic_wide_int &operator ++ () { *this += 1; return *this; } generic_wide_int &operator -- () { *this += -1; return *this; } void dump () const; static const bool is_sign_extended = wi::int_traits <generic_wide_int <storage> >::is_sign_extended; }; template <typename storage> inline generic_wide_int <storage>::generic_wide_int () {} template <typename storage> template <typename T> inline generic_wide_int <storage>::generic_wide_int (const T &x) : storage (x) { } template <typename storage> template <typename T> inline generic_wide_int <storage>::generic_wide_int (const T &x, unsigned int precision) : storage (x, precision) { } template <typename storage> inline long generic_wide_int <storage>::to_shwi (unsigned int precision) const { if (precision < 64) return sext_hwi (this->get_val ()[0], precision); else return this->get_val ()[0]; } template <typename storage> inline long generic_wide_int <storage>::to_shwi () const { if (is_sign_extended) return this->get_val ()[0]; else return to_shwi (this->get_precision ()); } template <typename storage> inline unsigned long generic_wide_int <storage>::to_uhwi (unsigned int precision) const { if (precision < 64) return zext_hwi (this->get_val ()[0], precision); else return this->get_val ()[0]; } template <typename storage> inline unsigned long generic_wide_int <storage>::to_uhwi () const { return to_uhwi (this->get_precision ()); } template <typename storage> inline long generic_wide_int <storage>::to_short_addr () const { return this->get_val ()[0]; } template <typename storage> inline long generic_wide_int <storage>::sign_mask () const { unsigned int len = this->get_len (); ((void)(!(len > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 855, __FUNCTION__), 0 : 0)); unsigned long high = this->get_val ()[len - 1]; if (!is_sign_extended) { unsigned int precision = this->get_precision (); int excess = len * 64 - precision; if (excess > 0) high <<= excess; } return (long) (high) < 0 ? -1 : 0; } template <typename storage> inline long generic_wide_int <storage>::slow () const { return this->get_val ()[0]; } template <typename storage> inline long generic_wide_int <storage>::shigh () const { return this->get_val ()[this->get_len () - 1]; } template <typename storage> inline unsigned long generic_wide_int <storage>::ulow () const { return this->get_val ()[0]; } template <typename storage> inline unsigned long generic_wide_int <storage>::uhigh () const { return this->get_val ()[this->get_len () - 1]; } template <typename storage> inline long generic_wide_int <storage>::elt (unsigned int i) const { if (i >= this->get_len ()) return sign_mask (); else return this->get_val ()[i]; } template <typename storage> inline long generic_wide_int <storage>::sext_elt (unsigned int i) const { long elt_i = elt (i); if (!is_sign_extended) { unsigned int precision = this->get_precision (); unsigned int lsb = i * 64; if (precision - lsb < 64) elt_i = sext_hwi (elt_i, precision - lsb); } return elt_i; } template <typename storage> template <typename T> inline generic_wide_int <storage> & generic_wide_int <storage>::operator = (const T &x) { storage::operator = (x); return *this; } template <typename storage> void generic_wide_int <storage>::dump () const { unsigned int len = this->get_len (); const long *val = this->get_val (); unsigned int precision = this->get_precision (); fprintf ( # 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 stderr # 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" , "["); if (len * 64 < precision) fprintf ( # 951 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 stderr # 951 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" , "...,"); for (unsigned int i = 0; i < len - 1; ++i) fprintf ( # 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 stderr # 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" , "%#" # 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 "l" "x" # 953 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" ",", val[len - 1 - i]); fprintf ( # 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 stderr # 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" , "%#" # 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" 3 4 "l" "x" # 954 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" "], precision = %d\n", val[0], precision); } namespace wi { template <typename storage> struct int_traits < generic_wide_int <storage> > : public wi::int_traits <storage> { static unsigned int get_precision (const generic_wide_int <storage> &); static wi::storage_ref decompose (long *, unsigned int, const generic_wide_int <storage> &); }; } template <typename storage> inline unsigned int wi::int_traits < generic_wide_int <storage> >:: get_precision (const generic_wide_int <storage> &x) { return x.get_precision (); } template <typename storage> inline wi::storage_ref wi::int_traits < generic_wide_int <storage> >:: decompose (long *, unsigned int precision, const generic_wide_int <storage> &x) { ((void)(!(precision == x.get_precision ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 984, __FUNCTION__), 0 : 0)); return wi::storage_ref (x.get_val (), x.get_len (), precision); } template <bool SE, bool HDP> class wide_int_ref_storage : public wi::storage_ref { private: long scratch[2]; public: wide_int_ref_storage () {} wide_int_ref_storage (const wi::storage_ref &); template <typename T> wide_int_ref_storage (const T &); template <typename T> wide_int_ref_storage (const T &, unsigned int); }; template <bool SE, bool HDP> inline wide_int_ref_storage <SE, HDP>:: wide_int_ref_storage (const wi::storage_ref &x) : storage_ref (x) {} template <bool SE, bool HDP> template <typename T> inline wide_int_ref_storage <SE, HDP>::wide_int_ref_storage (const T &x) : storage_ref (wi::int_traits <T>::decompose (scratch, wi::get_precision (x), x)) { } template <bool SE, bool HDP> template <typename T> inline wide_int_ref_storage <SE, HDP>:: wide_int_ref_storage (const T &x, unsigned int precision) : storage_ref (wi::int_traits <T>::decompose (scratch, precision, x)) { } namespace wi { template <bool SE, bool HDP> struct int_traits <wide_int_ref_storage <SE, HDP> > { static const enum precision_type precision_type = VAR_PRECISION; static const bool host_dependent_precision = HDP; static const bool is_sign_extended = SE; }; } namespace wi { unsigned int force_to_size (long *, const long *, unsigned int, unsigned int, unsigned int, signop sgn); unsigned int from_array (long *, const long *, unsigned int, unsigned int, bool = true); } class wide_int_storage { private: long val[((160 + 64) / 64)]; unsigned int len; unsigned int precision; public: wide_int_storage (); template <typename T> wide_int_storage (const T &); unsigned int get_precision () const; const long *get_val () const; unsigned int get_len () const; long *write_val (); void set_len (unsigned int, bool = false); template <typename T> wide_int_storage &operator = (const T &); static wide_int from (const wide_int_ref &, unsigned int, signop); static wide_int from_array (const long *, unsigned int, unsigned int, bool = true); static wide_int create (unsigned int); wide_int bswap () const; }; namespace wi { template <> struct int_traits <wide_int_storage> { static const enum precision_type precision_type = VAR_PRECISION; static const bool host_dependent_precision = false; static const bool is_sign_extended = true; template <typename T1, typename T2> static wide_int get_binary_result (const T1 &, const T2 &); }; } inline wide_int_storage::wide_int_storage () {} template <typename T> inline wide_int_storage::wide_int_storage (const T &x) { { static_assert ((!wi::int_traits<T>::host_dependent_precision), "!wi::int_traits<T>::host_dependent_precision"); } { static_assert ((wi::int_traits<T>::precision_type != wi::CONST_PRECISION), "wi::int_traits<T>::precision_type != wi::CONST_PRECISION"); } generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); precision = xi.precision; wi::copy (*this, xi); } template <typename T> inline wide_int_storage& wide_int_storage::operator = (const T &x) { { static_assert ((!wi::int_traits<T>::host_dependent_precision), "!wi::int_traits<T>::host_dependent_precision"); } { static_assert ((wi::int_traits<T>::precision_type != wi::CONST_PRECISION), "wi::int_traits<T>::precision_type != wi::CONST_PRECISION"); } generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); precision = xi.precision; wi::copy (*this, xi); return *this; } inline unsigned int wide_int_storage::get_precision () const { return precision; } inline const long * wide_int_storage::get_val () const { return val; } inline unsigned int wide_int_storage::get_len () const { return len; } inline long * wide_int_storage::write_val () { return val; } inline void wide_int_storage::set_len (unsigned int l, bool is_sign_extended) { len = l; if (!is_sign_extended && len * 64 > precision) val[len - 1] = sext_hwi (val[len - 1], precision % 64); } inline wide_int wide_int_storage::from (const wide_int_ref &x, unsigned int precision, signop sgn) { wide_int result = wide_int::create (precision); result.set_len (wi::force_to_size (result.write_val (), x.val, x.len, x.precision, precision, sgn)); return result; } inline wide_int wide_int_storage::from_array (const long *val, unsigned int len, unsigned int precision, bool need_canon_p) { wide_int result = wide_int::create (precision); result.set_len (wi::from_array (result.write_val (), val, len, precision, need_canon_p)); return result; } inline wide_int wide_int_storage::create (unsigned int precision) { wide_int x; x.precision = precision; return x; } template <typename T1, typename T2> inline wide_int wi::int_traits <wide_int_storage>::get_binary_result (const T1 &x, const T2 &y) { static_assert ((wi::int_traits <T1>::precision_type != FLEXIBLE_PRECISION || wi::int_traits <T2>::precision_type != FLEXIBLE_PRECISION), "wi::int_traits <T1>::precision_type != FLEXIBLE_PRECISION || wi::int_traits <T2>::precision_type != FLEXIBLE_PRECISION") ; if (wi::int_traits <T1>::precision_type == FLEXIBLE_PRECISION) return wide_int::create (wi::get_precision (y)); else return wide_int::create (wi::get_precision (x)); } template <int N> class fixed_wide_int_storage { private: long val[(N + 64 + 1) / 64]; unsigned int len; public: fixed_wide_int_storage (); template <typename T> fixed_wide_int_storage (const T &); unsigned int get_precision () const; const long *get_val () const; unsigned int get_len () const; long *write_val (); void set_len (unsigned int, bool = false); static generic_wide_int < fixed_wide_int_storage <N> > from (const wide_int_ref &, signop); static generic_wide_int < fixed_wide_int_storage <N> > from_array (const long *, unsigned int, bool = true); }; namespace wi { template <int N> struct int_traits < fixed_wide_int_storage <N> > { static const enum precision_type precision_type = CONST_PRECISION; static const bool host_dependent_precision = false; static const bool is_sign_extended = true; static const unsigned int precision = N; template <typename T1, typename T2> static generic_wide_int < fixed_wide_int_storage <N> > get_binary_result (const T1 &, const T2 &); }; } template <int N> inline fixed_wide_int_storage <N>::fixed_wide_int_storage () {} template <int N> template <typename T> inline fixed_wide_int_storage <N>::fixed_wide_int_storage (const T &x) { typename wi::binary_traits <T, generic_wide_int < fixed_wide_int_storage <N> > >::result_type *assertion __attribute__ ((__unused__)); wi::copy (*this, generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > (x, N)); } template <int N> inline unsigned int fixed_wide_int_storage <N>::get_precision () const { return N; } template <int N> inline const long * fixed_wide_int_storage <N>::get_val () const { return val; } template <int N> inline unsigned int fixed_wide_int_storage <N>::get_len () const { return len; } template <int N> inline long * fixed_wide_int_storage <N>::write_val () { return val; } template <int N> inline void fixed_wide_int_storage <N>::set_len (unsigned int l, bool) { len = l; static_assert ((N % 64 == 0), "N % HOST_BITS_PER_WIDE_INT == 0"); } template <int N> inline generic_wide_int < fixed_wide_int_storage <N> > fixed_wide_int_storage <N>::from (const wide_int_ref &x, signop sgn) { generic_wide_int < fixed_wide_int_storage <N> > result; result.set_len (wi::force_to_size (result.write_val (), x.val, x.len, x.precision, N, sgn)); return result; } template <int N> inline generic_wide_int < fixed_wide_int_storage <N> > fixed_wide_int_storage <N>::from_array (const long *val, unsigned int len, bool need_canon_p) { generic_wide_int < fixed_wide_int_storage <N> > result; result.set_len (wi::from_array (result.write_val (), val, len, N, need_canon_p)); return result; } template <int N> template <typename T1, typename T2> inline generic_wide_int < fixed_wide_int_storage <N> > wi::int_traits < fixed_wide_int_storage <N> >:: get_binary_result (const T1 &, const T2 &) { return generic_wide_int < fixed_wide_int_storage <N> > (); } class trailing_wide_int_storage { private: unsigned int m_precision; unsigned char *m_len; long *m_val; public: trailing_wide_int_storage (unsigned int, unsigned char *, long *); unsigned int get_len () const; unsigned int get_precision () const; const long *get_val () const; long *write_val (); void set_len (unsigned int, bool = false); template <typename T> trailing_wide_int_storage &operator = (const T &); }; typedef generic_wide_int <trailing_wide_int_storage> trailing_wide_int; namespace wi { template <> struct int_traits <trailing_wide_int_storage> : public int_traits <wide_int_storage> {}; } template <int N> struct trailing_wide_ints { private: unsigned short m_precision; unsigned char m_max_len; unsigned char m_len[N]; long m_val[1]; public: typedef generic_wide_int <wide_int_ref_storage <wi::int_traits <trailing_wide_int_storage>::is_sign_extended, wi::int_traits <trailing_wide_int_storage>::host_dependent_precision> > const_reference; void set_precision (unsigned int); unsigned int get_precision () const { return m_precision; } trailing_wide_int operator [] (unsigned int); const_reference operator [] (unsigned int) const; static size_t extra_size (unsigned int); size_t extra_size () const { return extra_size (m_precision); } }; inline trailing_wide_int_storage:: trailing_wide_int_storage (unsigned int precision, unsigned char *len, long *val) : m_precision (precision), m_len (len), m_val (val) { } inline unsigned int trailing_wide_int_storage::get_len () const { return *m_len; } inline unsigned int trailing_wide_int_storage::get_precision () const { return m_precision; } inline const long * trailing_wide_int_storage::get_val () const { return m_val; } inline long * trailing_wide_int_storage::write_val () { return m_val; } inline void trailing_wide_int_storage::set_len (unsigned int len, bool is_sign_extended) { *m_len = len; if (!is_sign_extended && len * 64 > m_precision) m_val[len - 1] = sext_hwi (m_val[len - 1], m_precision % 64); } template <typename T> inline trailing_wide_int_storage & trailing_wide_int_storage::operator = (const T &x) { generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, m_precision); wi::copy (*this, xi); return *this; } template <int N> inline void trailing_wide_ints <N>::set_precision (unsigned int precision) { m_precision = precision; m_max_len = ((precision + 64 - 1) / 64); } template <int N> inline trailing_wide_int trailing_wide_ints <N>::operator [] (unsigned int index) { return trailing_wide_int_storage (m_precision, &m_len[index], &m_val[index * m_max_len]); } template <int N> inline typename trailing_wide_ints <N>::const_reference trailing_wide_ints <N>::operator [] (unsigned int index) const { return wi::storage_ref (&m_val[index * m_max_len], m_len[index], m_precision); } template <int N> inline size_t trailing_wide_ints <N>::extra_size (unsigned int precision) { unsigned int max_len = ((precision + 64 - 1) / 64); return (N * max_len - 1) * sizeof (long); } # 1503 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" namespace wi { template <typename T, bool signed_p> struct primitive_int_traits { static const enum precision_type precision_type = FLEXIBLE_PRECISION; static const bool host_dependent_precision = true; static const bool is_sign_extended = true; static unsigned int get_precision (T); static wi::storage_ref decompose (long *, unsigned int, T); }; } template <typename T, bool signed_p> inline unsigned int wi::primitive_int_traits <T, signed_p>::get_precision (T) { return sizeof (T) * 8; } template <typename T, bool signed_p> inline wi::storage_ref wi::primitive_int_traits <T, signed_p>::decompose (long *scratch, unsigned int precision, T x) { scratch[0] = x; if (signed_p || scratch[0] >= 0 || precision <= 64) return wi::storage_ref (scratch, 1, precision); scratch[1] = 0; return wi::storage_ref (scratch, 2, precision); } namespace wi { template <> struct int_traits <unsigned char> : public primitive_int_traits <unsigned char, false> {}; template <> struct int_traits <unsigned short> : public primitive_int_traits <unsigned short, false> {}; template <> struct int_traits <int> : public primitive_int_traits <int, true> {}; template <> struct int_traits <unsigned int> : public primitive_int_traits <unsigned int, false> {}; template <> struct int_traits <long> : public primitive_int_traits <long, true> {}; template <> struct int_traits <unsigned long> : public primitive_int_traits <unsigned long, false> {}; template <> struct int_traits <long long> : public primitive_int_traits <long long, true> {}; template <> struct int_traits <unsigned long long> : public primitive_int_traits <unsigned long long, false> {}; } namespace wi { class hwi_with_prec { public: hwi_with_prec () {} hwi_with_prec (long, unsigned int, signop); long val; unsigned int precision; signop sgn; }; hwi_with_prec shwi (long, unsigned int); hwi_with_prec uhwi (unsigned long, unsigned int); hwi_with_prec minus_one (unsigned int); hwi_with_prec zero (unsigned int); hwi_with_prec one (unsigned int); hwi_with_prec two (unsigned int); } inline wi::hwi_with_prec::hwi_with_prec (long v, unsigned int p, signop s) : precision (p), sgn (s) { if (precision < 64) val = sext_hwi (v, precision); else val = v; } inline wi::hwi_with_prec wi::shwi (long val, unsigned int precision) { return hwi_with_prec (val, precision, SIGNED); } inline wi::hwi_with_prec wi::uhwi (unsigned long val, unsigned int precision) { return hwi_with_prec (val, precision, UNSIGNED); } inline wi::hwi_with_prec wi::minus_one (unsigned int precision) { return wi::shwi (-1, precision); } inline wi::hwi_with_prec wi::zero (unsigned int precision) { return wi::shwi (0, precision); } inline wi::hwi_with_prec wi::one (unsigned int precision) { return wi::shwi (1, precision); } inline wi::hwi_with_prec wi::two (unsigned int precision) { return wi::shwi (2, precision); } namespace wi { template<typename T, precision_type = int_traits<T>::precision_type> struct ints_for { static int zero (const T &) { return 0; } }; template<typename T> struct ints_for<T, VAR_PRECISION> { static hwi_with_prec zero (const T &); }; } template<typename T> inline wi::hwi_with_prec wi::ints_for<T, wi::VAR_PRECISION>::zero (const T &x) { return wi::zero (wi::get_precision (x)); } namespace wi { template <> struct int_traits <wi::hwi_with_prec> { static const enum precision_type precision_type = VAR_PRECISION; static const bool host_dependent_precision = false; static const bool is_sign_extended = true; static unsigned int get_precision (const wi::hwi_with_prec &); static wi::storage_ref decompose (long *, unsigned int, const wi::hwi_with_prec &); }; } inline unsigned int wi::int_traits <wi::hwi_with_prec>::get_precision (const wi::hwi_with_prec &x) { return x.precision; } inline wi::storage_ref wi::int_traits <wi::hwi_with_prec>:: decompose (long *scratch, unsigned int precision, const wi::hwi_with_prec &x) { ((void)(!(precision == x.precision) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h", 1700, __FUNCTION__), 0 : 0)); scratch[0] = x.val; if (x.sgn == SIGNED || x.val >= 0 || precision <= 64) return wi::storage_ref (scratch, 1, precision); scratch[1] = 0; return wi::storage_ref (scratch, 2, precision); } namespace wi { bool eq_p_large (const long *, unsigned int, const long *, unsigned int, unsigned int); bool lts_p_large (const long *, unsigned int, unsigned int, const long *, unsigned int); bool ltu_p_large (const long *, unsigned int, unsigned int, const long *, unsigned int); int cmps_large (const long *, unsigned int, unsigned int, const long *, unsigned int); int cmpu_large (const long *, unsigned int, unsigned int, const long *, unsigned int); unsigned int sext_large (long *, const long *, unsigned int, unsigned int, unsigned int); unsigned int zext_large (long *, const long *, unsigned int, unsigned int, unsigned int); unsigned int set_bit_large (long *, const long *, unsigned int, unsigned int, unsigned int); unsigned int lshift_large (long *, const long *, unsigned int, unsigned int, unsigned int); unsigned int lrshift_large (long *, const long *, unsigned int, unsigned int, unsigned int, unsigned int); unsigned int arshift_large (long *, const long *, unsigned int, unsigned int, unsigned int, unsigned int); unsigned int and_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int); unsigned int and_not_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int); unsigned int or_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int); unsigned int or_not_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int); unsigned int xor_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int); unsigned int add_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int, signop, overflow_type *); unsigned int sub_large (long *, const long *, unsigned int, const long *, unsigned int, unsigned int, signop, overflow_type *); unsigned int mul_internal (long *, const long *, unsigned int, const long *, unsigned int, unsigned int, signop, overflow_type *, bool); unsigned int divmod_internal (long *, unsigned int *, long *, const long *, unsigned int, unsigned int, const long *, unsigned int, unsigned int, signop, overflow_type *); } template <typename T> inline unsigned int wi::get_precision (const T &x) { return wi::int_traits <T>::get_precision (x); } template <typename T1, typename T2> inline unsigned int wi::get_binary_precision (const T1 &x, const T2 &y) { return get_precision (wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>:: get_binary_result (x, y)); } template <typename T1, typename T2> inline void wi::copy (T1 &x, const T2 &y) { long *xval = x.write_val (); const long *yval = y.get_val (); unsigned int len = y.get_len (); unsigned int i = 0; do xval[i] = yval[i]; while (++i < len); x.set_len (len, y.is_sign_extended); } template <typename T> inline bool wi::fits_shwi_p (const T &x) { generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); return xi.len == 1; } template <typename T> inline bool wi::fits_uhwi_p (const T &x) { generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); if (xi.precision <= 64) return true; if (xi.len == 1) return xi.slow () >= 0; return xi.len == 2 && xi.uhigh () == 0; } template <typename T> inline bool wi::neg_p (const T &x, signop sgn) { generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); if (sgn == UNSIGNED) return false; return xi.sign_mask () < 0; } template <typename T> inline long wi::sign_mask (const T &x) { generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x); return xi.sign_mask (); } template <typename T1, typename T2> inline bool wi::eq_p (const T1 &x, const T2 &y) { unsigned int precision = get_binary_precision (x, y); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (xi.is_sign_extended && yi.is_sign_extended) { if (xi.len != yi.len) return false; unsigned int i = 0; do if (xi.val[i] != yi.val[i]) return false; while (++i != xi.len); return true; } if (__builtin_expect (yi.len == 1, true)) { if (xi.len != 1) return false; if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0))) return xi.val[0] == 0; unsigned long diff = xi.val[0] ^ yi.val[0]; int excess = 64 - precision; if (excess > 0) diff <<= excess; return diff == 0; } return eq_p_large (xi.val, xi.len, yi.val, yi.len, precision); } template <typename T1, typename T2> inline bool wi::ne_p (const T1 &x, const T2 &y) { return !eq_p (x, y); } template <typename T1, typename T2> inline bool wi::lts_p (const T1 &x, const T2 &y) { unsigned int precision = get_binary_precision (x, y); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (wi::fits_shwi_p (yi)) { if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0))) return neg_p (xi); if (wi::fits_shwi_p (xi)) return xi.to_shwi () < yi.to_shwi (); if (neg_p (xi)) return true; return false; } if ((__builtin_constant_p (xi.len == 1) && (xi.len == 1))) return !neg_p (yi); return lts_p_large (xi.val, xi.len, precision, yi.val, yi.len); } template <typename T1, typename T2> inline bool wi::ltu_p (const T1 &x, const T2 &y) { unsigned int precision = get_binary_precision (x, y); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if ((__builtin_constant_p (yi.len == 1 && yi.val[0] >= 0) && (yi.len == 1 && yi.val[0] >= 0))) return xi.len == 1 && xi.to_uhwi () < (unsigned long) yi.val[0]; if ((__builtin_constant_p (xi.len == 1 && xi.val[0] >= 0) && (xi.len == 1 && xi.val[0] >= 0))) return yi.len != 1 || yi.to_uhwi () > (unsigned long) xi.val[0]; if (__builtin_expect (xi.len + yi.len == 2, true)) { unsigned long xl = xi.to_uhwi (); unsigned long yl = yi.to_uhwi (); return xl < yl; } return ltu_p_large (xi.val, xi.len, precision, yi.val, yi.len); } template <typename T1, typename T2> inline bool wi::lt_p (const T1 &x, const T2 &y, signop sgn) { if (sgn == SIGNED) return lts_p (x, y); else return ltu_p (x, y); } template <typename T1, typename T2> inline bool wi::les_p (const T1 &x, const T2 &y) { return !lts_p (y, x); } template <typename T1, typename T2> inline bool wi::leu_p (const T1 &x, const T2 &y) { return !ltu_p (y, x); } template <typename T1, typename T2> inline bool wi::le_p (const T1 &x, const T2 &y, signop sgn) { if (sgn == SIGNED) return les_p (x, y); else return leu_p (x, y); } template <typename T1, typename T2> inline bool wi::gts_p (const T1 &x, const T2 &y) { return lts_p (y, x); } template <typename T1, typename T2> inline bool wi::gtu_p (const T1 &x, const T2 &y) { return ltu_p (y, x); } template <typename T1, typename T2> inline bool wi::gt_p (const T1 &x, const T2 &y, signop sgn) { if (sgn == SIGNED) return gts_p (x, y); else return gtu_p (x, y); } template <typename T1, typename T2> inline bool wi::ges_p (const T1 &x, const T2 &y) { return !lts_p (x, y); } template <typename T1, typename T2> inline bool wi::geu_p (const T1 &x, const T2 &y) { return !ltu_p (x, y); } template <typename T1, typename T2> inline bool wi::ge_p (const T1 &x, const T2 &y, signop sgn) { if (sgn == SIGNED) return ges_p (x, y); else return geu_p (x, y); } template <typename T1, typename T2> inline int wi::cmps (const T1 &x, const T2 &y) { unsigned int precision = get_binary_precision (x, y); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (wi::fits_shwi_p (yi)) { if ((__builtin_constant_p (yi.val[0] == 0) && (yi.val[0] == 0))) return neg_p (xi) ? -1 : !(xi.len == 1 && xi.val[0] == 0); if (wi::fits_shwi_p (xi)) { long xl = xi.to_shwi (); long yl = yi.to_shwi (); return xl < yl ? -1 : xl > yl; } if (neg_p (xi)) return -1; return 1; } if ((__builtin_constant_p (xi.len == 1) && (xi.len == 1))) return neg_p (yi) ? 1 : -1; return cmps_large (xi.val, xi.len, precision, yi.val, yi.len); } template <typename T1, typename T2> inline int wi::cmpu (const T1 &x, const T2 &y) { unsigned int precision = get_binary_precision (x, y); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if ((__builtin_constant_p (yi.len == 1 && yi.val[0] >= 0) && (yi.len == 1 && yi.val[0] >= 0))) { if (xi.len != 1) return 1; unsigned long xl = xi.to_uhwi (); unsigned long yl = yi.val[0]; return xl < yl ? -1 : xl > yl; } if ((__builtin_constant_p (xi.len == 1 && xi.val[0] >= 0) && (xi.len == 1 && xi.val[0] >= 0))) { if (yi.len != 1) return -1; unsigned long xl = xi.val[0]; unsigned long yl = yi.to_uhwi (); return xl < yl ? -1 : xl > yl; } if (__builtin_expect (xi.len + yi.len == 2, true)) { unsigned long xl = xi.to_uhwi (); unsigned long yl = yi.to_uhwi (); return xl < yl ? -1 : xl > yl; } return cmpu_large (xi.val, xi.len, precision, yi.val, yi.len); } template <typename T1, typename T2> inline int wi::cmp (const T1 &x, const T2 &y, signop sgn) { if (sgn == SIGNED) return cmps (x, y); else return cmpu (x, y); } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::bit_not (const T &x) { typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val (); generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, get_precision (result)); for (unsigned int i = 0; i < xi.len; ++i) val[i] = ~xi.val[i]; result.set_len (xi.len); return result; } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::neg (const T &x) { return sub (0, x); } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::neg (const T &x, overflow_type *overflow) { *overflow = only_sign_bit_p (x) ? OVF_OVERFLOW : OVF_NONE; return sub (0, x); } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::abs (const T &x) { return neg_p (x) ? neg (x) : typename wi::binary_traits <T, T>::result_type (x); } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::sext (const T &x, unsigned int offset) { typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision); if (offset <= 64) { val[0] = sext_hwi (xi.ulow (), offset); result.set_len (1, true); } else result.set_len (sext_large (val, xi.val, xi.len, precision, offset)); return result; } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::zext (const T &x, unsigned int offset) { typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision); if (offset >= precision) { wi::copy (result, xi); return result; } if (offset < 64) { val[0] = zext_hwi (xi.ulow (), offset); result.set_len (1, true); } else result.set_len (zext_large (val, xi.val, xi.len, precision, offset), true); return result; } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::ext (const T &x, unsigned int offset, signop sgn) { return sgn == SIGNED ? sext (x, offset) : zext (x, offset); } template <typename T> inline typename wi::binary_traits <T, T>::result_type wi::set_bit (const T &x, unsigned int bit) { typename wi::binary_traits <T, T>::result_type result = wi::int_traits <typename wi::binary_traits <T, T>::result_type>::get_binary_result (x, x); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision); if (precision <= 64) { val[0] = xi.ulow () | (1UL << bit); result.set_len (1); } else result.set_len (set_bit_large (val, xi.val, xi.len, precision, bit)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::min (const T1 &x, const T2 &y, signop sgn) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val __attribute__ ((__unused__)) = result.write_val (); unsigned int precision = get_precision (result); if (wi::le_p (x, y, sgn)) wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > (x, precision)); else wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > (y, precision)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::smin (const T1 &x, const T2 &y) { return wi::min (x, y, SIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::umin (const T1 &x, const T2 &y) { return wi::min (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::max (const T1 &x, const T2 &y, signop sgn) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val __attribute__ ((__unused__)) = result.write_val (); unsigned int precision = get_precision (result); if (wi::ge_p (x, y, sgn)) wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > (x, precision)); else wi::copy (result, generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > (y, precision)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::smax (const T1 &x, const T2 &y) { return wi::max (x, y, SIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::umax (const T1 &x, const T2 &y) { return wi::max (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::bit_and (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended; if (__builtin_expect (xi.len + yi.len == 2, true)) { val[0] = xi.ulow () & yi.ulow (); result.set_len (1, is_sign_extended); } else result.set_len (and_large (val, xi.val, xi.len, yi.val, yi.len, precision), is_sign_extended); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::bit_and_not (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended; if (__builtin_expect (xi.len + yi.len == 2, true)) { val[0] = xi.ulow () & ~yi.ulow (); result.set_len (1, is_sign_extended); } else result.set_len (and_not_large (val, xi.val, xi.len, yi.val, yi.len, precision), is_sign_extended); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::bit_or (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended; if (__builtin_expect (xi.len + yi.len == 2, true)) { val[0] = xi.ulow () | yi.ulow (); result.set_len (1, is_sign_extended); } else result.set_len (or_large (val, xi.val, xi.len, yi.val, yi.len, precision), is_sign_extended); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::bit_or_not (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended; if (__builtin_expect (xi.len + yi.len == 2, true)) { val[0] = xi.ulow () | ~yi.ulow (); result.set_len (1, is_sign_extended); } else result.set_len (or_not_large (val, xi.val, xi.len, yi.val, yi.len, precision), is_sign_extended); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::bit_xor (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); bool is_sign_extended = xi.is_sign_extended && yi.is_sign_extended; if (__builtin_expect (xi.len + yi.len == 2, true)) { val[0] = xi.ulow () ^ yi.ulow (); result.set_len (1, is_sign_extended); } else result.set_len (xor_large (val, xi.val, xi.len, yi.val, yi.len, precision), is_sign_extended); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::add (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (precision <= 64) { val[0] = xi.ulow () + yi.ulow (); result.set_len (1); } # 2441 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" else if ((__builtin_constant_p (precision > 64) && (precision > 64)) && __builtin_expect (xi.len + yi.len == 2, true)) { unsigned long xl = xi.ulow (); unsigned long yl = yi.ulow (); unsigned long resultl = xl + yl; val[0] = resultl; val[1] = (long) resultl < 0 ? 0 : -1; result.set_len (1 + (((resultl ^ xl) & (resultl ^ yl)) >> (64 - 1))); } else result.set_len (add_large (val, xi.val, xi.len, yi.val, yi.len, precision, UNSIGNED, 0)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::add (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (precision <= 64) { unsigned long xl = xi.ulow (); unsigned long yl = yi.ulow (); unsigned long resultl = xl + yl; if (sgn == SIGNED) { if ((((resultl ^ xl) & (resultl ^ yl)) >> (precision - 1)) & 1) { if (xl > resultl) *overflow = OVF_UNDERFLOW; else if (xl < resultl) *overflow = OVF_OVERFLOW; else *overflow = OVF_NONE; } else *overflow = OVF_NONE; } else *overflow = ((resultl << (64 - precision)) < (xl << (64 - precision))) ? OVF_OVERFLOW : OVF_NONE; val[0] = resultl; result.set_len (1); } else result.set_len (add_large (val, xi.val, xi.len, yi.val, yi.len, precision, sgn, overflow)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::sub (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (precision <= 64) { val[0] = xi.ulow () - yi.ulow (); result.set_len (1); } # 2527 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" else if ((__builtin_constant_p (precision > 64) && (precision > 64)) && __builtin_expect (xi.len + yi.len == 2, true)) { unsigned long xl = xi.ulow (); unsigned long yl = yi.ulow (); unsigned long resultl = xl - yl; val[0] = resultl; val[1] = (long) resultl < 0 ? 0 : -1; result.set_len (1 + (((resultl ^ xl) & (xl ^ yl)) >> (64 - 1))); } else result.set_len (sub_large (val, xi.val, xi.len, yi.val, yi.len, precision, UNSIGNED, 0)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::sub (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (precision <= 64) { unsigned long xl = xi.ulow (); unsigned long yl = yi.ulow (); unsigned long resultl = xl - yl; if (sgn == SIGNED) { if ((((xl ^ yl) & (resultl ^ xl)) >> (precision - 1)) & 1) { if (xl > yl) *overflow = OVF_UNDERFLOW; else if (xl < yl) *overflow = OVF_OVERFLOW; else *overflow = OVF_NONE; } else *overflow = OVF_NONE; } else *overflow = ((resultl << (64 - precision)) > (xl << (64 - precision))) ? OVF_UNDERFLOW : OVF_NONE; val[0] = resultl; result.set_len (1); } else result.set_len (sub_large (val, xi.val, xi.len, yi.val, yi.len, precision, sgn, overflow)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mul (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); if (precision <= 64) { val[0] = xi.ulow () * yi.ulow (); result.set_len (1); } else result.set_len (mul_internal (val, xi.val, xi.len, yi.val, yi.len, precision, UNSIGNED, 0, false)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mul (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); result.set_len (mul_internal (val, xi.val, xi.len, yi.val, yi.len, precision, sgn, overflow, false)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::smul (const T1 &x, const T2 &y, overflow_type *overflow) { return mul (x, y, SIGNED, overflow); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::umul (const T1 &x, const T2 &y, overflow_type *overflow) { return mul (x, y, UNSIGNED, overflow); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mul_high (const T1 &x, const T2 &y, signop sgn) { typename wi::binary_traits <T1, T2>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y, precision); result.set_len (mul_internal (val, xi.val, xi.len, yi.val, yi.len, precision, sgn, 0, true)); return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::div_trunc (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); quotient.set_len (divmod_internal (quotient_val, 0, 0, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); return quotient; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::sdiv_trunc (const T1 &x, const T2 &y) { return div_trunc (x, y, SIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::udiv_trunc (const T1 &x, const T2 &y) { return div_trunc (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::div_floor (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn) && remainder != 0) return quotient - 1; return quotient; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::sdiv_floor (const T1 &x, const T2 &y) { return div_floor (x, y, SIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::udiv_floor (const T1 &x, const T2 &y) { return div_floor (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::div_ceil (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (wi::neg_p (x, sgn) == wi::neg_p (y, sgn) && remainder != 0) return quotient + 1; return quotient; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::udiv_ceil (const T1 &x, const T2 &y) { return div_ceil (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::div_round (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (remainder != 0) { if (sgn == SIGNED) { typename wi::binary_traits <T1, T2>::result_type abs_remainder = wi::abs (remainder); if (wi::geu_p (abs_remainder, wi::sub (wi::abs (y), abs_remainder))) { if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn)) return quotient - 1; else return quotient + 1; } } else { if (wi::geu_p (remainder, wi::sub (y, remainder))) return quotient + 1; } } return quotient; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::divmod_trunc (const T1 &x, const T2 &y, signop sgn, typename wi::binary_traits <T1, T2>::result_type *remainder_ptr) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, 0)); remainder.set_len (remainder_len); *remainder_ptr = remainder; return quotient; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::gcd (const T1 &a, const T2 &b, signop sgn) { T1 x, y, z; x = wi::abs (a); y = wi::abs (b); while (gt_p (x, 0, sgn)) { z = mod_trunc (y, x, sgn); y = x; x = z; } return y; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mod_trunc (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (remainder); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; divmod_internal (0, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow); remainder.set_len (remainder_len); return remainder; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::smod_trunc (const T1 &x, const T2 &y) { return mod_trunc (x, y, SIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::umod_trunc (const T1 &x, const T2 &y) { return mod_trunc (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mod_floor (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn) && remainder != 0) return remainder + y; return remainder; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::umod_floor (const T1 &x, const T2 &y) { return mod_floor (x, y, UNSIGNED); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mod_ceil (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (wi::neg_p (x, sgn) == wi::neg_p (y, sgn) && remainder != 0) return remainder - y; return remainder; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::result_type wi::mod_round (const T1 &x, const T2 &y, signop sgn, overflow_type *overflow) { typename wi::binary_traits <T1, T2>::result_type quotient = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *quotient_val = quotient.write_val (); typename wi::binary_traits <T1, T2>::result_type remainder = wi::int_traits <typename wi::binary_traits <T1, T2>::result_type>::get_binary_result (x, y); long *remainder_val = remainder.write_val (); unsigned int precision = get_precision (quotient); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); unsigned int remainder_len; quotient.set_len (divmod_internal (quotient_val, &remainder_len, remainder_val, xi.val, xi.len, precision, yi.val, yi.len, yi.precision, sgn, overflow)); remainder.set_len (remainder_len); if (remainder != 0) { if (sgn == SIGNED) { typename wi::binary_traits <T1, T2>::result_type abs_remainder = wi::abs (remainder); if (wi::geu_p (abs_remainder, wi::sub (wi::abs (y), abs_remainder))) { if (wi::neg_p (x, sgn) != wi::neg_p (y, sgn)) return remainder + y; else return remainder - y; } } else { if (wi::geu_p (remainder, wi::sub (y, remainder))) return remainder - y; } } return remainder; } template <typename T1, typename T2> inline bool wi::multiple_of_p (const T1 &x, const T2 &y, signop sgn) { return wi::mod_trunc (x, y, sgn) == 0; } template <typename T1, typename T2> inline bool wi::multiple_of_p (const T1 &x, const T2 &y, signop sgn, typename wi::binary_traits <T1, T2>::result_type *res) { typename wi::binary_traits <T1, T2>::result_type remainder; typename wi::binary_traits <T1, T2>::result_type quotient = divmod_trunc (x, y, sgn, &remainder); if (remainder == 0) { *res = quotient; return true; } return false; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T1>::result_type wi::lshift (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val (); unsigned int precision = get_precision (result); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x, precision); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); if (geu_p (yi, precision)) { val[0] = 0; result.set_len (1); } else { unsigned int shift = yi.to_uhwi (); # 3054 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" if ((__builtin_constant_p (xi.precision > 64) && (xi.precision > 64)) ? ((__builtin_constant_p (shift < 64 - 1) && (shift < 64 - 1)) && xi.len == 1 && ((unsigned long) (xi.val[0]) - (unsigned long) (0) <= (unsigned long) ((~((long) (1UL << (64 - 1)))) >> shift) - (unsigned long) (0))) : precision <= 64) { val[0] = xi.ulow () << shift; result.set_len (1); } else result.set_len (lshift_large (val, xi.val, xi.len, precision, shift)); } return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T1>::result_type wi::lrshift (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val (); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); if (geu_p (yi, xi.precision)) { val[0] = 0; result.set_len (1); } else { unsigned int shift = yi.to_uhwi (); # 3098 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" if ((__builtin_constant_p (xi.precision > 64) && (xi.precision > 64)) ? (shift < 64 && xi.len == 1 && xi.val[0] >= 0) : xi.precision <= 64) { val[0] = xi.to_uhwi () >> shift; result.set_len (1); } else result.set_len (lrshift_large (val, xi.val, xi.len, xi.precision, get_precision (result), shift)); } return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T1>::result_type wi::arshift (const T1 &x, const T2 &y) { typename wi::binary_traits <T1, T1>::result_type result = wi::int_traits <typename wi::binary_traits <T1, T1>::result_type>::get_binary_result (x, x); long *val = result.write_val (); generic_wide_int <wide_int_ref_storage <wi::int_traits <T1>::is_sign_extended, wi::int_traits <T1>::host_dependent_precision> > xi (x); generic_wide_int <wide_int_ref_storage <wi::int_traits <T2>::is_sign_extended, wi::int_traits <T2>::host_dependent_precision> > yi (y); if (geu_p (yi, xi.precision)) { val[0] = sign_mask (x); result.set_len (1); } else { unsigned int shift = yi.to_uhwi (); if (xi.precision <= 64) { val[0] = sext_hwi (xi.ulow () >> shift, xi.precision - shift); result.set_len (1, true); } else result.set_len (arshift_large (val, xi.val, xi.len, xi.precision, get_precision (result), shift)); } return result; } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T1>::result_type wi::rshift (const T1 &x, const T2 &y, signop sgn) { if (sgn == UNSIGNED) return lrshift (x, y); else return arshift (x, y); } template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type wi::lrotate (const T1 &x, const T2 &y, unsigned int width) { unsigned int precision = get_binary_precision (x, x); if (width == 0) width = precision; typename wi::binary_traits <T2, T2>::result_type ymod = umod_trunc (y, width); typename wi::binary_traits <T1, T1>::result_type left = wi::lshift (x, ymod); typename wi::binary_traits <T1, T1>::result_type right = wi::lrshift (x, wi::sub (width, ymod)); if (width != precision) return wi::zext (left, width) | wi::zext (right, width); return left | right; } template <typename T1, typename T2> typename wi::binary_traits <T1, T1>::result_type wi::rrotate (const T1 &x, const T2 &y, unsigned int width) { unsigned int precision = get_binary_precision (x, x); if (width == 0) width = precision; typename wi::binary_traits <T2, T2>::result_type ymod = umod_trunc (y, width); typename wi::binary_traits <T1, T1>::result_type right = wi::lrshift (x, ymod); typename wi::binary_traits <T1, T1>::result_type left = wi::lshift (x, wi::sub (width, ymod)); if (width != precision) return wi::zext (left, width) | wi::zext (right, width); return left | right; } inline int wi::parity (const wide_int_ref &x) { return popcount (x) & 1; } template <typename T> inline unsigned long wi::extract_uhwi (const T &x, unsigned int bitpos, unsigned int width) { unsigned precision = get_precision (x); if (precision < bitpos + width) precision = bitpos + width; generic_wide_int <wide_int_ref_storage <wi::int_traits <T>::is_sign_extended, wi::int_traits <T>::host_dependent_precision> > xi (x, precision); if (width == 0) return 0; unsigned int start = bitpos / 64; unsigned int shift = bitpos % 64; unsigned long res = xi.elt (start); res >>= shift; if (shift + width > 64) { unsigned long upper = xi.elt (start + 1); res |= upper << (-shift % 64); } return zext_hwi (res, width); } template <typename T> inline unsigned int wi::min_precision (const T &x, signop sgn) { if (sgn == SIGNED) return get_precision (x) - clrsb (x); else return get_precision (x) - clz (x); } # 3248 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator < (const T1 &x, const T2 &y) { return wi::lts_p (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator <= (const T1 &x, const T2 &y) { return wi::les_p (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator > (const T1 &x, const T2 &y) { return wi::gts_p (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_predicate_result operator >= (const T1 &x, const T2 &y) { return wi::ges_p (x, y); } # 3287 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int.h" template<typename T> typename wi::binary_traits <generic_wide_int<T>, generic_wide_int<T> >::result_type operator ~ (const generic_wide_int<T> &x) { return wi::bit_not (x); } template<typename T> typename wi::binary_traits <generic_wide_int<T>, generic_wide_int<T> >::result_type operator - (const generic_wide_int<T> &x) { return wi::neg (x); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::predicate_result operator == (const T1 &x, const T2 &y) { return wi::eq_p (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::predicate_result operator != (const T1 &x, const T2 &y) { return wi::ne_p (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator & (const T1 &x, const T2 &y) { return wi::bit_and (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator | (const T1 &x, const T2 &y) { return wi::bit_or (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator ^ (const T1 &x, const T2 &y) { return wi::bit_xor (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator + (const T1 &x, const T2 &y) { return wi::add (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator - (const T1 &x, const T2 &y) { return wi::sub (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T2>::operator_result operator * (const T1 &x, const T2 &y) { return wi::mul (x, y); } template<typename T1, typename T2> typename wi::binary_traits <T1, T1>::operator_result operator << (const T1 &x, const T2 &y) { return wi::lshift (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_shift_result_type operator >> (const T1 &x, const T2 &y) { return wi::arshift (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_shift_result_type operator / (const T1 &x, const T2 &y) { return wi::sdiv_trunc (x, y); } template <typename T1, typename T2> inline typename wi::binary_traits <T1, T2>::signed_shift_result_type operator % (const T1 &x, const T2 &y) { return wi::smod_trunc (x, y); } template<typename T> void gt_ggc_mx (generic_wide_int <T> *) { } template<typename T> void gt_pch_nx (generic_wide_int <T> *) { } template<typename T> void gt_pch_nx (generic_wide_int <T> *, void (*) (void *, void *), void *) { } template<int N> void gt_ggc_mx (trailing_wide_ints <N> *) { } template<int N> void gt_pch_nx (trailing_wide_ints <N> *) { } template<int N> void gt_pch_nx (trailing_wide_ints <N> *, void (*) (void *, void *), void *) { } namespace wi { struct never_used1 {}; struct never_used2 {}; wide_int min_value (unsigned int, signop); wide_int min_value (never_used1 *); wide_int min_value (never_used2 *); wide_int max_value (unsigned int, signop); wide_int max_value (never_used1 *); wide_int max_value (never_used2 *); wide_int from_buffer (const unsigned char *, unsigned int); void to_mpz (const wide_int_ref &, mpz_t, signop); wide_int mask (unsigned int, bool, unsigned int); wide_int shifted_mask (unsigned int, unsigned int, bool, unsigned int); wide_int set_bit_in_zero (unsigned int, unsigned int); wide_int insert (const wide_int &x, const wide_int &y, unsigned int, unsigned int); wide_int round_down_for_mask (const wide_int &, const wide_int &); wide_int round_up_for_mask (const wide_int &, const wide_int &); wide_int mod_inv (const wide_int &a, const wide_int &b); template <typename T> T mask (unsigned int, bool); template <typename T> T shifted_mask (unsigned int, unsigned int, bool); template <typename T> T set_bit_in_zero (unsigned int); unsigned int mask (long *, unsigned int, bool, unsigned int); unsigned int shifted_mask (long *, unsigned int, unsigned int, bool, unsigned int); unsigned int from_array (long *, const long *, unsigned int, unsigned int, bool); } inline wide_int wi::mask (unsigned int width, bool negate_p, unsigned int precision) { wide_int result = wide_int::create (precision); result.set_len (mask (result.write_val (), width, negate_p, precision)); return result; } inline wide_int wi::shifted_mask (unsigned int start, unsigned int width, bool negate_p, unsigned int precision) { wide_int result = wide_int::create (precision); result.set_len (shifted_mask (result.write_val (), start, width, negate_p, precision)); return result; } inline wide_int wi::set_bit_in_zero (unsigned int bit, unsigned int precision) { return shifted_mask (bit, 1, false, precision); } template <typename T> inline T wi::mask (unsigned int width, bool negate_p) { static_assert ((wi::int_traits<T>::precision), "wi::int_traits<T>::precision"); T result; result.set_len (mask (result.write_val (), width, negate_p, wi::int_traits <T>::precision)); return result; } template <typename T> inline T wi::shifted_mask (unsigned int start, unsigned int width, bool negate_p) { static_assert ((wi::int_traits<T>::precision), "wi::int_traits<T>::precision"); T result; result.set_len (shifted_mask (result.write_val (), start, width, negate_p, wi::int_traits <T>::precision)); return result; } template <typename T> inline T wi::set_bit_in_zero (unsigned int bit) { return shifted_mask <T> (bit, 1, false); } static inline void wi::accumulate_overflow (wi::overflow_type &overflow, wi::overflow_type suboverflow) { if (!suboverflow) return; if (!overflow) overflow = suboverflow; else if (overflow != suboverflow) overflow = wi::OVF_UNKNOWN; } # 452 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int-print.h" 1 # 29 "/home/giulianob/gcc_git_gnu/gcc/gcc/wide-int-print.h" extern void print_dec (const wide_int_ref &wi, char *buf, signop sgn); extern void print_dec (const wide_int_ref &wi, FILE *file, signop sgn); extern void print_decs (const wide_int_ref &wi, char *buf); extern void print_decs (const wide_int_ref &wi, FILE *file); extern void print_decu (const wide_int_ref &wi, char *buf); extern void print_decu (const wide_int_ref &wi, FILE *file); extern void print_hex (const wide_int_ref &wi, char *buf); extern void print_hex (const wide_int_ref &wi, FILE *file); # 453 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 466 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" 1 # 32 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename T> struct poly_int_pod; template<unsigned int N, typename T> class poly_int; # 62 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<typename T, wi::precision_type = wi::int_traits<T>::precision_type> struct poly_coeff_traits; template<typename T> struct poly_coeff_traits<T, wi::FLEXIBLE_PRECISION> { typedef T result; typedef T int_type; static const int signedness = (T (0) >= T (-1)); static const int precision = sizeof (T) * 8; static const T max_value = (signedness ? ((T (1) << (precision - 2)) + ((T (1) << (precision - 2)) - 1)) : T (-1)); static const int rank = sizeof (T) * 2 + !signedness; }; template<typename T> struct poly_coeff_traits<T, wi::VAR_PRECISION> { typedef T result; typedef int int_type; static const int signedness = -1; static const int precision = (((160 + 64) / 64) * 64); static const int rank = 0x7fffffff; }; template<typename T> struct poly_coeff_traits<T, wi::CONST_PRECISION> { typedef typename wi::binary_traits <T, T>::result_type result; typedef int int_type; static const int signedness = 1; static const int precision = wi::int_traits<T>::precision; static const int rank = precision * 2 / 8; }; template<typename T1, typename T2> struct poly_coeff_pair_traits { # 118 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" static const bool lossless_p = (poly_coeff_traits<T1>::signedness == poly_coeff_traits<T2>::signedness ? (poly_coeff_traits<T1>::precision >= poly_coeff_traits<T2>::precision) : (poly_coeff_traits<T1>::signedness == 1 && poly_coeff_traits<T2>::signedness == 0 && (poly_coeff_traits<T1>::precision > poly_coeff_traits<T2>::precision))); static const int result_kind = ((poly_coeff_traits<T1>::rank <= poly_coeff_traits<long>::rank && poly_coeff_traits<T2>::rank <= poly_coeff_traits<long>::rank) ? 0 : (poly_coeff_traits<T1>::rank <= poly_coeff_traits<unsigned long>::rank && poly_coeff_traits<T2>::rank <= poly_coeff_traits<unsigned long>::rank) ? 1 : 2); }; template<typename T1, typename T2, typename T3, bool lossless_p = poly_coeff_pair_traits<T1, T2>::lossless_p> struct if_lossless; template<typename T1, typename T2, typename T3> struct if_lossless<T1, T2, T3, true> { typedef T3 type; }; # 166 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<typename T> struct poly_int_traits { static const bool is_poly = false; static const unsigned int num_coeffs = 1; typedef T coeff_type; typedef typename poly_coeff_traits<T>::int_type int_type; }; template<unsigned int N, typename C> struct poly_int_traits<poly_int_pod<N, C> > { static const bool is_poly = true; static const unsigned int num_coeffs = N; typedef C coeff_type; typedef typename poly_coeff_traits<C>::int_type int_type; }; template<unsigned int N, typename C> struct poly_int_traits<poly_int<N, C> > : poly_int_traits<poly_int_pod<N, C> > { }; template<typename T1, typename T2 = T1, bool is_poly = poly_int_traits<T1>::is_poly> struct if_nonpoly {}; template<typename T1, typename T2> struct if_nonpoly<T1, T2, false> { typedef T2 type; }; template<typename T1, typename T2, typename T3, bool is_poly1 = poly_int_traits<T1>::is_poly, bool is_poly2 = poly_int_traits<T2>::is_poly> struct if_nonpoly2 {}; template<typename T1, typename T2, typename T3> struct if_nonpoly2<T1, T2, T3, false, false> { typedef T3 type; }; template<typename T1, typename T2 = T1, bool is_poly = poly_int_traits<T1>::is_poly> struct if_poly {}; template<typename T1, typename T2> struct if_poly<T1, T2, true> { typedef T2 type; }; # 234 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<typename T1, typename T2 = T1, int result_kind = poly_coeff_pair_traits<T1, T2>::result_kind> struct poly_result; template<typename T1, typename T2> struct poly_result<T1, T2, 0> { typedef long type; typedef type cast; }; template<typename T1, typename T2> struct poly_result<T1, T2, 1> { typedef unsigned long type; typedef type cast; }; template<typename T1, typename T2> struct poly_result<T1, T2, 2> { typedef typename wi::binary_traits <T1, T2>::result_type type; typedef const T1 &cast; }; # 337 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename C> struct poly_int_pod { public: template<typename Ca> poly_int_pod &operator = (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int_pod>::type &operator = (const Ca &); template<typename Ca> poly_int_pod &operator += (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int_pod>::type &operator += (const Ca &); template<typename Ca> poly_int_pod &operator -= (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int_pod>::type &operator -= (const Ca &); template<typename Ca> typename if_nonpoly<Ca, poly_int_pod>::type &operator *= (const Ca &); poly_int_pod &operator <<= (unsigned int); bool is_constant () const; template<typename T> typename if_lossless<T, C, bool>::type is_constant (T *) const; C to_constant () const; template<typename Ca> static poly_int<N, C> from (const poly_int_pod<N, Ca> &, unsigned int, signop); template<typename Ca> static poly_int<N, C> from (const poly_int_pod<N, Ca> &, signop); bool to_shwi (poly_int_pod<N, long> *) const; bool to_uhwi (poly_int_pod<N, unsigned long> *) const; poly_int<N, long> force_shwi () const; poly_int<N, unsigned long> force_uhwi () const; C coeffs[N]; }; template<unsigned int N, typename C> template<typename Ca> inline poly_int_pod<N, C>& poly_int_pod<N, C>::operator = (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i]))); return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type & poly_int_pod<N, C>::operator = (const Ca &a) { ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = a) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (a))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0])))); return *this; } template<unsigned int N, typename C> template<typename Ca> inline poly_int_pod<N, C>& poly_int_pod<N, C>::operator += (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] += a.coeffs[i]; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type & poly_int_pod<N, C>::operator += (const Ca &a) { this->coeffs[0] += a; return *this; } template<unsigned int N, typename C> template<typename Ca> inline poly_int_pod<N, C>& poly_int_pod<N, C>::operator -= (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] -= a.coeffs[i]; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type & poly_int_pod<N, C>::operator -= (const Ca &a) { this->coeffs[0] -= a; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int_pod<N, C> >::type & poly_int_pod<N, C>::operator *= (const Ca &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] *= a; return *this; } template<unsigned int N, typename C> inline poly_int_pod<N, C>& poly_int_pod<N, C>::operator <<= (unsigned int a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] <<= a; return *this; } template<unsigned int N, typename C> inline bool poly_int_pod<N, C>::is_constant () const { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (this->coeffs[i] != 0) return false; return true; } template<unsigned int N, typename C> template<typename T> inline typename if_lossless<T, C, bool>::type poly_int_pod<N, C>::is_constant (T *const_value) const { if (is_constant ()) { *const_value = this->coeffs[0]; return true; } return false; } template<unsigned int N, typename C> inline C poly_int_pod<N, C>::to_constant () const { ((void)(!(is_constant ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 504, __FUNCTION__), 0 : 0)); return this->coeffs[0]; } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C> poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a, unsigned int bitsize, signop sgn) { poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = C::from (a.coeffs[i], bitsize, sgn)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (C::from (a.coeffs[i], bitsize, sgn)))); return r; } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C> poly_int_pod<N, C>::from (const poly_int_pod<N, Ca> &a, signop sgn) { poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = C::from (a.coeffs[i], sgn)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (C::from (a.coeffs[i], sgn)))); return r; } template<unsigned int N, typename C> inline bool poly_int_pod<N, C>::to_shwi (poly_int_pod<N, long> *r) const { for (unsigned int i = 0; i < N; i++) if (!wi::fits_shwi_p (this->coeffs[i])) return false; for (unsigned int i = 0; i < N; i++) r->coeffs[i] = this->coeffs[i].to_shwi (); return true; } template<unsigned int N, typename C> inline bool poly_int_pod<N, C>::to_uhwi (poly_int_pod<N, unsigned long> *r) const { for (unsigned int i = 0; i < N; i++) if (!wi::fits_uhwi_p (this->coeffs[i])) return false; for (unsigned int i = 0; i < N; i++) r->coeffs[i] = this->coeffs[i].to_uhwi (); return true; } template<unsigned int N, typename C> inline poly_int<N, long> poly_int_pod<N, C>::force_shwi () const { poly_int_pod<N, long> r; for (unsigned int i = 0; i < N; i++) r.coeffs[i] = this->coeffs[i].to_shwi (); return r; } template<unsigned int N, typename C> inline poly_int<N, unsigned long> poly_int_pod<N, C>::force_uhwi () const { poly_int_pod<N, unsigned long> r; for (unsigned int i = 0; i < N; i++) r.coeffs[i] = this->coeffs[i].to_uhwi (); return r; } # 611 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename C> class poly_int : public poly_int_pod<N, C> { public: poly_int () {} template<typename Ca> poly_int (const poly_int<N, Ca> &); template<typename Ca> poly_int (const poly_int_pod<N, Ca> &); template<typename C0> poly_int (const C0 &); template<typename C0, typename C1> poly_int (const C0 &, const C1 &); template<typename Ca> poly_int &operator = (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int>::type &operator = (const Ca &); template<typename Ca> poly_int &operator += (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int>::type &operator += (const Ca &); template<typename Ca> poly_int &operator -= (const poly_int_pod<N, Ca> &); template<typename Ca> typename if_nonpoly<Ca, poly_int>::type &operator -= (const Ca &); template<typename Ca> typename if_nonpoly<Ca, poly_int>::type &operator *= (const Ca &); poly_int &operator <<= (unsigned int); }; template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C>::poly_int (const poly_int<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i]))); } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C>::poly_int (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = a.coeffs[i]) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (a.coeffs[i]))); } template<unsigned int N, typename C> template<typename C0> inline poly_int<N, C>::poly_int (const C0 &c0) { ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = c0) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (c0))); for (unsigned int i = 1; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0])))); } template<unsigned int N, typename C> template<typename C0, typename C1> inline poly_int<N, C>::poly_int (const C0 &c0, const C1 &c1) { static_assert ((N >= 2), "N >= 2"); ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[0] = c0) : (void) ((*this).coeffs[0].~C (), new (&(*this).coeffs[0]) C (c0))); ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[1] = c1) : (void) ((*this).coeffs[1].~C (), new (&(*this).coeffs[1]) C (c1))); for (unsigned int i = 2; i < N; i++) ((void) (&(*this).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((*this).coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0])) : (void) ((*this).coeffs[i].~C (), new (&(*this).coeffs[i]) C (wi::ints_for<C>::zero (this->coeffs[0])))); } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C>& poly_int<N, C>::operator = (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] = a.coeffs[i]; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int<N, C> >::type & poly_int<N, C>::operator = (const Ca &a) { this->coeffs[0] = a; if (N >= 2) for (unsigned int i = 1; i < N; i++) this->coeffs[i] = wi::ints_for<C>::zero (this->coeffs[0]); return *this; } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C>& poly_int<N, C>::operator += (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] += a.coeffs[i]; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int<N, C> >::type & poly_int<N, C>::operator += (const Ca &a) { this->coeffs[0] += a; return *this; } template<unsigned int N, typename C> template<typename Ca> inline poly_int<N, C>& poly_int<N, C>::operator -= (const poly_int_pod<N, Ca> &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] -= a.coeffs[i]; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int<N, C> >::type & poly_int<N, C>::operator -= (const Ca &a) { this->coeffs[0] -= a; return *this; } template<unsigned int N, typename C> template<typename Ca> inline typename if_nonpoly<Ca, poly_int<N, C> >::type & poly_int<N, C>::operator *= (const Ca &a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] *= a; return *this; } template<unsigned int N, typename C> inline poly_int<N, C>& poly_int<N, C>::operator <<= (unsigned int a) { for (unsigned int i = 0; i < N; i++) this->coeffs[i] <<= a; return *this; } template<typename Ca, typename Cb, typename Cc> inline typename if_nonpoly<Ca, bool>::type coeffs_in_range_p (const Ca &a, const Cb &b, const Cc &c) { return a >= b && a <= c; } template<unsigned int N, typename Ca, typename Cb, typename Cc> inline typename if_nonpoly<Ca, bool>::type coeffs_in_range_p (const poly_int_pod<N, Ca> &a, const Cb &b, const Cc &c) { for (unsigned int i = 0; i < N; i++) if (a.coeffs[i] < b || a.coeffs[i] > c) return false; return true; } namespace wi { template<unsigned int N> inline poly_int<N, hwi_with_prec> shwi (const poly_int_pod<N, long> &a, unsigned int precision) { poly_int<N, hwi_with_prec> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (hwi_with_prec *) 0), wi::int_traits<hwi_with_prec>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::shwi (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~hwi_with_prec (), new (&(r).coeffs[i]) hwi_with_prec (wi::shwi (a.coeffs[i], precision)))); return r; } template<unsigned int N> inline poly_int<N, hwi_with_prec> uhwi (const poly_int_pod<N, unsigned long> &a, unsigned int precision) { poly_int<N, hwi_with_prec> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (hwi_with_prec *) 0), wi::int_traits<hwi_with_prec>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::uhwi (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~hwi_with_prec (), new (&(r).coeffs[i]) hwi_with_prec (wi::uhwi (a.coeffs[i], precision)))); return r; } template<unsigned int N, typename Ca> inline poly_int<N, typename poly_result<Ca, Ca>::type> sext (const poly_int_pod<N, Ca> &a, unsigned int precision) { typedef typename poly_result<Ca, Ca>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sext (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sext (a.coeffs[i], precision)))); return r; } template<unsigned int N, typename Ca> inline poly_int<N, typename poly_result<Ca, Ca>::type> zext (const poly_int_pod<N, Ca> &a, unsigned int precision) { typedef typename poly_result<Ca, Ca>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::zext (a.coeffs[i], precision)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::zext (a.coeffs[i], precision)))); return r; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> operator + (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Ca, Cb>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) + b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) + b.coeffs[i]))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> operator + (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = NCa (a.coeffs[0]) + b) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (NCa (a.coeffs[0]) + b))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i])))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> operator + (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = a + NCb (b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (a + NCb (b.coeffs[0])))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCb (b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCb (b.coeffs[i])))); return r; } namespace wi { template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], b.coeffs[i])))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> add (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a.coeffs[0], b)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a.coeffs[0], b)))); for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], wi::ints_for<Cb>::zero (b))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], wi::ints_for<Cb>::zero (b))))) ; return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> add (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a, b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a, b.coeffs[0])))); for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (wi::ints_for<Ca>::zero (a), b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (wi::ints_for<Ca>::zero (a), b.coeffs[i])))) ; return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> add (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, signop sgn, wi::overflow_type *overflow) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::add (a.coeffs[0], b.coeffs[0], sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::add (a.coeffs[0], b.coeffs[0], sgn, overflow)))); for (unsigned int i = 1; i < N; i++) { wi::overflow_type suboverflow; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::add (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::add (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)))) ; wi::accumulate_overflow (*overflow, suboverflow); } return r; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> operator - (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Ca, Cb>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) - b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) - b.coeffs[i]))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> operator - (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = NCa (a.coeffs[0]) - b) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (NCa (a.coeffs[0]) - b))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i])))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> operator - (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = a - NCb (b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (a - NCb (b.coeffs[0])))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = -NCb (b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (-NCb (b.coeffs[i])))); return r; } namespace wi { template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], b.coeffs[i])))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> sub (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a.coeffs[0], b)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a.coeffs[0], b)))); for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], wi::ints_for<Cb>::zero (b))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], wi::ints_for<Cb>::zero (b))))) ; return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> sub (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a, b.coeffs[0])) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a, b.coeffs[0])))); for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (wi::ints_for<Ca>::zero (a), b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (wi::ints_for<Ca>::zero (a), b.coeffs[i])))) ; return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> sub (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, signop sgn, wi::overflow_type *overflow) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::sub (a.coeffs[0], b.coeffs[0], sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::sub (a.coeffs[0], b.coeffs[0], sgn, overflow)))); for (unsigned int i = 1; i < N; i++) { wi::overflow_type suboverflow; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::sub (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::sub (a.coeffs[i], b.coeffs[i], sgn, &suboverflow)))) ; wi::accumulate_overflow (*overflow, suboverflow); } return r; } } template<unsigned int N, typename Ca> inline poly_int<N, typename poly_result<Ca, Ca>::type> operator - (const poly_int_pod<N, Ca> &a) { typedef typename poly_result<Ca, Ca>::cast NCa; typedef typename poly_result<Ca, Ca>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = -NCa (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (-NCa (a.coeffs[i])))); return r; } namespace wi { template<unsigned int N, typename Ca> inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type> neg (const poly_int_pod<N, Ca> &a) { typedef typename wi::binary_traits <Ca, Ca>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::neg (a.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::neg (a.coeffs[i])))); return r; } template<unsigned int N, typename Ca> inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type> neg (const poly_int_pod<N, Ca> &a, wi::overflow_type *overflow) { typedef typename wi::binary_traits <Ca, Ca>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::neg (a.coeffs[0], overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::neg (a.coeffs[0], overflow)))); for (unsigned int i = 1; i < N; i++) { wi::overflow_type suboverflow; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::neg (a.coeffs[i], &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::neg (a.coeffs[i], &suboverflow)))); wi::accumulate_overflow (*overflow, suboverflow); } return r; } } template<unsigned int N, typename Ca> inline poly_int<N, typename poly_result<Ca, Ca>::type> operator ~ (const poly_int_pod<N, Ca> &a) { if (N >= 2) return -1 - a; return ~a.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> operator * (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) * b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) * b))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> operator * (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a) * b.coeffs[i]) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a) * b.coeffs[i]))); return r; } namespace wi { template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> mul (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a.coeffs[i], b)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a.coeffs[i], b)))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> mul (const Ca &a, const poly_int_pod<N, Cb> &b) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a, b.coeffs[i])) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a, b.coeffs[i])))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Cb>::result_type> mul (const poly_int_pod<N, Ca> &a, const Cb &b, signop sgn, wi::overflow_type *overflow) { typedef typename wi::binary_traits <Ca, Cb>::result_type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = wi::mul (a.coeffs[0], b, sgn, overflow)) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (wi::mul (a.coeffs[0], b, sgn, overflow)))); for (unsigned int i = 1; i < N; i++) { wi::overflow_type suboverflow; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::mul (a.coeffs[i], b, sgn, &suboverflow)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::mul (a.coeffs[i], b, sgn, &suboverflow)))); wi::accumulate_overflow (*overflow, suboverflow); } return r; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Ca>::type> operator << (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Ca>::cast NCa; typedef typename poly_result<Ca, Ca>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = NCa (a.coeffs[i]) << b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (NCa (a.coeffs[i]) << b))); return r; } namespace wi { template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename wi::binary_traits <Ca, Ca>::result_type> lshift (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename wi::binary_traits <Ca, Ca>::result_type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = wi::lshift (a.coeffs[i], b)) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (wi::lshift (a.coeffs[i], b)))); return r; } } template<typename Ca, typename Cb> inline bool maybe_eq_2 (const Ca &a0, const Ca &a1, const Cb &b0, const Cb &b1) { if (a1 != b1) return (a1 < b1 ? b0 <= a0 && (a0 - b0) % (b1 - a1) == 0 : b0 >= a0 && (b0 - a0) % (a1 - b1) == 0); return a0 == b0; } template<typename Ca, typename Cb> inline bool maybe_eq_2 (const Ca &a0, const Ca &a1, const Cb &b) { if (a1 != 0) return (a1 < 0 ? b <= a0 && (a0 - b) % a1 == 0 : b >= a0 && (b - a0) % a1 == 0); return a0 == b; } template<unsigned int N, typename Ca, typename Cb> inline bool maybe_eq (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { static_assert ((N <= 2), "N <= 2"); if (N == 2) return maybe_eq_2 (a.coeffs[0], a.coeffs[1], b.coeffs[0], b.coeffs[1]); return a.coeffs[0] == b.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Cb, bool>::type maybe_eq (const poly_int_pod<N, Ca> &a, const Cb &b) { static_assert ((N <= 2), "N <= 2"); if (N == 2) return maybe_eq_2 (a.coeffs[0], a.coeffs[1], b); return a.coeffs[0] == b; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Ca, bool>::type maybe_eq (const Ca &a, const poly_int_pod<N, Cb> &b) { static_assert ((N <= 2), "N <= 2"); if (N == 2) return maybe_eq_2 (b.coeffs[0], b.coeffs[1], a); return a == b.coeffs[0]; } template<typename Ca, typename Cb> inline typename if_nonpoly2<Ca, Cb, bool>::type maybe_eq (const Ca &a, const Cb &b) { return a == b; } template<unsigned int N, typename Ca, typename Cb> inline bool maybe_ne (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] != b.coeffs[i]) return true; return a.coeffs[0] != b.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Cb, bool>::type maybe_ne (const poly_int_pod<N, Ca> &a, const Cb &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] != 0) return true; return a.coeffs[0] != b; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Ca, bool>::type maybe_ne (const Ca &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (b.coeffs[i] != 0) return true; return a != b.coeffs[0]; } template<typename Ca, typename Cb> inline typename if_nonpoly2<Ca, Cb, bool>::type maybe_ne (const Ca &a, const Cb &b) { return a != b; } # 1312 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline bool maybe_le (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] < b.coeffs[i]) return true; return a.coeffs[0] <= b.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Cb, bool>::type maybe_le (const poly_int_pod<N, Ca> &a, const Cb &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] < 0) return true; return a.coeffs[0] <= b; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Ca, bool>::type maybe_le (const Ca &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (b.coeffs[i] > 0) return true; return a <= b.coeffs[0]; } template<typename Ca, typename Cb> inline typename if_nonpoly2<Ca, Cb, bool>::type maybe_le (const Ca &a, const Cb &b) { return a <= b; } template<unsigned int N, typename Ca, typename Cb> inline bool maybe_lt (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] < b.coeffs[i]) return true; return a.coeffs[0] < b.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Cb, bool>::type maybe_lt (const poly_int_pod<N, Ca> &a, const Cb &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (a.coeffs[i] < 0) return true; return a.coeffs[0] < b; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Ca, bool>::type maybe_lt (const Ca &a, const poly_int_pod<N, Cb> &b) { if (N >= 2) for (unsigned int i = 1; i < N; i++) if (b.coeffs[i] > 0) return true; return a < b.coeffs[0]; } template<typename Ca, typename Cb> inline typename if_nonpoly2<Ca, Cb, bool>::type maybe_lt (const Ca &a, const Cb &b) { return a < b; } # 1414 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<typename T1, typename T2> inline bool ordered_p (const T1 &a, const T2 &b) { return ((poly_int_traits<T1>::num_coeffs == 1 && poly_int_traits<T2>::num_coeffs == 1) || (!maybe_lt (b, a)) || (!maybe_lt (a, b))); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> ordered_min (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if ((!maybe_lt (b, a))) return a; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1439, __FUNCTION__), 0 : 0)); return b; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> ordered_min (const Ca &a, const poly_int_pod<N, Cb> &b) { if ((!maybe_lt (b, a))) return a; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1453, __FUNCTION__), 0 : 0)); return b; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> ordered_min (const poly_int_pod<N, Ca> &a, const Cb &b) { if ((!maybe_lt (b, a))) return a; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1467, __FUNCTION__), 0 : 0)); return b; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> ordered_max (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if ((!maybe_lt (b, a))) return b; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1487, __FUNCTION__), 0 : 0)); return a; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> ordered_max (const Ca &a, const poly_int_pod<N, Cb> &b) { if ((!maybe_lt (b, a))) return b; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1501, __FUNCTION__), 0 : 0)); return a; } } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> ordered_max (const poly_int_pod<N, Ca> &a, const Cb &b) { if ((!maybe_lt (b, a))) return b; else { if (N > 1) ((void)(!((!maybe_lt (a, b))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1515, __FUNCTION__), 0 : 0)); return a; } } template<unsigned int N, typename Ca> inline Ca constant_lower_bound (const poly_int_pod<N, Ca> &a) { ((void)(!((!maybe_lt (a, typename poly_int_traits<Ca>::int_type (0)))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1527, __FUNCTION__), 0 : 0)); return a.coeffs[0]; } template<unsigned int N, typename Ca, typename Cb> inline typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type constant_lower_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b) { if ((!maybe_lt (a, b))) return a.coeffs[0]; return b; } template<unsigned int N, typename Ca, typename Cb> inline typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type constant_upper_bound_with_limit (const poly_int_pod<N, Ca> &a, const Cb &b) { if ((!maybe_lt (b, a))) return a.coeffs[0]; return b; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> lower_bound (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_int_traits<Cb>::int_type ICb; typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((NCa (a.coeffs[0])) < (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (((NCa (a.coeffs[0])) < (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) < (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) < (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> lower_bound (const Ca &a, const poly_int_pod<N, Cb> &b) { return lower_bound (b, a); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> lower_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<Ca, Cb>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) < (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) < (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))))); return r; } template<typename Ca, typename Cb> inline typename poly_result<typename if_nonpoly<Ca>::type, typename if_nonpoly<Cb>::type>::type lower_bound (const Ca &a, const Cb &b) { return a < b ? a : b; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> upper_bound (const poly_int_pod<N, Ca> &a, const Cb &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_int_traits<Cb>::int_type ICb; typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((NCa (a.coeffs[0])) > (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))) : (void) ((r).coeffs[0].~C (), new (&(r).coeffs[0]) C (((NCa (a.coeffs[0])) > (NCb (b)) ? (NCa (a.coeffs[0])) : (NCb (b)))))); if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) > (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) > (ICb (0)) ? (NCa (a.coeffs[i])) : (ICb (0)))))); return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> upper_bound (const Ca &a, const poly_int_pod<N, Cb> &b) { return upper_bound (b, a); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> upper_bound (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<Ca, Cb>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = ((NCa (a.coeffs[i])) > (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (((NCa (a.coeffs[i])) > (NCb (b.coeffs[i])) ? (NCa (a.coeffs[i])) : (NCb (b.coeffs[i])))))); return r; } template<unsigned int N, typename Ca> inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type coeff_gcd (const poly_int_pod<N, Ca> &a) { unsigned int i; for (i = N - 1; i > 0; --i) if (a.coeffs[i] != 0) break; typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type C; C r = a.coeffs[i]; for (unsigned int j = 0; j < i; ++j) if (a.coeffs[j] != 0) r = gcd (r, C (a.coeffs[j])); return r; } template<unsigned int N, typename Ca, typename Cb> poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> common_multiple (const poly_int_pod<N, Ca> &a, Cb b) { typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type xgcd = coeff_gcd (a); return a * (least_common_multiple (xgcd, b) / xgcd); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<typename if_nonpoly<Ca>::type, Cb>::type> common_multiple (const Ca &a, const poly_int_pod<N, Cb> &b) { return common_multiple (b, a); } # 1692 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> poly_int<N, typename poly_result<Ca, Cb>::type> force_common_multiple (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (b.is_constant ()) return common_multiple (a, b.coeffs[0]); if (a.is_constant ()) return common_multiple (a.coeffs[0], b); typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C; typedef typename poly_int_traits<Ca>::int_type ICa; for (unsigned int i = 1; i < N; ++i) if (a.coeffs[i] != ICa (0)) { C lcm = least_common_multiple (NCa (a.coeffs[i]), NCb (b.coeffs[i])); C amul = lcm / a.coeffs[i]; C bmul = lcm / b.coeffs[i]; for (unsigned int j = 0; j < N; ++j) ((void)(!(a.coeffs[j] * amul == b.coeffs[j] * bmul) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1714, __FUNCTION__), 0 : 0)); return a * amul; } (fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1717, __FUNCTION__)); } # 1731 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline int compare_sizes_for_sort (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { for (unsigned int i = N; i-- > 0; ) if (a.coeffs[i] != b.coeffs[i]) return a.coeffs[i] < b.coeffs[i] ? -1 : 1; return 0; } template<unsigned int N, typename Ca, typename Cb> inline bool can_align_p (const poly_int_pod<N, Ca> &value, Cb align) { for (unsigned int i = 1; i < N; i++) if ((value.coeffs[i] & (align - 1)) != 0) return false; return true; } template<unsigned int N, typename Ca, typename Cb> inline bool can_align_up (const poly_int_pod<N, Ca> &value, Cb align, poly_int_pod<N, Ca> *aligned) { if (!can_align_p (value, align)) return false; *aligned = value + (-value.coeffs[0] & (align - 1)); return true; } template<unsigned int N, typename Ca, typename Cb> inline bool can_align_down (const poly_int_pod<N, Ca> &value, Cb align, poly_int_pod<N, Ca> *aligned) { if (!can_align_p (value, align)) return false; *aligned = value - (value.coeffs[0] & (align - 1)); return true; } template<unsigned int N, typename Ca, typename Cb, typename Cc> inline bool known_equal_after_align_up (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cc align) { poly_int<N, Ca> aligned_a; poly_int<N, Cb> aligned_b; return (can_align_up (a, align, &aligned_a) && can_align_up (b, align, &aligned_b) && (!maybe_ne (aligned_a, aligned_b))); } template<unsigned int N, typename Ca, typename Cb, typename Cc> inline bool known_equal_after_align_down (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cc align) { poly_int<N, Ca> aligned_a; poly_int<N, Cb> aligned_b; return (can_align_down (a, align, &aligned_a) && can_align_down (b, align, &aligned_b) && (!maybe_ne (aligned_a, aligned_b))); } # 1823 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> force_align_up (const poly_int_pod<N, Ca> &value, Cb align) { ((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1827, __FUNCTION__), 0 : 0)); return value + (-value.coeffs[0] & (align - 1)); } # 1838 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> force_align_down (const poly_int_pod<N, Ca> &value, Cb align) { ((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1842, __FUNCTION__), 0 : 0)); return value - (value.coeffs[0] & (align - 1)); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> aligned_lower_bound (const poly_int_pod<N, Ca> &value, Cb align) { poly_int<N, Ca> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = (value.coeffs[i] - (value.coeffs[i] & (align - 1)))) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca ((value.coeffs[i] - (value.coeffs[i] & (align - 1)))))) ; return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> aligned_upper_bound (const poly_int_pod<N, Ca> &value, Cb align) { poly_int<N, Ca> r; for (unsigned int i = 0; i < N; i++) ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = (value.coeffs[i] + (-value.coeffs[i] & (align - 1)))) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca ((value.coeffs[i] + (-value.coeffs[i] & (align - 1)))))) ; return r; } # 1886 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> force_align_down_and_div (const poly_int_pod<N, Ca> &value, Cb align) { ((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1890, __FUNCTION__), 0 : 0)); poly_int<N, Ca> r; ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((value.coeffs[0] - (value.coeffs[0] & (align - 1))) / align)) : (void) ((r).coeffs[0].~Ca (), new (&(r).coeffs[0]) Ca (((value.coeffs[0] - (value.coeffs[0] & (align - 1))) / align)))) ; if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = value.coeffs[i] / align) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca (value.coeffs[i] / align))); return r; } # 1910 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, Ca> force_align_up_and_div (const poly_int_pod<N, Ca> &value, Cb align) { ((void)(!(can_align_p (value, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1914, __FUNCTION__), 0 : 0)); poly_int<N, Ca> r; ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[0] = ((value.coeffs[0] + (-value.coeffs[0] & (align - 1))) / align)) : (void) ((r).coeffs[0].~Ca (), new (&(r).coeffs[0]) Ca (((value.coeffs[0] + (-value.coeffs[0] & (align - 1))) / align)))) ; if (N >= 2) for (unsigned int i = 1; i < N; i++) ((void) (&(r).coeffs[0] == (Ca *) 0), wi::int_traits<Ca>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = value.coeffs[i] / align) : (void) ((r).coeffs[i].~Ca (), new (&(r).coeffs[i]) Ca (value.coeffs[i] / align))); return r; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline bool known_misalignment (const poly_int_pod<N, Ca> &value, Cb align, Cm *misalign) { ((void)(!(align != 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1934, __FUNCTION__), 0 : 0)); if (!can_align_p (value, align)) return false; *misalign = value.coeffs[0] & (align - 1); return true; } template<unsigned int N, typename Ca, typename Cb> inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type force_get_misalignment (const poly_int_pod<N, Ca> &a, Cb align) { ((void)(!(can_align_p (a, align)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 1949, __FUNCTION__), 0 : 0)); return a.coeffs[0] & (align - 1); } template<unsigned int N, typename Ca> inline typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type known_alignment (const poly_int_pod<N, Ca> &a) { typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type C; C r = a.coeffs[0]; for (unsigned int i = 1; i < N; ++i) r |= a.coeffs[i]; return r & -r; } template<unsigned int N, typename Ca, typename Cb, typename Cr> inline typename if_nonpoly<Cb, bool>::type can_ior_p (const poly_int_pod<N, Ca> &a, Cb b, Cr *result) { typedef typename poly_int_traits<Ca>::int_type int_type; if (N >= 2) for (unsigned int i = 1; i < N; i++) if ((-(a.coeffs[i] & -a.coeffs[i]) & b) != int_type (0)) return false; *result = a; result->coeffs[0] |= b; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline typename if_nonpoly<Cb, bool>::type constant_multiple_p (const poly_int_pod<N, Ca> &a, Cb b, Cm *multiple) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; if (NCa (a.coeffs[0]) % NCb (b) != 0 || !a.is_constant ()) return false; *multiple = NCa (a.coeffs[0]) / NCb (b); return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline typename if_nonpoly<Ca, bool>::type constant_multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_int_traits<Ca>::int_type int_type; if (NCa (a) % NCb (b.coeffs[0]) != 0 || (a != int_type (0) && !b.is_constant ())) return false; *multiple = NCa (a) / NCb (b.coeffs[0]); return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline bool constant_multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cm *multiple) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_int_traits<Ca>::int_type ICa; typedef typename poly_int_traits<Cb>::int_type ICb; typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C; if (NCa (a.coeffs[0]) % NCb (b.coeffs[0]) != 0) return false; C r = NCa (a.coeffs[0]) / NCb (b.coeffs[0]); for (unsigned int i = 1; i < N; ++i) if (b.coeffs[i] == ICb (0) ? a.coeffs[i] != ICa (0) : (NCa (a.coeffs[i]) % NCb (b.coeffs[i]) != 0 || NCa (a.coeffs[i]) / NCb (b.coeffs[i]) != r)) return false; *multiple = r; return true; } template<typename Ca, typename Cb> inline typename if_nonpoly2<Ca, Cb, bool>::type multiple_p (Ca a, Cb b) { return a % b == 0; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Cb, bool>::type multiple_p (const poly_int_pod<N, Ca> &a, Cb b) { for (unsigned int i = 0; i < N; ++i) if (a.coeffs[i] % b != 0) return false; return true; } template<unsigned int N, typename Ca, typename Cb> inline typename if_nonpoly<Ca, bool>::type multiple_p (Ca a, const poly_int_pod<N, Cb> &b) { typedef typename poly_int_traits<Ca>::int_type int_type; return a % b.coeffs[0] == 0 && (a == int_type (0) || b.is_constant ()); } template<unsigned int N, typename Ca, typename Cb> inline bool multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (b.is_constant ()) return multiple_p (a, b.coeffs[0]); typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Ca>::coeff_type>::type tmp; return constant_multiple_p (a, b, &tmp); } template<typename Ca, typename Cb, typename Cm> inline typename if_nonpoly2<Ca, Cb, bool>::type multiple_p (Ca a, Cb b, Cm *multiple) { if (a % b != 0) return false; *multiple = a / b; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline typename if_nonpoly<Cb, bool>::type multiple_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cm> *multiple) { if (!multiple_p (a, b)) return false; for (unsigned int i = 0; i < N; ++i) multiple->coeffs[i] = a.coeffs[i] / b; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline typename if_nonpoly<Ca, bool>::type multiple_p (Ca a, const poly_int_pod<N, Cb> &b, Cm *multiple) { typedef typename poly_result<Ca, Cb>::cast NCa; if (a % b.coeffs[0] != 0 || (NCa (a) != 0 && !b.is_constant ())) return false; *multiple = a / b.coeffs[0]; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cm> inline bool multiple_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, poly_int_pod<N, Cm> *multiple) { if (b.is_constant ()) return multiple_p (a, b.coeffs[0], multiple); return constant_multiple_p (a, b, multiple); } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type> exact_div (const poly_int_pod<N, Ca> &a, Cb b) { typedef typename poly_result<Ca, typename if_nonpoly<Cb>::type>::type C; poly_int<N, C> r; for (unsigned int i = 0; i < N; i++) { ((void)(!(a.coeffs[i] % b == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2162, __FUNCTION__), 0 : 0)); ((void) (&(r).coeffs[0] == (C *) 0), wi::int_traits<C>::precision_type == wi::FLEXIBLE_PRECISION ? (void) ((r).coeffs[i] = a.coeffs[i] / b) : (void) ((r).coeffs[i].~C (), new (&(r).coeffs[i]) C (a.coeffs[i] / b))); } return r; } template<unsigned int N, typename Ca, typename Cb> inline poly_int<N, typename poly_result<Ca, Cb>::type> exact_div (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b) { if (b.is_constant ()) return exact_div (a, b.coeffs[0]); typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C; typedef typename poly_int_traits<Cb>::int_type int_type; ((void)(!(a.coeffs[0] % b.coeffs[0] == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2182, __FUNCTION__), 0 : 0)); C r = NCa (a.coeffs[0]) / NCb (b.coeffs[0]); for (unsigned int i = 1; i < N; ++i) ((void)(!(b.coeffs[i] == int_type (0) ? a.coeffs[i] == int_type (0) : (a.coeffs[i] % b.coeffs[i] == 0 && NCa (a.coeffs[i]) / NCb (b.coeffs[i]) == r)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h", 2185, __FUNCTION__), 0 : 0)) ; return r; } # 2201 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb, typename Cq> inline typename if_nonpoly2<Cb, Cq, bool>::type can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, Cq *quotient) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; Cq q = NCa (a.coeffs[0]) / NCb (b); if (!a.is_constant ()) return false; *quotient = q; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cq> inline typename if_nonpoly<Cq, bool>::type can_div_trunc_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cq *quotient) { typedef typename poly_result<Ca, Cb>::cast NCa; typedef typename poly_result<Cb, Ca>::cast NCb; typedef typename poly_int_traits<Ca>::int_type ICa; typedef typename poly_int_traits<Cb>::int_type ICb; typedef typename poly_result<typename poly_int_traits<Ca>::coeff_type, typename poly_int_traits<Cb>::coeff_type>::type C; C q = NCa (a.coeffs[0]) / NCb (b.coeffs[0]); # 2277 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" bool rem_p = NCa (a.coeffs[0]) % NCb (b.coeffs[0]) != 0; for (unsigned int i = 1; i < N; ++i) { if (b.coeffs[i] == ICb (0)) { if (a.coeffs[i] != ICa (0)) return false; } else { if (q == 0) { if (a.coeffs[i] != ICa (0)) { C neg_abs_a = (a.coeffs[i] < 0 ? a.coeffs[i] : -a.coeffs[i]); C neg_abs_b = (b.coeffs[i] < 0 ? b.coeffs[i] : -b.coeffs[i]); if (neg_abs_a < neg_abs_b) return false; rem_p = true; } } else { if (NCa (a.coeffs[i]) / NCb (b.coeffs[i]) != q) return false; if (NCa (a.coeffs[i]) % NCb (b.coeffs[i]) != 0) rem_p = true; } } } if (rem_p && (!ordered_p (a, ICa (0)) || !ordered_p (b, ICb (0)))) return false; *quotient = q; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr> inline typename if_nonpoly<Cq, bool>::type can_div_trunc_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cq *quotient, Cr *remainder) { if (!can_div_trunc_p (a, b, quotient)) return false; *remainder = a - *quotient * b; return true; } # 2345 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb, typename Cq> inline typename if_nonpoly<Cb, bool>::type can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cq> *quotient) { for (unsigned int i = 1; i < N; ++i) if (a.coeffs[i] % b != 0) return false; for (unsigned int i = 0; i < N; ++i) quotient->coeffs[i] = a.coeffs[i] / b; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cq, typename Cr> inline typename if_nonpoly<Cb, bool>::type can_div_trunc_p (const poly_int_pod<N, Ca> &a, Cb b, poly_int_pod<N, Cq> *quotient, Cr *remainder) { if (!can_div_trunc_p (a, b, quotient)) return false; *remainder = a.coeffs[0] % b; return true; } template<unsigned int N, typename Ca, typename Cb, typename Cq> inline bool can_div_trunc_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, poly_int_pod<N, Cq> *quotient) { if (b.is_constant ()) return can_div_trunc_p (a, b.coeffs[0], quotient); if (!can_div_trunc_p (a, b, &quotient->coeffs[0])) return false; for (unsigned int i = 1; i < N; ++i) quotient->coeffs[i] = 0; return true; } # 2401 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<unsigned int N, typename Ca, typename Cb, typename Cq> inline typename if_nonpoly<Cq, bool>::type can_div_away_from_zero_p (const poly_int_pod<N, Ca> &a, const poly_int_pod<N, Cb> &b, Cq *quotient) { if (!can_div_trunc_p (a, b, quotient)) return false; if (maybe_ne (*quotient * b, a)) *quotient += (*quotient < 0 ? -1 : 1); return true; } template<unsigned int N, typename C> void print_dec (const poly_int_pod<N, C> &value, FILE *file, signop sgn) { if (value.is_constant ()) print_dec (value.coeffs[0], file, sgn); else { fprintf (file, "["); for (unsigned int i = 0; i < N; ++i) { print_dec (value.coeffs[i], file, sgn); fputc (i == N - 1 ? ']' : ',', file); } } } template<unsigned int N, typename C> void print_dec (const poly_int_pod<N, C> &value, FILE *file) { static_assert ((poly_coeff_traits<C>::signedness >= 0), "poly_coeff_traits<C>::signedness >= 0"); print_dec (value, file, poly_coeff_traits<C>::signedness ? SIGNED : UNSIGNED); } template<unsigned int N, typename C> void print_hex (const poly_int_pod<N, C> &value, FILE *file) { if (value.is_constant ()) print_hex (value.coeffs[0], file); else { fprintf (file, "["); for (unsigned int i = 0; i < N; ++i) { print_hex (value.coeffs[i], file); fputc (i == N - 1 ? ']' : ',', file); } } } # 2482 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" template<typename T1, typename T2, typename Res = typename poly_result<typename poly_int_traits<typename poly_result<typename poly_int_traits<T1>::coeff_type, typename poly_int_traits<T2>::coeff_type>::type>::coeff_type, typename poly_int_traits<unsigned long>::coeff_type>::type > struct poly_span_traits { template<typename T> static const T &cast (const T &x) { return x; } }; template<typename T1, typename T2> struct poly_span_traits<T1, T2, unsigned long> { template<typename T> static typename if_nonpoly<T, unsigned long>::type cast (const T &x) { return x; } template<unsigned int N, typename T> static poly_int<N, unsigned long> cast (const poly_int_pod<N, T> &x) { return x; } }; template<typename T> inline bool known_size_p (const T &a) { return maybe_ne (a, typename poly_int_traits<T>::int_type (-1)); } template<typename T1, typename T2, typename T3> inline bool maybe_in_range_p (const T1 &val, const T2 &pos, const T3 &size) { typedef poly_span_traits<T1, T2> start_span; typedef poly_span_traits<T3, T3> size_span; if ((!maybe_le (pos, val))) return false; if (!known_size_p (size)) return true; if ((poly_int_traits<T1>::num_coeffs > 1 || poly_int_traits<T2>::num_coeffs > 1) && maybe_lt (val, pos)) return true; return maybe_lt (start_span::cast (val) - start_span::cast (pos), size_span::cast (size)); } template<typename T1, typename T2, typename T3> inline bool known_in_range_p (const T1 &val, const T2 &pos, const T3 &size) { typedef poly_span_traits<T1, T2> start_span; typedef poly_span_traits<T3, T3> size_span; return (known_size_p (size) && (!maybe_lt (val, pos)) && (!maybe_le (size_span::cast (size), start_span::cast (val) - start_span::cast (pos))) ); } template<typename T1, typename T2, typename T3, typename T4> inline bool ranges_maybe_overlap_p (const T1 &pos1, const T2 &size1, const T3 &pos2, const T4 &size2) { if (maybe_in_range_p (pos2, pos1, size1)) return maybe_ne (size2, typename poly_int_traits<T4>::int_type (0)); if (maybe_in_range_p (pos1, pos2, size2)) return maybe_ne (size1, typename poly_int_traits<T2>::int_type (0)); return false; } template<typename T1, typename T2, typename T3, typename T4> inline bool ranges_known_overlap_p (const T1 &pos1, const T2 &size1, const T3 &pos2, const T4 &size2) { typedef poly_span_traits<T1, T3> start_span; typedef poly_span_traits<T2, T2> size1_span; typedef poly_span_traits<T4, T4> size2_span; # 2593 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int.h" return (known_size_p (size1) && known_size_p (size2) && (!maybe_le (size1_span::cast (size1), start_span::cast (pos2) - start_span::cast (lower_bound (pos1, pos2)))) && (!maybe_le (size2_span::cast (size2), start_span::cast (pos1) - start_span::cast (lower_bound (pos1, pos2)))) ); } template<typename T1, typename T2, typename T3, typename T4> inline bool known_subrange_p (const T1 &pos1, const T2 &size1, const T3 &pos2, const T4 &size2) { typedef typename poly_int_traits<T2>::coeff_type C2; typedef poly_span_traits<T1, T3> start_span; typedef poly_span_traits<T2, T4> size_span; return ((!maybe_le (size1, typename poly_int_traits<T2>::int_type (0))) && (poly_coeff_traits<C2>::signedness > 0 || known_size_p (size1)) && known_size_p (size2) && (!maybe_lt (pos1, pos2)) && (!maybe_lt (size2, size1)) && (!maybe_lt (size_span::cast (size2) - size_span::cast (size1), start_span::cast (pos1) - start_span::cast (pos2))) ); } template<typename T> inline typename if_nonpoly<T, bool>::type endpoint_representable_p (const T &pos, const T &size) { return (!known_size_p (size) || pos <= poly_coeff_traits<T>::max_value - size); } template<unsigned int N, typename C> inline bool endpoint_representable_p (const poly_int_pod<N, C> &pos, const poly_int_pod<N, C> &size) { if (known_size_p (size)) for (unsigned int i = 0; i < N; ++i) if (pos.coeffs[i] > poly_coeff_traits<C>::max_value - size.coeffs[i]) return false; return true; } template<unsigned int N, typename C> void gt_ggc_mx (poly_int_pod<N, C> *) { } template<unsigned int N, typename C> void gt_pch_nx (poly_int_pod<N, C> *) { } template<unsigned int N, typename C> void gt_pch_nx (poly_int_pod<N, C> *, void (*) (void *, void *), void *) { } # 467 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int-types.h" 1 # 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/poly-int-types.h" typedef poly_int_pod<1, unsigned short> poly_uint16_pod; typedef poly_int_pod<1, long> poly_int64_pod; typedef poly_int_pod<1, unsigned long> poly_uint64_pod; typedef poly_int_pod<1, offset_int> poly_offset_int_pod; typedef poly_int_pod<1, wide_int> poly_wide_int_pod; typedef poly_int_pod<1, widest_int> poly_widest_int_pod; typedef poly_int<1, unsigned short> poly_uint16; typedef poly_int<1, long> poly_int64; typedef poly_int<1, unsigned long> poly_uint64; typedef poly_int<1, offset_int> poly_offset_int; typedef poly_int<1, wide_int> poly_wide_int; typedef poly_int<1, wide_int_ref> poly_wide_int_ref; typedef poly_int<1, widest_int> poly_widest_int; # 468 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "./insn-modes-inline.h" 1 # 10 "./insn-modes-inline.h" inline __attribute__((__always_inline__)) poly_uint16 mode_size_inline (machine_mode mode) { extern poly_uint16_pod mode_size[NUM_MACHINE_MODES]; ((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 18, __FUNCTION__), 0 : 0)); switch (mode) { case E_VOIDmode: return 0; case E_BLKmode: return 0; case E_CCmode: return 4; case E_CCGCmode: return 4; case E_CCGOCmode: return 4; case E_CCNOmode: return 4; case E_CCGZmode: return 4; case E_CCAmode: return 4; case E_CCCmode: return 4; case E_CCOmode: return 4; case E_CCPmode: return 4; case E_CCSmode: return 4; case E_CCZmode: return 4; case E_CCFPmode: return 4; case E_BImode: return 1; case E_QImode: return 1; case E_HImode: return 2; case E_SImode: return 4; case E_DImode: return 8; case E_TImode: return 16; case E_OImode: return 32; case E_XImode: return 64; case E_P2QImode: return 2; case E_P2HImode: return 4; case E_POImode: return 32; case E_QQmode: return 1; case E_HQmode: return 2; case E_SQmode: return 4; case E_DQmode: return 8; case E_TQmode: return 16; case E_UQQmode: return 1; case E_UHQmode: return 2; case E_USQmode: return 4; case E_UDQmode: return 8; case E_UTQmode: return 16; case E_HAmode: return 2; case E_SAmode: return 4; case E_DAmode: return 8; case E_TAmode: return 16; case E_UHAmode: return 2; case E_USAmode: return 4; case E_UDAmode: return 8; case E_UTAmode: return 16; case E_SFmode: return 4; case E_DFmode: return 8; case E_TFmode: return 16; case E_SDmode: return 4; case E_DDmode: return 8; case E_TDmode: return 16; case E_CQImode: return 2; case E_CP2QImode: return 4; case E_CHImode: return 4; case E_CP2HImode: return 8; case E_CSImode: return 8; case E_CDImode: return 16; case E_CTImode: return 32; case E_CPOImode: return 64; case E_COImode: return 64; case E_CXImode: return 128; case E_SCmode: return 8; case E_DCmode: return 16; case E_TCmode: return 32; case E_V2QImode: return 2; case E_V4QImode: return 4; case E_V2HImode: return 4; case E_V1SImode: return 4; case E_V8QImode: return 8; case E_V4HImode: return 8; case E_V2SImode: return 8; case E_V1DImode: return 8; case E_V12QImode: return 12; case E_V6HImode: return 12; case E_V14QImode: return 14; case E_V16QImode: return 16; case E_V8HImode: return 16; case E_V4SImode: return 16; case E_V2DImode: return 16; case E_V1TImode: return 16; case E_V32QImode: return 32; case E_V16HImode: return 32; case E_V8SImode: return 32; case E_V4DImode: return 32; case E_V2TImode: return 32; case E_V64QImode: return 64; case E_V32HImode: return 64; case E_V16SImode: return 64; case E_V8DImode: return 64; case E_V4TImode: return 64; case E_V128QImode: return 128; case E_V64HImode: return 128; case E_V32SImode: return 128; case E_V16DImode: return 128; case E_V8TImode: return 128; case E_V64SImode: return 256; case E_V2SFmode: return 8; case E_V4SFmode: return 16; case E_V2DFmode: return 16; case E_V8SFmode: return 32; case E_V4DFmode: return 32; case E_V2TFmode: return 32; case E_V16SFmode: return 64; case E_V8DFmode: return 64; case E_V4TFmode: return 64; case E_V32SFmode: return 128; case E_V16DFmode: return 128; case E_V8TFmode: return 128; case E_V64SFmode: return 256; case E_V32DFmode: return 256; case E_V16TFmode: return 256; default: return mode_size[mode]; } } inline __attribute__((__always_inline__)) poly_uint16 mode_nunits_inline (machine_mode mode) { extern const poly_uint16_pod mode_nunits[NUM_MACHINE_MODES]; switch (mode) { case E_VOIDmode: return 0; case E_BLKmode: return 0; case E_CCmode: return 1; case E_CCGCmode: return 1; case E_CCGOCmode: return 1; case E_CCNOmode: return 1; case E_CCGZmode: return 1; case E_CCAmode: return 1; case E_CCCmode: return 1; case E_CCOmode: return 1; case E_CCPmode: return 1; case E_CCSmode: return 1; case E_CCZmode: return 1; case E_CCFPmode: return 1; case E_BImode: return 1; case E_QImode: return 1; case E_HImode: return 1; case E_SImode: return 1; case E_DImode: return 1; case E_TImode: return 1; case E_OImode: return 1; case E_XImode: return 1; case E_P2QImode: return 1; case E_P2HImode: return 1; case E_POImode: return 1; case E_QQmode: return 1; case E_HQmode: return 1; case E_SQmode: return 1; case E_DQmode: return 1; case E_TQmode: return 1; case E_UQQmode: return 1; case E_UHQmode: return 1; case E_USQmode: return 1; case E_UDQmode: return 1; case E_UTQmode: return 1; case E_HAmode: return 1; case E_SAmode: return 1; case E_DAmode: return 1; case E_TAmode: return 1; case E_UHAmode: return 1; case E_USAmode: return 1; case E_UDAmode: return 1; case E_UTAmode: return 1; case E_SFmode: return 1; case E_DFmode: return 1; case E_XFmode: return 1; case E_TFmode: return 1; case E_SDmode: return 1; case E_DDmode: return 1; case E_TDmode: return 1; case E_CQImode: return 2; case E_CP2QImode: return 2; case E_CHImode: return 2; case E_CP2HImode: return 2; case E_CSImode: return 2; case E_CDImode: return 2; case E_CTImode: return 2; case E_CPOImode: return 2; case E_COImode: return 2; case E_CXImode: return 2; case E_SCmode: return 2; case E_DCmode: return 2; case E_XCmode: return 2; case E_TCmode: return 2; case E_V2QImode: return 2; case E_V4QImode: return 4; case E_V2HImode: return 2; case E_V1SImode: return 1; case E_V8QImode: return 8; case E_V4HImode: return 4; case E_V2SImode: return 2; case E_V1DImode: return 1; case E_V12QImode: return 12; case E_V6HImode: return 6; case E_V14QImode: return 14; case E_V16QImode: return 16; case E_V8HImode: return 8; case E_V4SImode: return 4; case E_V2DImode: return 2; case E_V1TImode: return 1; case E_V32QImode: return 32; case E_V16HImode: return 16; case E_V8SImode: return 8; case E_V4DImode: return 4; case E_V2TImode: return 2; case E_V64QImode: return 64; case E_V32HImode: return 32; case E_V16SImode: return 16; case E_V8DImode: return 8; case E_V4TImode: return 4; case E_V128QImode: return 128; case E_V64HImode: return 64; case E_V32SImode: return 32; case E_V16DImode: return 16; case E_V8TImode: return 8; case E_V64SImode: return 64; case E_V2SFmode: return 2; case E_V4SFmode: return 4; case E_V2DFmode: return 2; case E_V8SFmode: return 8; case E_V4DFmode: return 4; case E_V2TFmode: return 2; case E_V16SFmode: return 16; case E_V8DFmode: return 8; case E_V4TFmode: return 4; case E_V32SFmode: return 32; case E_V16DFmode: return 16; case E_V8TFmode: return 8; case E_V64SFmode: return 64; case E_V32DFmode: return 32; case E_V16TFmode: return 16; default: return mode_nunits[mode]; } } inline __attribute__((__always_inline__)) unsigned char mode_inner_inline (machine_mode mode) { extern const unsigned char mode_inner[NUM_MACHINE_MODES]; ((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 269, __FUNCTION__), 0 : 0)); switch (mode) { case E_VOIDmode: return E_VOIDmode; case E_BLKmode: return E_BLKmode; case E_CCmode: return E_CCmode; case E_CCGCmode: return E_CCGCmode; case E_CCGOCmode: return E_CCGOCmode; case E_CCNOmode: return E_CCNOmode; case E_CCGZmode: return E_CCGZmode; case E_CCAmode: return E_CCAmode; case E_CCCmode: return E_CCCmode; case E_CCOmode: return E_CCOmode; case E_CCPmode: return E_CCPmode; case E_CCSmode: return E_CCSmode; case E_CCZmode: return E_CCZmode; case E_CCFPmode: return E_CCFPmode; case E_BImode: return E_BImode; case E_QImode: return E_QImode; case E_HImode: return E_HImode; case E_SImode: return E_SImode; case E_DImode: return E_DImode; case E_TImode: return E_TImode; case E_OImode: return E_OImode; case E_XImode: return E_XImode; case E_P2QImode: return E_P2QImode; case E_P2HImode: return E_P2HImode; case E_POImode: return E_POImode; case E_QQmode: return E_QQmode; case E_HQmode: return E_HQmode; case E_SQmode: return E_SQmode; case E_DQmode: return E_DQmode; case E_TQmode: return E_TQmode; case E_UQQmode: return E_UQQmode; case E_UHQmode: return E_UHQmode; case E_USQmode: return E_USQmode; case E_UDQmode: return E_UDQmode; case E_UTQmode: return E_UTQmode; case E_HAmode: return E_HAmode; case E_SAmode: return E_SAmode; case E_DAmode: return E_DAmode; case E_TAmode: return E_TAmode; case E_UHAmode: return E_UHAmode; case E_USAmode: return E_USAmode; case E_UDAmode: return E_UDAmode; case E_UTAmode: return E_UTAmode; case E_SFmode: return E_SFmode; case E_DFmode: return E_DFmode; case E_XFmode: return E_XFmode; case E_TFmode: return E_TFmode; case E_SDmode: return E_SDmode; case E_DDmode: return E_DDmode; case E_TDmode: return E_TDmode; case E_CQImode: return E_QImode; case E_CP2QImode: return E_P2QImode; case E_CHImode: return E_HImode; case E_CP2HImode: return E_P2HImode; case E_CSImode: return E_SImode; case E_CDImode: return E_DImode; case E_CTImode: return E_TImode; case E_CPOImode: return E_POImode; case E_COImode: return E_OImode; case E_CXImode: return E_XImode; case E_SCmode: return E_SFmode; case E_DCmode: return E_DFmode; case E_XCmode: return E_XFmode; case E_TCmode: return E_TFmode; case E_V2QImode: return E_QImode; case E_V4QImode: return E_QImode; case E_V2HImode: return E_HImode; case E_V1SImode: return E_SImode; case E_V8QImode: return E_QImode; case E_V4HImode: return E_HImode; case E_V2SImode: return E_SImode; case E_V1DImode: return E_DImode; case E_V12QImode: return E_QImode; case E_V6HImode: return E_HImode; case E_V14QImode: return E_QImode; case E_V16QImode: return E_QImode; case E_V8HImode: return E_HImode; case E_V4SImode: return E_SImode; case E_V2DImode: return E_DImode; case E_V1TImode: return E_TImode; case E_V32QImode: return E_QImode; case E_V16HImode: return E_HImode; case E_V8SImode: return E_SImode; case E_V4DImode: return E_DImode; case E_V2TImode: return E_TImode; case E_V64QImode: return E_QImode; case E_V32HImode: return E_HImode; case E_V16SImode: return E_SImode; case E_V8DImode: return E_DImode; case E_V4TImode: return E_TImode; case E_V128QImode: return E_QImode; case E_V64HImode: return E_HImode; case E_V32SImode: return E_SImode; case E_V16DImode: return E_DImode; case E_V8TImode: return E_TImode; case E_V64SImode: return E_SImode; case E_V2SFmode: return E_SFmode; case E_V4SFmode: return E_SFmode; case E_V2DFmode: return E_DFmode; case E_V8SFmode: return E_SFmode; case E_V4DFmode: return E_DFmode; case E_V2TFmode: return E_TFmode; case E_V16SFmode: return E_SFmode; case E_V8DFmode: return E_DFmode; case E_V4TFmode: return E_TFmode; case E_V32SFmode: return E_SFmode; case E_V16DFmode: return E_DFmode; case E_V8TFmode: return E_TFmode; case E_V64SFmode: return E_SFmode; case E_V32DFmode: return E_DFmode; case E_V16TFmode: return E_TFmode; default: return mode_inner[mode]; } } inline __attribute__((__always_inline__)) unsigned char mode_unit_size_inline (machine_mode mode) { extern unsigned char mode_unit_size[NUM_MACHINE_MODES]; ((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 396, __FUNCTION__), 0 : 0)); switch (mode) { case E_VOIDmode: return 0; case E_BLKmode: return 0; case E_CCmode: return 4; case E_CCGCmode: return 4; case E_CCGOCmode: return 4; case E_CCNOmode: return 4; case E_CCGZmode: return 4; case E_CCAmode: return 4; case E_CCCmode: return 4; case E_CCOmode: return 4; case E_CCPmode: return 4; case E_CCSmode: return 4; case E_CCZmode: return 4; case E_CCFPmode: return 4; case E_BImode: return 1; case E_QImode: return 1; case E_HImode: return 2; case E_SImode: return 4; case E_DImode: return 8; case E_TImode: return 16; case E_OImode: return 32; case E_XImode: return 64; case E_P2QImode: return 2; case E_P2HImode: return 4; case E_POImode: return 32; case E_QQmode: return 1; case E_HQmode: return 2; case E_SQmode: return 4; case E_DQmode: return 8; case E_TQmode: return 16; case E_UQQmode: return 1; case E_UHQmode: return 2; case E_USQmode: return 4; case E_UDQmode: return 8; case E_UTQmode: return 16; case E_HAmode: return 2; case E_SAmode: return 4; case E_DAmode: return 8; case E_TAmode: return 16; case E_UHAmode: return 2; case E_USAmode: return 4; case E_UDAmode: return 8; case E_UTAmode: return 16; case E_SFmode: return 4; case E_DFmode: return 8; case E_TFmode: return 16; case E_SDmode: return 4; case E_DDmode: return 8; case E_TDmode: return 16; case E_CQImode: return 1; case E_CP2QImode: return 2; case E_CHImode: return 2; case E_CP2HImode: return 4; case E_CSImode: return 4; case E_CDImode: return 8; case E_CTImode: return 16; case E_CPOImode: return 32; case E_COImode: return 32; case E_CXImode: return 64; case E_SCmode: return 4; case E_DCmode: return 8; case E_TCmode: return 16; case E_V2QImode: return 1; case E_V4QImode: return 1; case E_V2HImode: return 2; case E_V1SImode: return 4; case E_V8QImode: return 1; case E_V4HImode: return 2; case E_V2SImode: return 4; case E_V1DImode: return 8; case E_V12QImode: return 1; case E_V6HImode: return 2; case E_V14QImode: return 1; case E_V16QImode: return 1; case E_V8HImode: return 2; case E_V4SImode: return 4; case E_V2DImode: return 8; case E_V1TImode: return 16; case E_V32QImode: return 1; case E_V16HImode: return 2; case E_V8SImode: return 4; case E_V4DImode: return 8; case E_V2TImode: return 16; case E_V64QImode: return 1; case E_V32HImode: return 2; case E_V16SImode: return 4; case E_V8DImode: return 8; case E_V4TImode: return 16; case E_V128QImode: return 1; case E_V64HImode: return 2; case E_V32SImode: return 4; case E_V16DImode: return 8; case E_V8TImode: return 16; case E_V64SImode: return 4; case E_V2SFmode: return 4; case E_V4SFmode: return 4; case E_V2DFmode: return 8; case E_V8SFmode: return 4; case E_V4DFmode: return 8; case E_V2TFmode: return 16; case E_V16SFmode: return 4; case E_V8DFmode: return 8; case E_V4TFmode: return 16; case E_V32SFmode: return 4; case E_V16DFmode: return 8; case E_V8TFmode: return 16; case E_V64SFmode: return 4; case E_V32DFmode: return 8; case E_V16TFmode: return 16; default: return mode_unit_size[mode]; } } inline __attribute__((__always_inline__)) unsigned short mode_unit_precision_inline (machine_mode mode) { extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES]; ((void)(!(mode >= 0 && mode < NUM_MACHINE_MODES) ? fancy_abort ("./insn-modes-inline.h", 521, __FUNCTION__), 0 : 0)); switch (mode) { case E_VOIDmode: return 0; case E_BLKmode: return 0; case E_CCmode: return 4*(8); case E_CCGCmode: return 4*(8); case E_CCGOCmode: return 4*(8); case E_CCNOmode: return 4*(8); case E_CCGZmode: return 4*(8); case E_CCAmode: return 4*(8); case E_CCCmode: return 4*(8); case E_CCOmode: return 4*(8); case E_CCPmode: return 4*(8); case E_CCSmode: return 4*(8); case E_CCZmode: return 4*(8); case E_CCFPmode: return 4*(8); case E_BImode: return 1; case E_QImode: return 1*(8); case E_HImode: return 2*(8); case E_SImode: return 4*(8); case E_DImode: return 8*(8); case E_TImode: return 16*(8); case E_OImode: return 32*(8); case E_XImode: return 64*(8); case E_P2QImode: return 16; case E_P2HImode: return 32; case E_POImode: return 160; case E_QQmode: return 1*(8); case E_HQmode: return 2*(8); case E_SQmode: return 4*(8); case E_DQmode: return 8*(8); case E_TQmode: return 16*(8); case E_UQQmode: return 1*(8); case E_UHQmode: return 2*(8); case E_USQmode: return 4*(8); case E_UDQmode: return 8*(8); case E_UTQmode: return 16*(8); case E_HAmode: return 2*(8); case E_SAmode: return 4*(8); case E_DAmode: return 8*(8); case E_TAmode: return 16*(8); case E_UHAmode: return 2*(8); case E_USAmode: return 4*(8); case E_UDAmode: return 8*(8); case E_UTAmode: return 16*(8); case E_SFmode: return 4*(8); case E_DFmode: return 8*(8); case E_XFmode: return 80; case E_TFmode: return 16*(8); case E_SDmode: return 4*(8); case E_DDmode: return 8*(8); case E_TDmode: return 16*(8); case E_CQImode: return 1*(8); case E_CP2QImode: return 16; case E_CHImode: return 2*(8); case E_CP2HImode: return 32; case E_CSImode: return 4*(8); case E_CDImode: return 8*(8); case E_CTImode: return 16*(8); case E_CPOImode: return 160; case E_COImode: return 32*(8); case E_CXImode: return 64*(8); case E_SCmode: return 4*(8); case E_DCmode: return 8*(8); case E_XCmode: return 80; case E_TCmode: return 16*(8); case E_V2QImode: return 1*(8); case E_V4QImode: return 1*(8); case E_V2HImode: return 2*(8); case E_V1SImode: return 4*(8); case E_V8QImode: return 1*(8); case E_V4HImode: return 2*(8); case E_V2SImode: return 4*(8); case E_V1DImode: return 8*(8); case E_V12QImode: return 1*(8); case E_V6HImode: return 2*(8); case E_V14QImode: return 1*(8); case E_V16QImode: return 1*(8); case E_V8HImode: return 2*(8); case E_V4SImode: return 4*(8); case E_V2DImode: return 8*(8); case E_V1TImode: return 16*(8); case E_V32QImode: return 1*(8); case E_V16HImode: return 2*(8); case E_V8SImode: return 4*(8); case E_V4DImode: return 8*(8); case E_V2TImode: return 16*(8); case E_V64QImode: return 1*(8); case E_V32HImode: return 2*(8); case E_V16SImode: return 4*(8); case E_V8DImode: return 8*(8); case E_V4TImode: return 16*(8); case E_V128QImode: return 1*(8); case E_V64HImode: return 2*(8); case E_V32SImode: return 4*(8); case E_V16DImode: return 8*(8); case E_V8TImode: return 16*(8); case E_V64SImode: return 4*(8); case E_V2SFmode: return 4*(8); case E_V4SFmode: return 4*(8); case E_V2DFmode: return 8*(8); case E_V8SFmode: return 4*(8); case E_V4DFmode: return 8*(8); case E_V2TFmode: return 16*(8); case E_V16SFmode: return 4*(8); case E_V8DFmode: return 8*(8); case E_V4TFmode: return 16*(8); case E_V32SFmode: return 4*(8); case E_V16DFmode: return 8*(8); case E_V8TFmode: return 16*(8); case E_V64SFmode: return 4*(8); case E_V32DFmode: return 8*(8); case E_V16TFmode: return 16*(8); default: return mode_unit_precision[mode]; } } # 469 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" 1 # 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" typedef opt_mode<machine_mode> opt_machine_mode; extern poly_uint16_pod mode_size[NUM_MACHINE_MODES]; extern const poly_uint16_pod mode_precision[NUM_MACHINE_MODES]; extern const unsigned char mode_inner[NUM_MACHINE_MODES]; extern const poly_uint16_pod mode_nunits[NUM_MACHINE_MODES]; extern unsigned char mode_unit_size[NUM_MACHINE_MODES]; extern const unsigned short mode_unit_precision[NUM_MACHINE_MODES]; extern const unsigned char mode_wider[NUM_MACHINE_MODES]; extern const unsigned char mode_2xwider[NUM_MACHINE_MODES]; template<typename T> struct mode_traits { # 68 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" enum from_int { dummy = MAX_MACHINE_MODE }; }; template<> struct mode_traits<machine_mode> { typedef machine_mode from_int; }; # 89 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" extern const char * const mode_name[NUM_MACHINE_MODES]; # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mode-classes.def" 1 # 95 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" 2 enum mode_class { MODE_RANDOM, MODE_CC, MODE_INT, MODE_PARTIAL_INT, MODE_FRACT, MODE_UFRACT, MODE_ACCUM, MODE_UACCUM, MODE_FLOAT, MODE_DECIMAL_FLOAT, MODE_COMPLEX_INT, MODE_COMPLEX_FLOAT, MODE_VECTOR_BOOL, MODE_VECTOR_INT, MODE_VECTOR_FRACT, MODE_VECTOR_UFRACT, MODE_VECTOR_ACCUM, MODE_VECTOR_UACCUM, MODE_VECTOR_FLOAT, MAX_MODE_CLASS }; extern const unsigned char mode_class[NUM_MACHINE_MODES]; # 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" template<typename T> class opt_mode { public: enum from_int { dummy = MAX_MACHINE_MODE }; inline __attribute__ ((always_inline)) constexpr opt_mode () : m_mode (E_VOIDmode) {} inline __attribute__ ((always_inline)) constexpr opt_mode (const T &m) : m_mode (m) {} template<typename U> inline __attribute__ ((always_inline)) constexpr opt_mode (const U &m) : m_mode (T (m)) {} inline __attribute__ ((always_inline)) constexpr opt_mode (from_int m) : m_mode (machine_mode (m)) {} machine_mode else_void () const; machine_mode else_blk () const { return else_mode (((void) 0, E_BLKmode)); } machine_mode else_mode (machine_mode) const; T require () const; bool exists () const; template<typename U> bool exists (U *) const; bool operator== (const T &m) const { return m_mode == m; } bool operator!= (const T &m) const { return m_mode != m; } private: machine_mode m_mode; }; template<typename T> inline __attribute__ ((always_inline)) machine_mode opt_mode<T>::else_void () const { return m_mode; } template<typename T> inline machine_mode opt_mode<T>::else_mode (machine_mode fallback) const { return m_mode == E_VOIDmode ? fallback : m_mode; } template<typename T> inline T opt_mode<T>::require () const { ((void)(!(m_mode != E_VOIDmode) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h", 293, __FUNCTION__), 0 : 0)); return typename mode_traits<T>::from_int (m_mode); } template<typename T> inline __attribute__ ((always_inline)) bool opt_mode<T>::exists () const { return m_mode != E_VOIDmode; } template<typename T> template<typename U> inline bool opt_mode<T>::exists (U *mode) const { if (m_mode != E_VOIDmode) { *mode = T (typename mode_traits<T>::from_int (m_mode)); return true; } return false; } template<typename T> struct pod_mode { typedef typename mode_traits<T>::from_int from_int; typedef typename T::measurement_type measurement_type; machine_mode m_mode; inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } inline __attribute__ ((always_inline)) constexpr operator T () const { return from_int (m_mode); } inline __attribute__ ((always_inline)) pod_mode &operator = (const T &m) { m_mode = m; return *this; } }; template<typename T> inline bool is_a (machine_mode m) { return T::includes_p (m); } template<typename T, typename U> inline bool is_a (const opt_mode<U> &m) { return T::includes_p (m.else_void ()); } template<typename T> inline T as_a (machine_mode m) { ((void)(!(T::includes_p (m)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h", 361, __FUNCTION__), 0 : 0)); return typename mode_traits<T>::from_int (m); } template<typename T, typename U> inline T as_a (const opt_mode<U> &m) { return as_a <T> (m.else_void ()); } template<typename T> inline opt_mode<T> dyn_cast (machine_mode m) { if (T::includes_p (m)) return T (typename mode_traits<T>::from_int (m)); return opt_mode<T> (); } template<typename T, typename U> inline opt_mode<T> dyn_cast (const opt_mode<U> &m) { return dyn_cast <T> (m.else_void ()); } template<typename T, typename U> inline bool is_a (machine_mode m, U *result) { if (T::includes_p (m)) { *result = T (typename mode_traits<T>::from_int (m)); return true; } return false; } class scalar_int_mode { public: typedef mode_traits<scalar_int_mode>::from_int from_int; typedef unsigned short measurement_type; inline __attribute__ ((always_inline)) scalar_int_mode () {} inline __attribute__ ((always_inline)) constexpr scalar_int_mode (from_int m) : m_mode (machine_mode (m)) {} inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } static bool includes_p (machine_mode); protected: machine_mode m_mode; }; inline bool scalar_int_mode::includes_p (machine_mode m) { return (((enum mode_class) mode_class[m]) == MODE_INT || ((enum mode_class) mode_class[m]) == MODE_PARTIAL_INT); } class scalar_float_mode { public: typedef mode_traits<scalar_float_mode>::from_int from_int; typedef unsigned short measurement_type; inline __attribute__ ((always_inline)) scalar_float_mode () {} inline __attribute__ ((always_inline)) constexpr scalar_float_mode (from_int m) : m_mode (machine_mode (m)) {} inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } static bool includes_p (machine_mode); protected: machine_mode m_mode; }; inline bool scalar_float_mode::includes_p (machine_mode m) { return (((enum mode_class) mode_class[m]) == MODE_FLOAT || ((enum mode_class) mode_class[m]) == MODE_DECIMAL_FLOAT); } class scalar_mode { public: typedef mode_traits<scalar_mode>::from_int from_int; typedef unsigned short measurement_type; inline __attribute__ ((always_inline)) scalar_mode () {} inline __attribute__ ((always_inline)) constexpr scalar_mode (from_int m) : m_mode (machine_mode (m)) {} inline __attribute__ ((always_inline)) constexpr scalar_mode (const scalar_int_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr scalar_mode (const scalar_float_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr scalar_mode (const scalar_int_mode_pod &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } static bool includes_p (machine_mode); protected: machine_mode m_mode; }; inline bool scalar_mode::includes_p (machine_mode m) { switch (((enum mode_class) mode_class[m])) { case MODE_INT: case MODE_PARTIAL_INT: case MODE_FRACT: case MODE_UFRACT: case MODE_ACCUM: case MODE_UACCUM: case MODE_FLOAT: case MODE_DECIMAL_FLOAT: return true; default: return false; } } class complex_mode { public: typedef mode_traits<complex_mode>::from_int from_int; typedef unsigned short measurement_type; inline __attribute__ ((always_inline)) complex_mode () {} inline __attribute__ ((always_inline)) constexpr complex_mode (from_int m) : m_mode (machine_mode (m)) {} inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } static bool includes_p (machine_mode); protected: machine_mode m_mode; }; inline bool complex_mode::includes_p (machine_mode m) { return (((enum mode_class) mode_class[m]) == MODE_COMPLEX_INT || ((enum mode_class) mode_class[m]) == MODE_COMPLEX_FLOAT); } inline __attribute__ ((always_inline)) poly_uint16 mode_to_bytes (machine_mode mode) { return (__builtin_constant_p (mode) ? mode_size_inline (mode) : mode_size[mode]); } inline __attribute__ ((always_inline)) poly_uint16 mode_to_bits (machine_mode mode) { return mode_to_bytes (mode) * (8); } inline __attribute__ ((always_inline)) poly_uint16 mode_to_precision (machine_mode mode) { return mode_precision[mode]; } inline __attribute__ ((always_inline)) scalar_mode mode_to_inner (machine_mode mode) { return scalar_mode::from_int (__builtin_constant_p (mode) ? mode_inner_inline (mode) : mode_inner[mode]); } inline __attribute__ ((always_inline)) unsigned char mode_to_unit_size (machine_mode mode) { return (__builtin_constant_p (mode) ? mode_unit_size_inline (mode) : mode_unit_size[mode]); } inline __attribute__ ((always_inline)) unsigned short mode_to_unit_precision (machine_mode mode) { return (__builtin_constant_p (mode) ? mode_unit_precision_inline (mode) : mode_unit_precision[mode]); } inline __attribute__ ((always_inline)) poly_uint16 mode_to_nunits (machine_mode mode) { return (__builtin_constant_p (mode) ? mode_nunits_inline (mode) : mode_nunits[mode]); } inline __attribute__ ((always_inline)) poly_uint16 GET_MODE_SIZE (machine_mode mode) { return mode_to_bytes (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type GET_MODE_SIZE (const T &mode) { return mode_to_bytes (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type GET_MODE_SIZE (const T &mode) { return mode_to_bytes (mode).coeffs[0]; } inline __attribute__ ((always_inline)) poly_uint16 GET_MODE_BITSIZE (machine_mode mode) { return mode_to_bits (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type GET_MODE_BITSIZE (const T &mode) { return mode_to_bits (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type GET_MODE_BITSIZE (const T &mode) { return mode_to_bits (mode).coeffs[0]; } # 679 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" inline __attribute__ ((always_inline)) poly_uint16 GET_MODE_PRECISION (machine_mode mode) { return mode_to_precision (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type GET_MODE_PRECISION (const T &mode) { return mode_to_precision (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type GET_MODE_PRECISION (const T &mode) { return mode_to_precision (mode).coeffs[0]; } extern const unsigned char mode_ibit[NUM_MACHINE_MODES]; extern const unsigned char mode_fbit[NUM_MACHINE_MODES]; extern const unsigned long mode_mask_array[NUM_MACHINE_MODES]; # 737 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" inline __attribute__ ((always_inline)) poly_uint16 GET_MODE_NUNITS (machine_mode mode) { return mode_to_nunits (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_poly<typename T::measurement_type>::type GET_MODE_NUNITS (const T &mode) { return mode_to_nunits (mode); } template<typename T> inline __attribute__ ((always_inline)) typename if_nonpoly<typename T::measurement_type>::type GET_MODE_NUNITS (const T &mode) { return mode_to_nunits (mode).coeffs[0]; } template<typename T> inline __attribute__ ((always_inline)) opt_mode<T> GET_MODE_WIDER_MODE (const T &m) { return typename opt_mode<T>::from_int (mode_wider[m]); } template<typename T> inline __attribute__ ((always_inline)) opt_mode<T> GET_MODE_2XWIDER_MODE (const T &m) { return typename opt_mode<T>::from_int (mode_2xwider[m]); } extern const unsigned char mode_complex[NUM_MACHINE_MODES]; class fixed_size_mode { public: typedef mode_traits<fixed_size_mode>::from_int from_int; typedef unsigned short measurement_type; inline __attribute__ ((always_inline)) fixed_size_mode () {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (from_int m) : m_mode (machine_mode (m)) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const scalar_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const scalar_int_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const scalar_float_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const scalar_mode_pod &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const scalar_int_mode_pod &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr fixed_size_mode (const complex_mode &m) : m_mode (m) {} inline __attribute__ ((always_inline)) constexpr operator machine_mode () const { return m_mode; } static bool includes_p (machine_mode); protected: machine_mode m_mode; }; inline bool fixed_size_mode::includes_p (machine_mode mode) { return mode_to_bytes (mode).is_constant (); } # 841 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" extern opt_machine_mode mode_for_size (poly_uint64, enum mode_class, int); inline opt_scalar_int_mode int_mode_for_size (poly_uint64 size, int limit) { return dyn_cast <scalar_int_mode> (mode_for_size (size, MODE_INT, limit)); } inline opt_scalar_float_mode float_mode_for_size (poly_uint64 size) { return dyn_cast <scalar_float_mode> (mode_for_size (size, MODE_FLOAT, 0)); } inline opt_scalar_float_mode decimal_float_mode_for_size (unsigned int size) { return dyn_cast <scalar_float_mode> (mode_for_size (size, MODE_DECIMAL_FLOAT, 0)); } extern machine_mode smallest_mode_for_size (poly_uint64, enum mode_class); inline scalar_int_mode smallest_int_mode_for_size (poly_uint64 size) { return as_a <scalar_int_mode> (smallest_mode_for_size (size, MODE_INT)); } extern opt_scalar_int_mode int_mode_for_mode (machine_mode); extern opt_machine_mode bitwise_mode_for_mode (machine_mode); extern opt_machine_mode mode_for_vector (scalar_mode, poly_uint64); extern opt_machine_mode related_vector_mode (machine_mode, scalar_mode, poly_uint64 = 0); extern opt_machine_mode related_int_vector_mode (machine_mode); class bit_field_mode_iterator { public: bit_field_mode_iterator (long, long, poly_int64, poly_int64, unsigned int, bool); bool next_mode (scalar_int_mode *); bool prefer_smaller_modes (); private: opt_scalar_int_mode m_mode; long m_bitsize; long m_bitpos; poly_int64 m_bitregion_start; poly_int64 m_bitregion_end; unsigned int m_align; bool m_volatilep; int m_count; }; extern bool get_best_mode (int, int, poly_uint64, poly_uint64, unsigned int, unsigned long, bool, scalar_int_mode *); extern unsigned short mode_base_align[NUM_MACHINE_MODES]; extern unsigned get_mode_alignment (machine_mode); extern const unsigned char class_narrowest_mode[MAX_MODE_CLASS]; # 939 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" template<typename T> inline T get_narrowest_mode (T mode) { return typename mode_traits<T>::from_int (class_narrowest_mode[((enum mode_class) mode_class[mode])]); } extern scalar_int_mode byte_mode; extern scalar_int_mode word_mode; extern scalar_int_mode ptr_mode; extern void init_adjust_machine_modes (void); # 964 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" inline bool HWI_COMPUTABLE_MODE_P (machine_mode mode) { machine_mode mme = mode; return ((((enum mode_class) mode_class[mme]) == MODE_INT || ((enum mode_class) mode_class[mme]) == MODE_PARTIAL_INT) && mode_to_precision (mme).coeffs[0] <= 64); } inline bool HWI_COMPUTABLE_MODE_P (scalar_int_mode mode) { return GET_MODE_PRECISION (mode) <= 64; } struct int_n_data_t { unsigned int bitsize; scalar_int_mode_pod m; }; extern bool int_n_enabled_p[1]; extern const int_n_data_t int_n_data[1]; template<typename T> inline bool is_int_mode (machine_mode mode, T *int_mode) { if (((enum mode_class) mode_class[mode]) == MODE_INT) { *int_mode = scalar_int_mode (scalar_int_mode::from_int (mode)); return true; } return false; } template<typename T> inline bool is_float_mode (machine_mode mode, T *float_mode) { if (((enum mode_class) mode_class[mode]) == MODE_FLOAT) { *float_mode = scalar_float_mode (scalar_float_mode::from_int (mode)); return true; } return false; } template<typename T> inline bool is_complex_int_mode (machine_mode mode, T *cmode) { if (((enum mode_class) mode_class[mode]) == MODE_COMPLEX_INT) { *cmode = complex_mode (complex_mode::from_int (mode)); return true; } return false; } template<typename T> inline bool is_complex_float_mode (machine_mode mode, T *cmode) { if (((enum mode_class) mode_class[mode]) == MODE_COMPLEX_FLOAT) { *cmode = complex_mode (complex_mode::from_int (mode)); return true; } return false; } inline bool is_narrower_int_mode (machine_mode mode, scalar_int_mode limit) { scalar_int_mode int_mode; return (is_a <scalar_int_mode> (mode, &int_mode) && GET_MODE_PRECISION (int_mode) < GET_MODE_PRECISION (limit)); } namespace mode_iterator { template<typename T> inline void start (opt_mode<T> *iter, enum mode_class mclass) { if (((machine_mode) class_narrowest_mode[mclass]) == E_VOIDmode) *iter = opt_mode<T> (); else *iter = as_a<T> (((machine_mode) class_narrowest_mode[mclass])); } inline void start (machine_mode *iter, enum mode_class mclass) { *iter = ((machine_mode) class_narrowest_mode[mclass]); } template<typename T> inline bool iterate_p (opt_mode<T> *iter) { return iter->exists (); } inline bool iterate_p (machine_mode *iter) { return *iter != E_VOIDmode; } template<typename T> inline void get_wider (opt_mode<T> *iter) { *iter = GET_MODE_WIDER_MODE (iter->require ()); } inline void get_wider (machine_mode *iter) { *iter = GET_MODE_WIDER_MODE (*iter).else_void (); } template<typename T> inline void get_known_wider (T *iter) { *iter = GET_MODE_WIDER_MODE (*iter).require (); } template<typename T> inline void get_2xwider (opt_mode<T> *iter) { *iter = GET_MODE_2XWIDER_MODE (iter->require ()); } inline void get_2xwider (machine_mode *iter) { *iter = GET_MODE_2XWIDER_MODE (*iter).else_void (); } } # 1183 "/home/giulianob/gcc_git_gnu/gcc/gcc/machmode.h" template<typename T> void gt_ggc_mx (pod_mode<T> *) { } template<typename T> void gt_pch_nx (pod_mode<T> *) { } template<typename T> void gt_pch_nx (pod_mode<T> *, void (*) (void *, void *), void *) { } # 470 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" 1 # 49 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" struct double_int { static double_int from_uhwi (unsigned long cst); static double_int from_shwi (long cst); static double_int from_pair (long high, unsigned long low); static double_int from_buffer (const unsigned char *buffer, int len); static double_int mask (unsigned prec); static double_int max_value (unsigned int prec, bool uns); static double_int min_value (unsigned int prec, bool uns); double_int &operator ++ (); double_int &operator -- (); double_int &operator *= (double_int); double_int &operator += (double_int); double_int &operator -= (double_int); double_int &operator &= (double_int); double_int &operator ^= (double_int); double_int &operator |= (double_int); long to_shwi () const; unsigned long to_uhwi () const; bool fits_uhwi () const; bool fits_shwi () const; bool fits_hwi (bool uns) const; int trailing_zeros () const; int popcount () const; bool multiple_of (double_int, bool, double_int *) const; double_int set_bit (unsigned) const; double_int mul_with_sign (double_int, bool unsigned_p, bool *overflow) const; double_int wide_mul_with_sign (double_int, bool unsigned_p, double_int *higher, bool *overflow) const; double_int add_with_sign (double_int, bool unsigned_p, bool *overflow) const; double_int sub_with_overflow (double_int, bool *overflow) const; double_int neg_with_overflow (bool *overflow) const; double_int operator * (double_int) const; double_int operator + (double_int) const; double_int operator - (double_int) const; double_int operator - () const; double_int operator ~ () const; double_int operator & (double_int) const; double_int operator | (double_int) const; double_int operator ^ (double_int) const; double_int and_not (double_int) const; double_int lshift (long count) const; double_int lshift (long count, unsigned int prec, bool arith) const; double_int rshift (long count) const; double_int rshift (long count, unsigned int prec, bool arith) const; double_int alshift (long count, unsigned int prec) const; double_int arshift (long count, unsigned int prec) const; double_int llshift (long count, unsigned int prec) const; double_int lrshift (long count, unsigned int prec) const; double_int lrotate (long count, unsigned int prec) const; double_int rrotate (long count, unsigned int prec) const; double_int div (double_int, bool, unsigned) const; double_int sdiv (double_int, unsigned) const; double_int udiv (double_int, unsigned) const; double_int mod (double_int, bool, unsigned) const; double_int smod (double_int, unsigned) const; double_int umod (double_int, unsigned) const; double_int divmod_with_overflow (double_int, bool, unsigned, double_int *, bool *) const; double_int divmod (double_int, bool, unsigned, double_int *) const; double_int sdivmod (double_int, unsigned, double_int *) const; double_int udivmod (double_int, unsigned, double_int *) const; double_int ext (unsigned prec, bool uns) const; double_int zext (unsigned prec) const; double_int sext (unsigned prec) const; bool is_zero () const; bool is_one () const; bool is_minus_one () const; bool is_negative () const; int cmp (double_int b, bool uns) const; int ucmp (double_int b) const; int scmp (double_int b) const; bool ult (double_int b) const; bool ule (double_int b) const; bool ugt (double_int b) const; bool slt (double_int b) const; bool sle (double_int b) const; bool sgt (double_int b) const; double_int max (double_int b, bool uns); double_int smax (double_int b); double_int umax (double_int b); double_int min (double_int b, bool uns); double_int smin (double_int b); double_int umin (double_int b); bool operator == (double_int cst2) const; bool operator != (double_int cst2) const; unsigned long low; long high; }; # 207 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" inline double_int double_int::from_shwi (long cst) { double_int r; r.low = (unsigned long) cst; r.high = cst < 0 ? -1 : 0; return r; } # 230 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" inline double_int double_int::from_uhwi (unsigned long cst) { double_int r; r.low = cst; r.high = 0; return r; } inline double_int double_int::from_pair (long high, unsigned long low) { double_int r; r.low = low; r.high = high; return r; } inline double_int & double_int::operator ++ () { *this += (double_int::from_shwi (1)); return *this; } inline double_int & double_int::operator -- () { *this -= (double_int::from_shwi (1)); return *this; } inline double_int & double_int::operator &= (double_int b) { *this = *this & b; return *this; } inline double_int & double_int::operator ^= (double_int b) { *this = *this ^ b; return *this; } inline double_int & double_int::operator |= (double_int b) { *this = *this | b; return *this; } inline long double_int::to_shwi () const { return (long) low; } inline unsigned long double_int::to_uhwi () const { return low; } inline bool double_int::fits_uhwi () const { return high == 0; } inline double_int double_int::operator ~ () const { double_int result; result.low = ~low; result.high = ~high; return result; } inline double_int double_int::operator | (double_int b) const { double_int result; result.low = low | b.low; result.high = high | b.high; return result; } inline double_int double_int::operator & (double_int b) const { double_int result; result.low = low & b.low; result.high = high & b.high; return result; } inline double_int double_int::and_not (double_int b) const { double_int result; result.low = low & ~b.low; result.high = high & ~b.high; return result; } inline double_int double_int::operator ^ (double_int b) const { double_int result; result.low = low ^ b.low; result.high = high ^ b.high; return result; } void dump_double_int (FILE *, double_int, bool); # 376 "/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h" inline bool double_int::is_zero () const { return low == 0 && high == 0; } inline bool double_int::is_one () const { return low == 1 && high == 0; } inline bool double_int::is_minus_one () const { return low == -1UL && high == -1; } inline bool double_int::is_negative () const { return high < 0; } inline bool double_int::operator == (double_int cst2) const { return low == cst2.low && high == cst2.high; } inline bool double_int::operator != (double_int cst2) const { return low != cst2.low || high != cst2.high; } inline int double_int::popcount () const { return popcount_hwi (high) + popcount_hwi (low); } void mpz_set_double_int (mpz_t, double_int, bool); double_int mpz_get_double_int (const_tree, mpz_t, bool); namespace wi { template <> struct int_traits <double_int> { static const enum precision_type precision_type = CONST_PRECISION; static const bool host_dependent_precision = true; static const unsigned int precision = (2 * 64); static unsigned int get_precision (const double_int &); static wi::storage_ref decompose (long *, unsigned int, const double_int &); }; } inline unsigned int wi::int_traits <double_int>::get_precision (const double_int &) { return precision; } inline wi::storage_ref wi::int_traits <double_int>::decompose (long *scratch, unsigned int p, const double_int &x) { ((void)(!(precision == p) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/double-int.h", 462, __FUNCTION__), 0 : 0)); scratch[0] = x.low; if ((x.high == 0 && scratch[0] >= 0) || (x.high == -1 && scratch[0] < 0)) return wi::storage_ref (scratch, 1, precision); scratch[1] = x.high; return wi::storage_ref (scratch, 2, precision); } # 471 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/align.h" 1 # 22 "/home/giulianob/gcc_git_gnu/gcc/gcc/align.h" struct align_flags_tuple { int log; int maxskip; void normalize () { int n = (1 << log); if (maxskip > n) maxskip = n - 1; } int get_value () { return maxskip + 1; } }; class align_flags { public: align_flags (int log0 = 0, int maxskip0 = 0, int log1 = 0, int maxskip1 = 0) { levels[0].log = log0; levels[0].maxskip = maxskip0; levels[1].log = log1; levels[1].maxskip = maxskip1; normalize (); } void normalize () { for (unsigned i = 0; i < 2; i++) levels[i].normalize (); } static align_flags max (const align_flags f0, const align_flags f1) { int log0 = ((f0.levels[0].log) > (f1.levels[0].log) ? (f0.levels[0].log) : (f1.levels[0].log)); int maxskip0 = ((f0.levels[0].maxskip) > (f1.levels[0].maxskip) ? (f0.levels[0].maxskip) : (f1.levels[0].maxskip)); int log1 = ((f0.levels[1].log) > (f1.levels[1].log) ? (f0.levels[1].log) : (f1.levels[1].log)); int maxskip1 = ((f0.levels[1].maxskip) > (f1.levels[1].maxskip) ? (f0.levels[1].maxskip) : (f1.levels[1].maxskip)); return align_flags (log0, maxskip0, log1, maxskip1); } align_flags_tuple levels[2]; }; # 472 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" 1 # 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" enum real_value_class { rvc_zero, rvc_normal, rvc_inf, rvc_nan }; struct real_value { unsigned int cl : 2; unsigned int decimal : 1; unsigned int sign : 1; unsigned int signalling : 1; unsigned int canonical : 1; unsigned int uexp : (32 - 6); unsigned long sig[((128 + (8 * 8)) / (8 * 8))]; }; # 80 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" extern char test_real_width [sizeof (struct real_value) <= (((128 + (8 * 8)) + 32)/64 + (((128 + (8 * 8)) + 32)%64 ? 1 : 0)) * sizeof (long) ? 1 : -1]; # 118 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" struct real_format { void (*encode) (const struct real_format *, long *, const struct real_value *); void (*decode) (const struct real_format *, struct real_value *, const long *); int b; int p; int pnan; int emin; int emax; int signbit_ro; int signbit_rw; # 158 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" int ieee_bits; bool round_towards_zero; bool has_sign_dependent_rounding; bool has_nans; bool has_inf; bool has_denorm; bool has_signed_zero; bool qnan_msb_set; bool canonical_nan_lsbs_set; const char *name; }; extern const struct real_format * real_format_for_mode[MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1 + MAX_MODE_DECIMAL_FLOAT - MIN_MODE_DECIMAL_FLOAT + 1]; # 217 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" class format_helper { public: format_helper (const real_format *format) : m_format (format) {} template<typename T> format_helper (const T &); const real_format *operator-> () const { return m_format; } operator const real_format *() const { return m_format; } bool decimal_p () const { return m_format && m_format->b == 10; } bool can_represent_integral_type_p (tree type) const; private: const real_format *m_format; }; template<typename T> inline format_helper::format_helper (const T &m) : m_format (m == ((void) 0, E_VOIDmode) ? 0 : (real_format_for_mode[(((enum mode_class) mode_class[m]) == MODE_DECIMAL_FLOAT) ? (((m) - MIN_MODE_DECIMAL_FLOAT) + (MAX_MODE_FLOAT - MIN_MODE_FLOAT + 1)) : ((enum mode_class) mode_class[m]) == MODE_FLOAT ? ((m) - MIN_MODE_FLOAT) : ((fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/real.h", 234, __FUNCTION__)), 0)])) {} # 244 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" extern bool HONOR_NANS (machine_mode); extern bool HONOR_NANS (const_tree); extern bool HONOR_NANS (const_rtx); extern bool HONOR_SNANS (machine_mode); extern bool HONOR_SNANS (const_tree); extern bool HONOR_SNANS (const_rtx); extern bool HONOR_INFINITIES (machine_mode); extern bool HONOR_INFINITIES (const_tree); extern bool HONOR_INFINITIES (const_rtx); extern bool HONOR_SIGNED_ZEROS (machine_mode); extern bool HONOR_SIGNED_ZEROS (const_tree); extern bool HONOR_SIGNED_ZEROS (const_rtx); extern bool HONOR_SIGN_DEPENDENT_ROUNDING (machine_mode); extern bool HONOR_SIGN_DEPENDENT_ROUNDING (const_tree); extern bool HONOR_SIGN_DEPENDENT_ROUNDING (const_rtx); extern bool real_arithmetic (struct real_value *, int, const struct real_value *, const struct real_value *); extern bool real_compare (int, const struct real_value *, const struct real_value *); extern bool real_isinf (const struct real_value *); extern bool real_isnan (const struct real_value *); extern bool real_issignaling_nan (const struct real_value *); extern bool real_isfinite (const struct real_value *); extern bool real_isneg (const struct real_value *); extern bool real_isnegzero (const struct real_value *); extern bool real_identical (const struct real_value *, const struct real_value *); extern bool real_equal (const struct real_value *, const struct real_value *); extern bool real_less (const struct real_value *, const struct real_value *); extern void real_convert (struct real_value *, format_helper, const struct real_value *); extern bool exact_real_truncate (format_helper, const struct real_value *); extern void real_to_decimal (char *, const struct real_value *, size_t, size_t, int); extern void real_to_decimal_for_mode (char *, const struct real_value *, size_t, size_t, int, machine_mode); extern void real_to_hexadecimal (char *, const struct real_value *, size_t, size_t, int); extern long real_to_integer (const struct real_value *); extern int real_from_string (struct real_value *, const char *); extern void real_from_string3 (struct real_value *, const char *, format_helper); extern long real_to_target (long *, const struct real_value *, format_helper); extern void real_from_target (struct real_value *, const long *, format_helper); extern void real_inf (struct real_value *); extern bool real_nan (struct real_value *, const char *, int, format_helper); extern void real_maxval (struct real_value *, int, machine_mode); extern void real_2expN (struct real_value *, int, format_helper); extern unsigned int real_hash (const struct real_value *); extern const struct real_format ieee_single_format; extern const struct real_format mips_single_format; extern const struct real_format motorola_single_format; extern const struct real_format spu_single_format; extern const struct real_format ieee_double_format; extern const struct real_format mips_double_format; extern const struct real_format motorola_double_format; extern const struct real_format ieee_extended_motorola_format; extern const struct real_format ieee_extended_intel_96_format; extern const struct real_format ieee_extended_intel_96_round_53_format; extern const struct real_format ieee_extended_intel_128_format; extern const struct real_format ibm_extended_format; extern const struct real_format mips_extended_format; extern const struct real_format ieee_quad_format; extern const struct real_format mips_quad_format; extern const struct real_format vax_f_format; extern const struct real_format vax_d_format; extern const struct real_format vax_g_format; extern const struct real_format real_internal_format; extern const struct real_format decimal_single_format; extern const struct real_format decimal_double_format; extern const struct real_format decimal_quad_format; extern const struct real_format ieee_half_format; extern const struct real_format arm_half_format; extern const struct real_format arm_bfloat_half_format; # 418 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" extern struct real_value real_value_truncate (format_helper, struct real_value); extern struct real_value real_value_negate (const struct real_value *); extern struct real_value real_value_abs (const struct real_value *); extern int significand_size (format_helper); extern struct real_value real_from_string2 (const char *, format_helper); # 443 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" extern int real_exponent (const struct real_value *); extern void real_ldexp (struct real_value *, const struct real_value *, int); extern struct real_value dconst0; extern struct real_value dconst1; extern struct real_value dconst2; extern struct real_value dconstm1; extern struct real_value dconsthalf; # 466 "/home/giulianob/gcc_git_gnu/gcc/gcc/real.h" extern const struct real_value * dconst_e_ptr (void); extern const struct real_value *dconst_third_ptr (void); extern const struct real_value *dconst_quarter_ptr (void); extern const struct real_value *dconst_sixth_ptr (void); extern const struct real_value *dconst_ninth_ptr (void); extern const struct real_value * dconst_sqrt2_ptr (void); struct real_value real_value_from_int_cst (const_tree, const_tree); extern rtx const_double_from_real_value (struct real_value, machine_mode); extern bool exact_real_inverse (format_helper, struct real_value *); bool real_can_shorten_arithmetic (machine_mode, machine_mode); extern tree build_real (tree, struct real_value); extern tree build_real_truncate (tree, struct real_value); extern bool real_powi (struct real_value *, format_helper, const struct real_value *, long); extern void real_trunc (struct real_value *, format_helper, const struct real_value *); extern void real_floor (struct real_value *, format_helper, const struct real_value *); extern void real_ceil (struct real_value *, format_helper, const struct real_value *); extern void real_round (struct real_value *, format_helper, const struct real_value *); extern void real_roundeven (struct real_value *, format_helper, const struct real_value *); extern void real_copysign (struct real_value *, const struct real_value *); extern bool real_isinteger (const struct real_value *, format_helper); extern bool real_isinteger (const struct real_value *, long *); extern bool real_nextafter (struct real_value *, format_helper, const struct real_value *, const struct real_value *); extern void get_max_float (const struct real_format *, char *, size_t, bool); extern wide_int real_to_integer (const struct real_value *, bool *, int); extern void real_from_integer (struct real_value *, format_helper, const wide_int_ref &, signop); extern void build_sinatan_real (struct real_value *, tree); # 475 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h" 1 # 23 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h" struct fixed_value { double_int data; scalar_mode_pod mode; }; # 36 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h" extern struct fixed_value fconst0[18]; extern struct fixed_value fconst1[8]; # 46 "/home/giulianob/gcc_git_gnu/gcc/gcc/fixed-value.h" extern rtx const_fixed_from_fixed_value (struct fixed_value, machine_mode); extern struct fixed_value fixed_from_double_int (double_int, scalar_mode); static inline rtx const_fixed_from_double_int (double_int payload, scalar_mode mode) { return const_fixed_from_fixed_value (fixed_from_double_int (payload, mode), mode); } extern void fixed_from_string (struct fixed_value *, const char *, scalar_mode); extern tree build_fixed (tree, struct fixed_value); extern bool fixed_convert (struct fixed_value *, scalar_mode, const struct fixed_value *, bool); extern bool fixed_convert_from_int (struct fixed_value *, scalar_mode, double_int, bool, bool); extern bool fixed_convert_from_real (struct fixed_value *, scalar_mode, const struct real_value *, bool); extern void real_convert_from_fixed (struct real_value *, scalar_mode, const struct fixed_value *); extern bool fixed_identical (const struct fixed_value *, const struct fixed_value *); extern unsigned int fixed_hash (const struct fixed_value *); extern void fixed_to_decimal (char *str, const struct fixed_value *, size_t); extern bool fixed_arithmetic (struct fixed_value *, int, const struct fixed_value *, const struct fixed_value *, bool); extern bool fixed_compare (int, const struct fixed_value *, const struct fixed_value *); extern bool fixed_isneg (const struct fixed_value *); # 476 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 1 # 246 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/statistics.h" 1 # 61 "/home/giulianob/gcc_git_gnu/gcc/gcc/statistics.h" struct function; extern void statistics_early_init (void); extern void statistics_init (void); extern void statistics_fini (void); extern void statistics_fini_pass (void); extern void statistics_counter_event (struct function *, const char *, int); extern void statistics_histogram_event (struct function *, const char *, int); # 247 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" 1 # 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" # 1 "./gtype-desc.h" 1 # 31 "./gtype-desc.h" extern void gt_ggc_mx_line_maps (void *); extern void gt_ggc_mx_cpp_token (void *); extern void gt_ggc_mx_cpp_macro (void *); extern void gt_ggc_mx_string_concat (void *); extern void gt_ggc_mx_string_concat_db (void *); extern void gt_ggc_mx_hash_map_location_hash_string_concat__ (void *); extern void gt_ggc_mx_bitmap_head (void *); extern void gt_ggc_mx_rtx_def (void *); extern void gt_ggc_mx_rtvec_def (void *); extern void gt_ggc_mx_gimple (void *); extern void gt_ggc_mx_symtab_node (void *); extern void gt_ggc_mx_cgraph_edge (void *); extern void gt_ggc_mx_section (void *); extern void gt_ggc_mx_cl_target_option (void *); extern void gt_ggc_mx_cl_optimization (void *); extern void gt_ggc_mx_edge_def (void *); extern void gt_ggc_mx_basic_block_def (void *); extern void gt_ggc_mx_stack_local_entry (void *); extern void gt_ggc_mx_machine_function (void *); extern void gt_ggc_mx_bitmap_element (void *); extern void gt_ggc_mx_generic_wide_int_wide_int_storage_ (void *); extern void gt_ggc_mx_coverage_data (void *); extern void gt_ggc_mx_mem_attrs (void *); extern void gt_ggc_mx_reg_attrs (void *); extern void gt_ggc_mx_object_block (void *); extern void gt_ggc_mx_vec_rtx_va_gc_ (void *); extern void gt_ggc_mx_real_value (void *); extern void gt_ggc_mx_fixed_value (void *); extern void gt_ggc_mx_constant_descriptor_rtx (void *); extern void gt_ggc_mx_function (void *); extern void gt_ggc_mx_target_rtl (void *); extern void gt_ggc_mx_cgraph_rtl_info (void *); extern void gt_ggc_mx_hash_map_tree_tree_decl_tree_cache_traits_ (void *); extern void gt_ggc_mx_hash_map_tree_tree_type_tree_cache_traits_ (void *); extern void gt_ggc_mx_ptr_info_def (void *); extern void gt_ggc_mx_range_info_def (void *); extern void gt_ggc_mx_die_struct (void *); extern void gt_ggc_mx_vec_constructor_elt_va_gc_ (void *); extern void gt_ggc_mx_vec_tree_va_gc_ (void *); extern void gt_ggc_mx_lang_type (void *); extern void gt_ggc_mx_lang_decl (void *); extern void gt_ggc_mx_tree_statement_list_node (void *); extern void gt_ggc_mx_target_globals (void *); extern void gt_ggc_mx_lang_tree_node (void *); extern void gt_ggc_mx_tree_map (void *); extern void gt_ggc_mx_tree_decl_map (void *); extern void gt_ggc_mx_tree_int_map (void *); extern void gt_ggc_mx_tree_vec_map (void *); extern void gt_ggc_mx_vec_alias_pair_va_gc_ (void *); extern void gt_ggc_mx_libfunc_entry (void *); extern void gt_ggc_mx_hash_table_libfunc_hasher_ (void *); extern void gt_ggc_mx_target_libfuncs (void *); extern void gt_ggc_mx_sequence_stack (void *); extern void gt_ggc_mx_vec_rtx_insn__va_gc_ (void *); extern void gt_ggc_mx_call_site_record_d (void *); extern void gt_ggc_mx_vec_uchar_va_gc_ (void *); extern void gt_ggc_mx_vec_call_site_record_va_gc_ (void *); extern void gt_ggc_mx_gimple_df (void *); extern void gt_ggc_mx_dw_fde_node (void *); extern void gt_ggc_mx_rtx_constant_pool (void *); extern void gt_ggc_mx_frame_space (void *); extern void gt_ggc_mx_vec_callinfo_callee_va_gc_ (void *); extern void gt_ggc_mx_vec_callinfo_dalloc_va_gc_ (void *); extern void gt_ggc_mx_stack_usage (void *); extern void gt_ggc_mx_eh_status (void *); extern void gt_ggc_mx_control_flow_graph (void *); extern void gt_ggc_mx_loops (void *); extern void gt_ggc_mx_language_function (void *); extern void gt_ggc_mx_hash_set_tree_ (void *); extern void gt_ggc_mx_types_used_by_vars_entry (void *); extern void gt_ggc_mx_hash_table_used_type_hasher_ (void *); extern void gt_ggc_mx_nb_iter_bound (void *); extern void gt_ggc_mx_loop_exit (void *); extern void gt_ggc_mx_loop (void *); extern void gt_ggc_mx_control_iv (void *); extern void gt_ggc_mx_vec_loop_p_va_gc_ (void *); extern void gt_ggc_mx_niter_desc (void *); extern void gt_ggc_mx_hash_table_loop_exit_hasher_ (void *); extern void gt_ggc_mx_vec_basic_block_va_gc_ (void *); extern void gt_ggc_mx_rtl_bb_info (void *); extern void gt_ggc_mx_vec_edge_va_gc_ (void *); extern void gt_ggc_mx_vec_ipa_ref_t_va_gc_ (void *); extern void gt_ggc_mx_section_hash_entry (void *); extern void gt_ggc_mx_lto_file_decl_data (void *); extern void gt_ggc_mx_ipa_replace_map (void *); extern void gt_ggc_mx_vec_ipa_replace_map__va_gc_ (void *); extern void gt_ggc_mx_ipa_param_adjustments (void *); extern void gt_ggc_mx_vec_ipa_param_performed_split_va_gc_ (void *); extern void gt_ggc_mx_cgraph_simd_clone (void *); extern void gt_ggc_mx_cgraph_function_version_info (void *); extern void gt_ggc_mx_hash_table_cgraph_edge_hasher_ (void *); extern void gt_ggc_mx_cgraph_indirect_call_info (void *); extern void gt_ggc_mx_asm_node (void *); extern void gt_ggc_mx_symbol_table (void *); extern void gt_ggc_mx_hash_table_section_name_hasher_ (void *); extern void gt_ggc_mx_hash_table_asmname_hasher_ (void *); extern void gt_ggc_mx_hash_map_symtab_node__symbol_priority_map_ (void *); extern void gt_ggc_mx_constant_descriptor_tree (void *); extern void gt_ggc_mx_hash_map_alias_set_hash_int_ (void *); extern void gt_ggc_mx_alias_set_entry (void *); extern void gt_ggc_mx_vec_alias_set_entry__va_gc_ (void *); extern void gt_ggc_mx_hash_table_function_version_hasher_ (void *); extern void gt_ggc_mx_lto_in_decl_state (void *); extern void gt_ggc_mx_hash_table_ipa_bit_ggc_hash_traits_ (void *); extern void gt_ggc_mx_hash_table_ipa_vr_ggc_hash_traits_ (void *); extern void gt_ggc_mx_ipa_node_params (void *); extern void gt_ggc_mx_ipa_edge_args (void *); extern void gt_ggc_mx_ipa_agg_replacement_value (void *); extern void gt_ggc_mx_ipa_fn_summary (void *); extern void gt_ggc_mx_odr_type_d (void *); extern void gt_ggc_mx_vec_ipa_adjusted_param_va_gc_ (void *); extern void gt_ggc_mx_param_access (void *); extern void gt_ggc_mx_vec_param_access__va_gc_ (void *); extern void gt_ggc_mx_isra_func_summary (void *); extern void gt_ggc_mx_vec_isra_param_desc_va_gc_ (void *); extern void gt_ggc_mx_ipa_sra_function_summaries (void *); extern void gt_ggc_mx_typeinfo (void *); extern void gt_ggc_mx_dw_cfi_node (void *); extern void gt_ggc_mx_dw_loc_descr_node (void *); extern void gt_ggc_mx_dw_loc_list_struct (void *); extern void gt_ggc_mx_dw_discr_list_node (void *); extern void gt_ggc_mx_dw_cfa_location (void *); extern void gt_ggc_mx_vec_dw_cfi_ref_va_gc_ (void *); extern void gt_ggc_mx_addr_table_entry (void *); extern void gt_ggc_mx_indirect_string_node (void *); extern void gt_ggc_mx_dwarf_file_data (void *); extern void gt_ggc_mx_hash_map_char__tree_ (void *); extern void gt_ggc_mx_dw_cfi_row (void *); extern void gt_ggc_mx_reg_saved_in_data (void *); extern void gt_ggc_mx_vec_dw_fde_ref_va_gc_ (void *); extern void gt_ggc_mx_hash_table_indirect_string_hasher_ (void *); extern void gt_ggc_mx_comdat_type_node (void *); extern void gt_ggc_mx_vec_dw_line_info_entry_va_gc_ (void *); extern void gt_ggc_mx_dw_line_info_table (void *); extern void gt_ggc_mx_vec_dw_attr_node_va_gc_ (void *); extern void gt_ggc_mx_limbo_die_struct (void *); extern void gt_ggc_mx_hash_table_dwarf_file_hasher_ (void *); extern void gt_ggc_mx_hash_table_decl_die_hasher_ (void *); extern void gt_ggc_mx_vec_dw_die_ref_va_gc_ (void *); extern void gt_ggc_mx_variable_value_struct (void *); extern void gt_ggc_mx_hash_table_variable_value_hasher_ (void *); extern void gt_ggc_mx_hash_table_block_die_hasher_ (void *); extern void gt_ggc_mx_var_loc_node (void *); extern void gt_ggc_mx_var_loc_list_def (void *); extern void gt_ggc_mx_call_arg_loc_node (void *); extern void gt_ggc_mx_hash_table_decl_loc_hasher_ (void *); extern void gt_ggc_mx_cached_dw_loc_list_def (void *); extern void gt_ggc_mx_hash_table_dw_loc_list_hasher_ (void *); extern void gt_ggc_mx_vec_dw_line_info_table__va_gc_ (void *); extern void gt_ggc_mx_vec_pubname_entry_va_gc_ (void *); extern void gt_ggc_mx_vec_macinfo_entry_va_gc_ (void *); extern void gt_ggc_mx_vec_dw_ranges_va_gc_ (void *); extern void gt_ggc_mx_vec_dw_ranges_by_label_va_gc_ (void *); extern void gt_ggc_mx_vec_die_arg_entry_va_gc_ (void *); extern void gt_ggc_mx_hash_table_addr_hasher_ (void *); extern void gt_ggc_mx_hash_map_tree_sym_off_pair_ (void *); extern void gt_ggc_mx_inline_entry_data (void *); extern void gt_ggc_mx_hash_table_inline_entry_data_hasher_ (void *); extern void gt_ggc_mx_temp_slot (void *); extern void gt_ggc_mx_initial_value_struct (void *); extern void gt_ggc_mx_vec_temp_slot_p_va_gc_ (void *); extern void gt_ggc_mx_hash_table_const_int_hasher_ (void *); extern void gt_ggc_mx_hash_table_const_wide_int_hasher_ (void *); extern void gt_ggc_mx_hash_table_const_poly_int_hasher_ (void *); extern void gt_ggc_mx_hash_table_reg_attr_hasher_ (void *); extern void gt_ggc_mx_hash_table_const_double_hasher_ (void *); extern void gt_ggc_mx_hash_table_const_fixed_hasher_ (void *); extern void gt_ggc_mx_eh_region_d (void *); extern void gt_ggc_mx_eh_landing_pad_d (void *); extern void gt_ggc_mx_eh_catch_d (void *); extern void gt_ggc_mx_vec_eh_region_va_gc_ (void *); extern void gt_ggc_mx_vec_eh_landing_pad_va_gc_ (void *); extern void gt_ggc_mx_hash_map_gimple__int_ (void *); extern void gt_ggc_mx_hash_table_insn_cache_hasher_ (void *); extern void gt_ggc_mx_temp_slot_address_entry (void *); extern void gt_ggc_mx_hash_table_temp_address_hasher_ (void *); extern void gt_ggc_mx_hash_map_tree_hash_tree_ (void *); extern void gt_ggc_mx_test_struct (void *); extern void gt_ggc_mx_test_of_length (void *); extern void gt_ggc_mx_test_other (void *); extern void gt_ggc_mx_test_of_union (void *); extern void gt_ggc_mx_example_base (void *); extern void gt_ggc_mx_test_node (void *); extern void gt_ggc_mx_user_struct (void *); extern void gt_ggc_mx_hash_table_libfunc_decl_hasher_ (void *); extern void gt_ggc_mx_string_pool_data (void *); extern void gt_ggc_mx_type_hash (void *); extern void gt_ggc_mx_hash_table_type_cache_hasher_ (void *); extern void gt_ggc_mx_hash_table_int_cst_hasher_ (void *); extern void gt_ggc_mx_hash_table_poly_int_cst_hasher_ (void *); extern void gt_ggc_mx_hash_table_cl_option_hasher_ (void *); extern void gt_ggc_mx_hash_table_tree_decl_map_cache_hasher_ (void *); extern void gt_ggc_mx_hash_table_tree_vec_map_cache_hasher_ (void *); extern void gt_ggc_mx_hash_table_section_hasher_ (void *); extern void gt_ggc_mx_hash_table_object_block_hasher_ (void *); extern void gt_ggc_mx_hash_table_tree_descriptor_hasher_ (void *); extern void gt_ggc_mx_hash_table_const_rtx_desc_hasher_ (void *); extern void gt_ggc_mx_hash_table_tm_clone_hasher_ (void *); extern void gt_ggc_mx_tm_restart_node (void *); extern void gt_ggc_mx_hash_map_tree_tree_ (void *); extern void gt_ggc_mx_hash_table_ssa_name_hasher_ (void *); extern void gt_ggc_mx_hash_table_tm_restart_hasher_ (void *); extern void gt_ggc_mx_vec_mem_addr_template_va_gc_ (void *); extern void gt_ggc_mx_scev_info_str (void *); extern void gt_ggc_mx_hash_table_scev_info_hasher_ (void *); extern void gt_ggc_mx_ssa_operand_memory_d (void *); extern void gt_ggc_mx_vec_omp_declare_variant_entry_va_gc_ (void *); extern void gt_ggc_mx_omp_declare_variant_base_entry (void *); extern void gt_ggc_mx_hash_table_omp_declare_variant_hasher_ (void *); extern void gt_ggc_mx_hash_table_omp_declare_variant_alt_hasher_ (void *); extern void gt_ggc_mx_hash_table_dllimport_hasher_ (void *); extern void gt_ggc_mx_hash_map_char__unsigned_ (void *); extern void gt_ggc_mx_vec_gimple__va_gc_ (void *); extern void gt_ggc_mx_int_range_1_ (void *); extern void gt_ggc_mx_vec_ipa_agg_jf_item_va_gc_ (void *); extern void gt_ggc_mx_ipa_bits (void *); extern void gt_ggc_mx_vec_ipa_param_descriptor_va_gc_ (void *); extern void gt_ggc_mx_vec_ipa_bits__va_gc_ (void *); extern void gt_ggc_mx_vec_ipa_vr_va_gc_ (void *); extern void gt_ggc_mx_ipcp_transformation (void *); extern void gt_ggc_mx_vec_ipa_jump_func_va_gc_ (void *); extern void gt_ggc_mx_vec_ipa_polymorphic_call_context_va_gc_ (void *); extern void gt_ggc_mx_ipa_node_params_t (void *); extern void gt_ggc_mx_ipa_edge_args_sum_t (void *); extern void gt_ggc_mx_function_summary_ipcp_transformation__ (void *); extern void gt_ggc_mx_hash_table_tm_wrapper_hasher_ (void *); extern void gt_ggc_mx_hash_table_decl_state_hasher_ (void *); extern void gt_ggc_mx_vec_expr_eval_op_va_gc_ (void *); extern void gt_ggc_mx_vec_condition_va_gc_ (void *); extern void gt_ggc_mx_vec_size_time_entry_va_gc_ (void *); extern void gt_ggc_mx_fast_function_summary_ipa_fn_summary__va_gc_ (void *); extern void gt_ggc_mx_tree_type_map (void *); extern void gt_ggc_mx_hash_table_tree_type_map_cache_hasher_ (void *); extern void gt_ggc_mx_vec_odr_type_va_gc_ (void *); extern void gt_ggc_mx_hash_table_value_annotation_hasher_ (void *); extern void gt_ggc_mx_vec_Entity_Id_va_gc_atomic_ (void *); extern void gt_ggc_mx_tree_entity_vec_map (void *); extern void gt_ggc_mx_hash_table_dummy_type_hasher_ (void *); extern void gt_ggc_mx_parm_attr_d (void *); extern void gt_ggc_mx_vec_parm_attr_va_gc_ (void *); extern void gt_ggc_mx_stmt_group (void *); extern void gt_ggc_mx_elab_info (void *); extern void gt_ggc_mx_range_check_info_d (void *); extern void gt_ggc_mx_vec_range_check_info_va_gc_ (void *); extern void gt_ggc_mx_loop_info_d (void *); extern void gt_ggc_mx_vec_loop_info_va_gc_ (void *); extern void gt_ggc_mx_gnat_binding_level (void *); extern void gt_ggc_mx_packable_type_hash (void *); extern void gt_ggc_mx_hash_table_packable_type_hasher_ (void *); extern void gt_ggc_mx_pad_type_hash (void *); extern void gt_ggc_mx_hash_table_pad_type_hasher_ (void *); extern void gt_ggc_mx_c_label_vars (void *); extern void gt_ggc_mx_c_binding (void *); extern void gt_ggc_mx_c_scope (void *); extern void gt_ggc_mx_c_goto_bindings (void *); extern void gt_ggc_mx_vec_c_goto_bindings_p_va_gc_ (void *); extern void gt_ggc_mx_c_inline_static (void *); extern void gt_ggc_mx_sorted_fields_type (void *); extern void gt_ggc_mx_vec_const_char_p_va_gc_ (void *); extern void gt_ggc_mx_vec_tree_gc_vec_va_gc_ (void *); extern void gt_ggc_mx_align_stack (void *); extern void gt_ggc_mx_vec_pending_weak_va_gc_ (void *); extern void gt_ggc_mx_vec_pending_redefinition_va_gc_ (void *); extern void gt_ggc_mx_opt_stack (void *); extern void gt_ggc_mx_c_parser (void *); extern void gt_ggc_mx_vec_c_token_va_gc_ (void *); extern void gt_ggc_mx_binding_table_s (void *); extern void gt_ggc_mx_binding_entry_s (void *); extern void gt_ggc_mx_cxx_binding (void *); extern void gt_ggc_mx_cp_binding_level (void *); extern void gt_ggc_mx_vec_cp_class_binding_va_gc_ (void *); extern void gt_ggc_mx_cp_token_cache (void *); extern void gt_ggc_mx_vec_deferred_access_check_va_gc_ (void *); extern void gt_ggc_mx_vec_cxx_saved_binding_va_gc_ (void *); extern void gt_ggc_mx_saved_scope (void *); extern void gt_ggc_mx_cxx_int_tree_map (void *); extern void gt_ggc_mx_named_label_entry (void *); extern void gt_ggc_mx_hash_table_named_label_hash_ (void *); extern void gt_ggc_mx_hash_table_cxx_int_tree_map_hasher_ (void *); extern void gt_ggc_mx_tree_pair_s (void *); extern void gt_ggc_mx_vec_tree_pair_s_va_gc_ (void *); extern void gt_ggc_mx_hash_table_named_decl_hash_ (void *); extern void gt_ggc_mx_tinst_level (void *); extern void gt_ggc_mx_tree_check (void *); extern void gt_ggc_mx_vec_cp_token_va_gc_ (void *); extern void gt_ggc_mx_cp_lexer (void *); extern void gt_ggc_mx_vec_cp_default_arg_entry_va_gc_ (void *); extern void gt_ggc_mx_cp_parser_context (void *); extern void gt_ggc_mx_vec_cp_unparsed_functions_entry_va_gc_ (void *); extern void gt_ggc_mx_cp_parser (void *); extern void gt_ggc_mx_hash_map_tree_int_ (void *); extern void gt_ggc_mx_constexpr_fundef (void *); extern void gt_ggc_mx_hash_table_constexpr_fundef_hasher_ (void *); extern void gt_ggc_mx_constexpr_call (void *); extern void gt_ggc_mx_hash_table_constexpr_call_hasher_ (void *); extern void gt_ggc_mx_sat_entry (void *); extern void gt_ggc_mx_hash_table_sat_hasher_ (void *); extern void gt_ggc_mx_coroutine_info (void *); extern void gt_ggc_mx_hash_table_coroutine_info_hasher_ (void *); extern void gt_ggc_mx_source_location_table_entry (void *); extern void gt_ggc_mx_hash_table_source_location_table_entry_hash_ (void *); extern void gt_ggc_mx_named_label_use_entry (void *); extern void gt_ggc_mx_vec_incomplete_var_va_gc_ (void *); extern void gt_ggc_mx_hash_table_typename_hasher_ (void *); extern void gt_ggc_mx_hash_table_mangled_decl_hash_ (void *); extern void gt_ggc_mx_vec_pending_noexcept_va_gc_ (void *); extern void gt_ggc_mx_vec_tree_int_va_gc_ (void *); extern void gt_ggc_mx_hash_table_conv_type_hasher_ (void *); extern void gt_ggc_mx_subsumption_entry (void *); extern void gt_ggc_mx_hash_table_subsumption_hasher_ (void *); extern void gt_ggc_mx_pending_template (void *); extern void gt_ggc_mx_spec_entry (void *); extern void gt_ggc_mx_hash_table_spec_hasher_ (void *); extern void gt_ggc_mx_hash_map_tree_tree_pair_p_ (void *); extern void gt_ggc_mx_vec_tinfo_s_va_gc_ (void *); extern void gt_ggc_mx_vec_deferred_access_va_gc_ (void *); extern void gt_ggc_mx_hash_table_cplus_array_hasher_ (void *); extern void gt_ggc_mx_hash_table_list_hasher_ (void *); extern void gt_ggc_mx_pending_abstract_type (void *); extern void gt_ggc_mx_hash_table_abstract_type_hasher_ (void *); extern void gt_ggc_mx_Statement (void *); extern void gt_ggc_mx_binding_level (void *); extern void gt_ggc_mx_d_label_use_entry (void *); extern void gt_ggc_mx_hash_map_Statement__d_label_entry_ (void *); extern void gt_ggc_mx_hash_table_module_hasher_ (void *); extern void gt_ggc_mx_module_htab_entry (void *); extern void gt_ggc_mx_hash_table_module_decl_hasher_ (void *); extern void gt_ggc_mx_objc_map_private (void *); extern void gt_ggc_mx_hashed_entry (void *); extern void gt_ggc_mx_hashed_attribute (void *); extern void gt_ggc_mx_imp_entry (void *); extern void gt_ggc_mx_string_descriptor (void *); extern void gt_ggc_mx_hash_table_objc_string_hasher_ (void *); extern void gt_ggc_mx_vec_ident_data_tuple_va_gc_ (void *); extern void gt_ggc_mx_vec_msgref_entry_va_gc_ (void *); extern void gt_ggc_mx_vec_prot_list_entry_va_gc_ (void *); extern void gt_ggc_mx_vec_ivarref_entry_va_gc_ (void *); # 1388 "./gtype-desc.h" extern void gt_pch_nx_line_maps (void *); extern void gt_pch_nx_cpp_token (void *); extern void gt_pch_nx_cpp_macro (void *); extern void gt_pch_nx_string_concat (void *); extern void gt_pch_nx_string_concat_db (void *); extern void gt_pch_nx_hash_map_location_hash_string_concat__ (void *); extern void gt_pch_nx_bitmap_head (void *); extern void gt_pch_nx_rtx_def (void *); extern void gt_pch_nx_rtvec_def (void *); extern void gt_pch_nx_gimple (void *); extern void gt_pch_nx_symtab_node (void *); extern void gt_pch_nx_cgraph_edge (void *); extern void gt_pch_nx_section (void *); extern void gt_pch_nx_cl_target_option (void *); extern void gt_pch_nx_cl_optimization (void *); extern void gt_pch_nx_edge_def (void *); extern void gt_pch_nx_basic_block_def (void *); extern void gt_pch_nx_stack_local_entry (void *); extern void gt_pch_nx_machine_function (void *); extern void gt_pch_nx_bitmap_element (void *); extern void gt_pch_nx_generic_wide_int_wide_int_storage_ (void *); extern void gt_pch_nx_coverage_data (void *); extern void gt_pch_nx_mem_attrs (void *); extern void gt_pch_nx_reg_attrs (void *); extern void gt_pch_nx_object_block (void *); extern void gt_pch_nx_vec_rtx_va_gc_ (void *); extern void gt_pch_nx_real_value (void *); extern void gt_pch_nx_fixed_value (void *); extern void gt_pch_nx_constant_descriptor_rtx (void *); extern void gt_pch_nx_function (void *); extern void gt_pch_nx_target_rtl (void *); extern void gt_pch_nx_cgraph_rtl_info (void *); extern void gt_pch_nx_hash_map_tree_tree_decl_tree_cache_traits_ (void *); extern void gt_pch_nx_hash_map_tree_tree_type_tree_cache_traits_ (void *); extern void gt_pch_nx_ptr_info_def (void *); extern void gt_pch_nx_range_info_def (void *); extern void gt_pch_nx_die_struct (void *); extern void gt_pch_nx_vec_constructor_elt_va_gc_ (void *); extern void gt_pch_nx_vec_tree_va_gc_ (void *); extern void gt_pch_nx_lang_type (void *); extern void gt_pch_nx_lang_decl (void *); extern void gt_pch_nx_tree_statement_list_node (void *); extern void gt_pch_nx_target_globals (void *); extern void gt_pch_nx_lang_tree_node (void *); extern void gt_pch_nx_tree_map (void *); extern void gt_pch_nx_tree_decl_map (void *); extern void gt_pch_nx_tree_int_map (void *); extern void gt_pch_nx_tree_vec_map (void *); extern void gt_pch_nx_vec_alias_pair_va_gc_ (void *); extern void gt_pch_nx_libfunc_entry (void *); extern void gt_pch_nx_hash_table_libfunc_hasher_ (void *); extern void gt_pch_nx_target_libfuncs (void *); extern void gt_pch_nx_sequence_stack (void *); extern void gt_pch_nx_vec_rtx_insn__va_gc_ (void *); extern void gt_pch_nx_call_site_record_d (void *); extern void gt_pch_nx_vec_uchar_va_gc_ (void *); extern void gt_pch_nx_vec_call_site_record_va_gc_ (void *); extern void gt_pch_nx_gimple_df (void *); extern void gt_pch_nx_dw_fde_node (void *); extern void gt_pch_nx_rtx_constant_pool (void *); extern void gt_pch_nx_frame_space (void *); extern void gt_pch_nx_vec_callinfo_callee_va_gc_ (void *); extern void gt_pch_nx_vec_callinfo_dalloc_va_gc_ (void *); extern void gt_pch_nx_stack_usage (void *); extern void gt_pch_nx_eh_status (void *); extern void gt_pch_nx_control_flow_graph (void *); extern void gt_pch_nx_loops (void *); extern void gt_pch_nx_language_function (void *); extern void gt_pch_nx_hash_set_tree_ (void *); extern void gt_pch_nx_types_used_by_vars_entry (void *); extern void gt_pch_nx_hash_table_used_type_hasher_ (void *); extern void gt_pch_nx_nb_iter_bound (void *); extern void gt_pch_nx_loop_exit (void *); extern void gt_pch_nx_loop (void *); extern void gt_pch_nx_control_iv (void *); extern void gt_pch_nx_vec_loop_p_va_gc_ (void *); extern void gt_pch_nx_niter_desc (void *); extern void gt_pch_nx_hash_table_loop_exit_hasher_ (void *); extern void gt_pch_nx_vec_basic_block_va_gc_ (void *); extern void gt_pch_nx_rtl_bb_info (void *); extern void gt_pch_nx_vec_edge_va_gc_ (void *); extern void gt_pch_nx_vec_ipa_ref_t_va_gc_ (void *); extern void gt_pch_nx_section_hash_entry (void *); extern void gt_pch_nx_lto_file_decl_data (void *); extern void gt_pch_nx_ipa_replace_map (void *); extern void gt_pch_nx_vec_ipa_replace_map__va_gc_ (void *); extern void gt_pch_nx_ipa_param_adjustments (void *); extern void gt_pch_nx_vec_ipa_param_performed_split_va_gc_ (void *); extern void gt_pch_nx_cgraph_simd_clone (void *); extern void gt_pch_nx_cgraph_function_version_info (void *); extern void gt_pch_nx_hash_table_cgraph_edge_hasher_ (void *); extern void gt_pch_nx_cgraph_indirect_call_info (void *); extern void gt_pch_nx_asm_node (void *); extern void gt_pch_nx_symbol_table (void *); extern void gt_pch_nx_hash_table_section_name_hasher_ (void *); extern void gt_pch_nx_hash_table_asmname_hasher_ (void *); extern void gt_pch_nx_hash_map_symtab_node__symbol_priority_map_ (void *); extern void gt_pch_nx_constant_descriptor_tree (void *); extern void gt_pch_nx_hash_map_alias_set_hash_int_ (void *); extern void gt_pch_nx_alias_set_entry (void *); extern void gt_pch_nx_vec_alias_set_entry__va_gc_ (void *); extern void gt_pch_nx_hash_table_function_version_hasher_ (void *); extern void gt_pch_nx_lto_in_decl_state (void *); extern void gt_pch_nx_hash_table_ipa_bit_ggc_hash_traits_ (void *); extern void gt_pch_nx_hash_table_ipa_vr_ggc_hash_traits_ (void *); extern void gt_pch_nx_ipa_node_params (void *); extern void gt_pch_nx_ipa_edge_args (void *); extern void gt_pch_nx_ipa_agg_replacement_value (void *); extern void gt_pch_nx_ipa_fn_summary (void *); extern void gt_pch_nx_odr_type_d (void *); extern void gt_pch_nx_vec_ipa_adjusted_param_va_gc_ (void *); extern void gt_pch_nx_param_access (void *); extern void gt_pch_nx_vec_param_access__va_gc_ (void *); extern void gt_pch_nx_isra_func_summary (void *); extern void gt_pch_nx_vec_isra_param_desc_va_gc_ (void *); extern void gt_pch_nx_ipa_sra_function_summaries (void *); extern void gt_pch_nx_typeinfo (void *); extern void gt_pch_nx_dw_cfi_node (void *); extern void gt_pch_nx_dw_loc_descr_node (void *); extern void gt_pch_nx_dw_loc_list_struct (void *); extern void gt_pch_nx_dw_discr_list_node (void *); extern void gt_pch_nx_dw_cfa_location (void *); extern void gt_pch_nx_vec_dw_cfi_ref_va_gc_ (void *); extern void gt_pch_nx_addr_table_entry (void *); extern void gt_pch_nx_indirect_string_node (void *); extern void gt_pch_nx_dwarf_file_data (void *); extern void gt_pch_nx_hash_map_char__tree_ (void *); extern void gt_pch_nx_dw_cfi_row (void *); extern void gt_pch_nx_reg_saved_in_data (void *); extern void gt_pch_nx_vec_dw_fde_ref_va_gc_ (void *); extern void gt_pch_nx_hash_table_indirect_string_hasher_ (void *); extern void gt_pch_nx_comdat_type_node (void *); extern void gt_pch_nx_vec_dw_line_info_entry_va_gc_ (void *); extern void gt_pch_nx_dw_line_info_table (void *); extern void gt_pch_nx_vec_dw_attr_node_va_gc_ (void *); extern void gt_pch_nx_limbo_die_struct (void *); extern void gt_pch_nx_hash_table_dwarf_file_hasher_ (void *); extern void gt_pch_nx_hash_table_decl_die_hasher_ (void *); extern void gt_pch_nx_vec_dw_die_ref_va_gc_ (void *); extern void gt_pch_nx_variable_value_struct (void *); extern void gt_pch_nx_hash_table_variable_value_hasher_ (void *); extern void gt_pch_nx_hash_table_block_die_hasher_ (void *); extern void gt_pch_nx_var_loc_node (void *); extern void gt_pch_nx_var_loc_list_def (void *); extern void gt_pch_nx_call_arg_loc_node (void *); extern void gt_pch_nx_hash_table_decl_loc_hasher_ (void *); extern void gt_pch_nx_cached_dw_loc_list_def (void *); extern void gt_pch_nx_hash_table_dw_loc_list_hasher_ (void *); extern void gt_pch_nx_vec_dw_line_info_table__va_gc_ (void *); extern void gt_pch_nx_vec_pubname_entry_va_gc_ (void *); extern void gt_pch_nx_vec_macinfo_entry_va_gc_ (void *); extern void gt_pch_nx_vec_dw_ranges_va_gc_ (void *); extern void gt_pch_nx_vec_dw_ranges_by_label_va_gc_ (void *); extern void gt_pch_nx_vec_die_arg_entry_va_gc_ (void *); extern void gt_pch_nx_hash_table_addr_hasher_ (void *); extern void gt_pch_nx_hash_map_tree_sym_off_pair_ (void *); extern void gt_pch_nx_inline_entry_data (void *); extern void gt_pch_nx_hash_table_inline_entry_data_hasher_ (void *); extern void gt_pch_nx_temp_slot (void *); extern void gt_pch_nx_initial_value_struct (void *); extern void gt_pch_nx_vec_temp_slot_p_va_gc_ (void *); extern void gt_pch_nx_hash_table_const_int_hasher_ (void *); extern void gt_pch_nx_hash_table_const_wide_int_hasher_ (void *); extern void gt_pch_nx_hash_table_const_poly_int_hasher_ (void *); extern void gt_pch_nx_hash_table_reg_attr_hasher_ (void *); extern void gt_pch_nx_hash_table_const_double_hasher_ (void *); extern void gt_pch_nx_hash_table_const_fixed_hasher_ (void *); extern void gt_pch_nx_eh_region_d (void *); extern void gt_pch_nx_eh_landing_pad_d (void *); extern void gt_pch_nx_eh_catch_d (void *); extern void gt_pch_nx_vec_eh_region_va_gc_ (void *); extern void gt_pch_nx_vec_eh_landing_pad_va_gc_ (void *); extern void gt_pch_nx_hash_map_gimple__int_ (void *); extern void gt_pch_nx_hash_table_insn_cache_hasher_ (void *); extern void gt_pch_nx_temp_slot_address_entry (void *); extern void gt_pch_nx_hash_table_temp_address_hasher_ (void *); extern void gt_pch_nx_hash_map_tree_hash_tree_ (void *); extern void gt_pch_nx_test_struct (void *); extern void gt_pch_nx_test_of_length (void *); extern void gt_pch_nx_test_other (void *); extern void gt_pch_nx_test_of_union (void *); extern void gt_pch_nx_example_base (void *); extern void gt_pch_nx_test_node (void *); extern void gt_pch_nx_user_struct (void *); extern void gt_pch_nx_hash_table_libfunc_decl_hasher_ (void *); extern void gt_pch_nx_string_pool_data (void *); extern void gt_pch_nx_type_hash (void *); extern void gt_pch_nx_hash_table_type_cache_hasher_ (void *); extern void gt_pch_nx_hash_table_int_cst_hasher_ (void *); extern void gt_pch_nx_hash_table_poly_int_cst_hasher_ (void *); extern void gt_pch_nx_hash_table_cl_option_hasher_ (void *); extern void gt_pch_nx_hash_table_tree_decl_map_cache_hasher_ (void *); extern void gt_pch_nx_hash_table_tree_vec_map_cache_hasher_ (void *); extern void gt_pch_nx_hash_table_section_hasher_ (void *); extern void gt_pch_nx_hash_table_object_block_hasher_ (void *); extern void gt_pch_nx_hash_table_tree_descriptor_hasher_ (void *); extern void gt_pch_nx_hash_table_const_rtx_desc_hasher_ (void *); extern void gt_pch_nx_hash_table_tm_clone_hasher_ (void *); extern void gt_pch_nx_tm_restart_node (void *); extern void gt_pch_nx_hash_map_tree_tree_ (void *); extern void gt_pch_nx_hash_table_ssa_name_hasher_ (void *); extern void gt_pch_nx_hash_table_tm_restart_hasher_ (void *); extern void gt_pch_nx_vec_mem_addr_template_va_gc_ (void *); extern void gt_pch_nx_scev_info_str (void *); extern void gt_pch_nx_hash_table_scev_info_hasher_ (void *); extern void gt_pch_nx_ssa_operand_memory_d (void *); extern void gt_pch_nx_vec_omp_declare_variant_entry_va_gc_ (void *); extern void gt_pch_nx_omp_declare_variant_base_entry (void *); extern void gt_pch_nx_hash_table_omp_declare_variant_hasher_ (void *); extern void gt_pch_nx_hash_table_omp_declare_variant_alt_hasher_ (void *); extern void gt_pch_nx_hash_table_dllimport_hasher_ (void *); extern void gt_pch_nx_hash_map_char__unsigned_ (void *); extern void gt_pch_nx_vec_gimple__va_gc_ (void *); extern void gt_pch_nx_int_range_1_ (void *); extern void gt_pch_nx_vec_ipa_agg_jf_item_va_gc_ (void *); extern void gt_pch_nx_ipa_bits (void *); extern void gt_pch_nx_vec_ipa_param_descriptor_va_gc_ (void *); extern void gt_pch_nx_vec_ipa_bits__va_gc_ (void *); extern void gt_pch_nx_vec_ipa_vr_va_gc_ (void *); extern void gt_pch_nx_ipcp_transformation (void *); extern void gt_pch_nx_vec_ipa_jump_func_va_gc_ (void *); extern void gt_pch_nx_vec_ipa_polymorphic_call_context_va_gc_ (void *); extern void gt_pch_nx_ipa_node_params_t (void *); extern void gt_pch_nx_ipa_edge_args_sum_t (void *); extern void gt_pch_nx_function_summary_ipcp_transformation__ (void *); extern void gt_pch_nx_hash_table_tm_wrapper_hasher_ (void *); extern void gt_pch_nx_hash_table_decl_state_hasher_ (void *); extern void gt_pch_nx_vec_expr_eval_op_va_gc_ (void *); extern void gt_pch_nx_vec_condition_va_gc_ (void *); extern void gt_pch_nx_vec_size_time_entry_va_gc_ (void *); extern void gt_pch_nx_fast_function_summary_ipa_fn_summary__va_gc_ (void *); extern void gt_pch_nx_tree_type_map (void *); extern void gt_pch_nx_hash_table_tree_type_map_cache_hasher_ (void *); extern void gt_pch_nx_vec_odr_type_va_gc_ (void *); extern void gt_pch_nx_hash_table_value_annotation_hasher_ (void *); extern void gt_pch_nx_vec_Entity_Id_va_gc_atomic_ (void *); extern void gt_pch_nx_tree_entity_vec_map (void *); extern void gt_pch_nx_hash_table_dummy_type_hasher_ (void *); extern void gt_pch_nx_parm_attr_d (void *); extern void gt_pch_nx_vec_parm_attr_va_gc_ (void *); extern void gt_pch_nx_stmt_group (void *); extern void gt_pch_nx_elab_info (void *); extern void gt_pch_nx_range_check_info_d (void *); extern void gt_pch_nx_vec_range_check_info_va_gc_ (void *); extern void gt_pch_nx_loop_info_d (void *); extern void gt_pch_nx_vec_loop_info_va_gc_ (void *); extern void gt_pch_nx_gnat_binding_level (void *); extern void gt_pch_nx_packable_type_hash (void *); extern void gt_pch_nx_hash_table_packable_type_hasher_ (void *); extern void gt_pch_nx_pad_type_hash (void *); extern void gt_pch_nx_hash_table_pad_type_hasher_ (void *); extern void gt_pch_nx_c_label_vars (void *); extern void gt_pch_nx_c_binding (void *); extern void gt_pch_nx_c_scope (void *); extern void gt_pch_nx_c_goto_bindings (void *); extern void gt_pch_nx_vec_c_goto_bindings_p_va_gc_ (void *); extern void gt_pch_nx_c_inline_static (void *); extern void gt_pch_nx_sorted_fields_type (void *); extern void gt_pch_nx_vec_const_char_p_va_gc_ (void *); extern void gt_pch_nx_vec_tree_gc_vec_va_gc_ (void *); extern void gt_pch_nx_align_stack (void *); extern void gt_pch_nx_vec_pending_weak_va_gc_ (void *); extern void gt_pch_nx_vec_pending_redefinition_va_gc_ (void *); extern void gt_pch_nx_opt_stack (void *); extern void gt_pch_nx_c_parser (void *); extern void gt_pch_nx_vec_c_token_va_gc_ (void *); extern void gt_pch_nx_binding_table_s (void *); extern void gt_pch_nx_binding_entry_s (void *); extern void gt_pch_nx_cxx_binding (void *); extern void gt_pch_nx_cp_binding_level (void *); extern void gt_pch_nx_vec_cp_class_binding_va_gc_ (void *); extern void gt_pch_nx_cp_token_cache (void *); extern void gt_pch_nx_vec_deferred_access_check_va_gc_ (void *); extern void gt_pch_nx_vec_cxx_saved_binding_va_gc_ (void *); extern void gt_pch_nx_saved_scope (void *); extern void gt_pch_nx_cxx_int_tree_map (void *); extern void gt_pch_nx_named_label_entry (void *); extern void gt_pch_nx_hash_table_named_label_hash_ (void *); extern void gt_pch_nx_hash_table_cxx_int_tree_map_hasher_ (void *); extern void gt_pch_nx_tree_pair_s (void *); extern void gt_pch_nx_vec_tree_pair_s_va_gc_ (void *); extern void gt_pch_nx_hash_table_named_decl_hash_ (void *); extern void gt_pch_nx_tinst_level (void *); extern void gt_pch_nx_tree_check (void *); extern void gt_pch_nx_vec_cp_token_va_gc_ (void *); extern void gt_pch_nx_cp_lexer (void *); extern void gt_pch_nx_vec_cp_default_arg_entry_va_gc_ (void *); extern void gt_pch_nx_cp_parser_context (void *); extern void gt_pch_nx_vec_cp_unparsed_functions_entry_va_gc_ (void *); extern void gt_pch_nx_cp_parser (void *); extern void gt_pch_nx_hash_map_tree_int_ (void *); extern void gt_pch_nx_constexpr_fundef (void *); extern void gt_pch_nx_hash_table_constexpr_fundef_hasher_ (void *); extern void gt_pch_nx_constexpr_call (void *); extern void gt_pch_nx_hash_table_constexpr_call_hasher_ (void *); extern void gt_pch_nx_sat_entry (void *); extern void gt_pch_nx_hash_table_sat_hasher_ (void *); extern void gt_pch_nx_coroutine_info (void *); extern void gt_pch_nx_hash_table_coroutine_info_hasher_ (void *); extern void gt_pch_nx_source_location_table_entry (void *); extern void gt_pch_nx_hash_table_source_location_table_entry_hash_ (void *); extern void gt_pch_nx_named_label_use_entry (void *); extern void gt_pch_nx_vec_incomplete_var_va_gc_ (void *); extern void gt_pch_nx_hash_table_typename_hasher_ (void *); extern void gt_pch_nx_hash_table_mangled_decl_hash_ (void *); extern void gt_pch_nx_vec_pending_noexcept_va_gc_ (void *); extern void gt_pch_nx_vec_tree_int_va_gc_ (void *); extern void gt_pch_nx_hash_table_conv_type_hasher_ (void *); extern void gt_pch_nx_subsumption_entry (void *); extern void gt_pch_nx_hash_table_subsumption_hasher_ (void *); extern void gt_pch_nx_pending_template (void *); extern void gt_pch_nx_spec_entry (void *); extern void gt_pch_nx_hash_table_spec_hasher_ (void *); extern void gt_pch_nx_hash_map_tree_tree_pair_p_ (void *); extern void gt_pch_nx_vec_tinfo_s_va_gc_ (void *); extern void gt_pch_nx_vec_deferred_access_va_gc_ (void *); extern void gt_pch_nx_hash_table_cplus_array_hasher_ (void *); extern void gt_pch_nx_hash_table_list_hasher_ (void *); extern void gt_pch_nx_pending_abstract_type (void *); extern void gt_pch_nx_hash_table_abstract_type_hasher_ (void *); extern void gt_pch_nx_Statement (void *); extern void gt_pch_nx_binding_level (void *); extern void gt_pch_nx_d_label_use_entry (void *); extern void gt_pch_nx_hash_map_Statement__d_label_entry_ (void *); extern void gt_pch_nx_hash_table_module_hasher_ (void *); extern void gt_pch_nx_module_htab_entry (void *); extern void gt_pch_nx_hash_table_module_decl_hasher_ (void *); extern void gt_pch_nx_objc_map_private (void *); extern void gt_pch_nx_hashed_entry (void *); extern void gt_pch_nx_hashed_attribute (void *); extern void gt_pch_nx_imp_entry (void *); extern void gt_pch_nx_string_descriptor (void *); extern void gt_pch_nx_hash_table_objc_string_hasher_ (void *); extern void gt_pch_nx_vec_ident_data_tuple_va_gc_ (void *); extern void gt_pch_nx_vec_msgref_entry_va_gc_ (void *); extern void gt_pch_nx_vec_prot_list_entry_va_gc_ (void *); extern void gt_pch_nx_vec_ivarref_entry_va_gc_ (void *); extern void gt_pch_p_9line_maps (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9cpp_token (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9cpp_macro (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13string_concat (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16string_concat_db (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38hash_map_location_hash_string_concat__ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11bitmap_head (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7rtx_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9rtvec_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11symtab_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11symtab_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11symtab_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11cgraph_edge (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7section (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16cl_target_option (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15cl_optimization (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8edge_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15basic_block_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17stack_local_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16machine_function (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14bitmap_element (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_34generic_wide_int_wide_int_storage_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13coverage_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9mem_attrs (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9reg_attrs (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12object_block (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14vec_rtx_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10real_value (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11fixed_value (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23constant_descriptor_rtx (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8function (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10target_rtl (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15cgraph_rtl_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_42hash_map_tree_tree_decl_tree_cache_traits_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_42hash_map_tree_tree_type_tree_cache_traits_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12ptr_info_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14range_info_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10die_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_constructor_elt_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15vec_tree_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9lang_type (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9lang_decl (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24tree_statement_list_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14target_globals (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14lang_tree_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8tree_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13tree_decl_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12tree_int_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12tree_vec_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21vec_alias_pair_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13libfunc_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26hash_table_libfunc_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15target_libfuncs (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14sequence_stack (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_rtx_insn__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18call_site_record_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16vec_uchar_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_call_site_record_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9gimple_df (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11dw_fde_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17rtx_constant_pool (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11frame_space (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_callinfo_callee_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_callinfo_dalloc_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11stack_usage (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9eh_status (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18control_flow_graph (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_5loops (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17language_function (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14hash_set_tree_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24types_used_by_vars_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_used_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13nb_iter_bound (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9loop_exit (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_4loop (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10control_iv (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17vec_loop_p_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10niter_desc (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_loop_exit_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22vec_basic_block_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11rtl_bb_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15vec_edge_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_ipa_ref_t_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18section_hash_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18lto_file_decl_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15ipa_replace_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_ipa_replace_map__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21ipa_param_adjustments (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_36vec_ipa_param_performed_split_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17cgraph_simd_clone (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28cgraph_function_version_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_cgraph_edge_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_25cgraph_indirect_call_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8asm_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12symbol_table (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_section_name_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26hash_table_asmname_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_42hash_map_symtab_node__symbol_priority_map_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24constant_descriptor_tree (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_map_alias_set_hash_int_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15alias_set_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_alias_set_entry__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_35hash_table_function_version_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17lto_in_decl_state (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_35hash_table_ipa_bit_ggc_hash_traits_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_34hash_table_ipa_vr_ggc_hash_traits_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15ipa_node_params (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13ipa_edge_args (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_25ipa_agg_replacement_value (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14ipa_fn_summary (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10odr_type_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29vec_ipa_adjusted_param_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12param_access (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_param_access__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17isra_func_summary (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_isra_param_desc_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26ipa_sra_function_summaries (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8typeinfo (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11dw_cfi_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17dw_loc_descr_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18dw_loc_list_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18dw_discr_list_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15dw_cfa_location (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21vec_dw_cfi_ref_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16addr_table_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20indirect_string_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15dwarf_file_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20hash_map_char__tree_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10dw_cfi_row (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17reg_saved_in_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21vec_dw_fde_ref_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_34hash_table_indirect_string_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16comdat_type_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29vec_dw_line_info_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18dw_line_info_table (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23vec_dw_attr_node_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16limbo_die_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_dwarf_file_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_decl_die_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21vec_dw_die_ref_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21variable_value_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_variable_value_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_block_die_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12var_loc_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16var_loc_list_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17call_arg_loc_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_decl_loc_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22cached_dw_loc_list_def (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_dw_loc_list_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30vec_dw_line_info_table__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_pubname_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_macinfo_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_dw_ranges_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29vec_dw_ranges_by_label_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_die_arg_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23hash_table_addr_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_map_tree_sym_off_pair_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17inline_entry_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_36hash_table_inline_entry_data_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9temp_slot (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20initial_value_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22vec_temp_slot_p_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_const_int_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_const_wide_int_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_const_poly_int_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_reg_attr_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_const_double_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_const_fixed_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11eh_region_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16eh_landing_pad_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10eh_catch_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_eh_region_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_25vec_eh_landing_pad_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21hash_map_gimple__int_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_insn_cache_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23temp_slot_address_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_temp_address_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24hash_map_tree_hash_tree_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11test_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14test_of_length (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10test_other (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13test_of_union (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12example_base (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12example_base (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12example_base (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9test_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11user_struct (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_libfunc_decl_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16string_pool_data (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9type_hash (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_type_cache_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26hash_table_int_cst_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_poly_int_cst_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_cl_option_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38hash_table_tree_decl_map_cache_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_37hash_table_tree_vec_map_cache_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26hash_table_section_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31hash_table_object_block_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_34hash_table_tree_descriptor_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_const_rtx_desc_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_tm_clone_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_6gimple (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15tm_restart_node (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19hash_map_tree_tree_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_ssa_name_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_tm_restart_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28vec_mem_addr_template_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13scev_info_str (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_scev_info_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20ssa_operand_memory_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_36vec_omp_declare_variant_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30omp_declare_variant_base_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38hash_table_omp_declare_variant_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_42hash_table_omp_declare_variant_alt_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_dllimport_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24hash_map_char__unsigned_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18vec_gimple__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12int_range_1_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_ipa_agg_jf_item_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8ipa_bits (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31vec_ipa_param_descriptor_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_ipa_bits__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17vec_ipa_vr_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19ipcp_transformation (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_ipa_jump_func_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_39vec_ipa_polymorphic_call_context_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17ipa_node_params_t (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19ipa_edge_args_sum_t (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38function_summary_ipcp_transformation__ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_tm_wrapper_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_decl_state_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23vec_expr_eval_op_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_condition_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_size_time_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_44fast_function_summary_ipa_fn_summary__va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13tree_type_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38hash_table_tree_type_map_cache_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19vec_odr_type_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_35hash_table_value_annotation_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_Entity_Id_va_gc_atomic_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19tree_entity_vec_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_dummy_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11parm_attr_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_parm_attr_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10stmt_group (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9elab_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18range_check_info_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_range_check_info_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11loop_info_d (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_20vec_loop_info_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18gnat_binding_level (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18packable_type_hash (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_32hash_table_packable_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13pad_type_hash (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_pad_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12c_label_vars (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9c_binding (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_7c_scope (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15c_goto_bindings (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28vec_c_goto_bindings_p_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15c_inline_static (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18sorted_fields_type (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23vec_const_char_p_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22vec_tree_gc_vec_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11align_stack (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23vec_pending_weak_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31vec_pending_redefinition_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9opt_stack (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8c_parser (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18vec_c_token_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15binding_table_s (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_15binding_entry_s (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11cxx_binding (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16cp_binding_level (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_cp_class_binding_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14cp_token_cache (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_32vec_deferred_access_check_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28vec_cxx_saved_binding_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11saved_scope (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16cxx_int_tree_map (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17named_label_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_named_label_hash_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_35hash_table_cxx_int_tree_map_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11tree_pair_s (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22vec_tree_pair_s_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_named_decl_hash_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_11tinst_level (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10tree_check (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19vec_cp_token_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_8cp_lexer (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_31vec_cp_default_arg_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17cp_parser_context (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_38vec_cp_unparsed_functions_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9cp_parser (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18hash_map_tree_int_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16constexpr_fundef (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_35hash_table_constexpr_fundef_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14constexpr_call (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_constexpr_call_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9sat_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_22hash_table_sat_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_14coroutine_info (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_33hash_table_coroutine_info_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27source_location_table_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_44hash_table_source_location_table_entry_hash_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21named_label_use_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_25vec_incomplete_var_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27hash_table_typename_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_29hash_table_mangled_decl_hash_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_pending_noexcept_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_19vec_tree_int_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_28hash_table_conv_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17subsumption_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_subsumption_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16pending_template (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_10spec_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23hash_table_spec_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26hash_map_tree_tree_pair_p_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_18vec_tinfo_s_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_deferred_access_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_cplus_array_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23hash_table_list_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_21pending_abstract_type (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_32hash_table_abstract_type_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9Statement (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_13binding_level (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17d_label_use_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_34hash_map_Statement__d_label_entry_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_25hash_table_module_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17module_htab_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_module_decl_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16objc_map_private (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_12hashed_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_16hashed_attribute (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_9imp_entry (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_17string_descriptor (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_30hash_table_objc_string_hasher_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_27vec_ident_data_tuple_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_23vec_msgref_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_26vec_prot_list_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); extern void gt_pch_p_24vec_ivarref_entry_va_gc_ (void *, void *, gt_pointer_operator, void *); # 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" 2 typedef void (*gt_note_pointers) (void *, void *, gt_pointer_operator, void *); typedef void (*gt_handle_reorder) (void *, void *, gt_pointer_operator, void *); extern int gt_pch_note_object (void *, void *, gt_note_pointers); extern void gt_pch_note_reorder (void *, void *, gt_handle_reorder); extern void gt_clear_caches (); typedef void (*gt_pointer_walker) (void *); struct ggc_root_tab { void *base; size_t nelt; size_t stride; gt_pointer_walker cb; gt_pointer_walker pchw; }; extern const struct ggc_root_tab * const gt_ggc_rtab[]; extern const struct ggc_root_tab * const gt_ggc_deletable_rtab[]; extern const struct ggc_root_tab * const gt_pch_scalar_rtab[]; # 91 "/home/giulianob/gcc_git_gnu/gcc/gcc/ggc.h" extern int ggc_set_mark (const void *); extern int ggc_marked_p (const void *); extern void gt_pch_n_S (const void *); extern void gt_ggc_m_S (const void *); extern void init_stringpool (void); extern void init_ggc (void); extern bool ggc_protect_identifiers; extern void gt_pch_save (FILE *f); extern void *ggc_internal_alloc (size_t, void (*)(void *), size_t, size_t ) __attribute__ ((__malloc__)); inline void * ggc_internal_alloc (size_t s ) { return ggc_internal_alloc (s, nullptr, 0, 1 ); } extern size_t ggc_round_alloc_size (size_t requested_size); extern void *ggc_internal_cleared_alloc (size_t, void (*)(void *), size_t, size_t ) __attribute__ ((__malloc__)); inline void * ggc_internal_cleared_alloc (size_t s ) { return ggc_internal_cleared_alloc (s, nullptr, 0, 1 ); } extern void *ggc_realloc (void *, size_t ); extern void ggc_free (void *); extern void dump_ggc_loc_statistics (); template<typename T> void finalize (void *p) { static_cast<T *> (p)->~T (); } template<typename T> inline bool need_finalization_p () { return !__has_trivial_destructor (T); } template<typename T> inline T * ggc_alloc () { if (need_finalization_p<T> ()) return static_cast<T *> (ggc_internal_alloc (sizeof (T), finalize<T>, 0, 1 )); else return static_cast<T *> (ggc_internal_alloc (sizeof (T), nullptr, 0, 1 )); } template<typename T> inline T * ggc_alloc_no_dtor () { return static_cast<T *> (ggc_internal_alloc (sizeof (T), nullptr, 0, 1 )); } template<typename T> inline T * ggc_cleared_alloc () { if (need_finalization_p<T> ()) return static_cast<T *> (ggc_internal_cleared_alloc (sizeof (T), finalize<T>, 0, 1 )); else return static_cast<T *> (ggc_internal_cleared_alloc (sizeof (T), nullptr, 0, 1 )); } template<typename T> inline T * ggc_vec_alloc (size_t c ) { if (need_finalization_p<T> ()) return static_cast<T *> (ggc_internal_alloc (c * sizeof (T), finalize<T>, sizeof (T), c )); else return static_cast<T *> (ggc_internal_alloc (c * sizeof (T), nullptr, 0, 0 )); } template<typename T> inline T * ggc_cleared_vec_alloc (size_t c ) { if (need_finalization_p<T> ()) return static_cast<T *> (ggc_internal_cleared_alloc (c * sizeof (T), finalize<T>, sizeof (T), c )); else return static_cast<T *> (ggc_internal_cleared_alloc (c * sizeof (T), nullptr, 0, 0 )); } inline void * ggc_alloc_atomic (size_t s ) { return ggc_internal_alloc (s ); } template <typename T> inline void ggc_delete (T *ptr) { ptr->~T (); ggc_free (ptr); } extern const char *ggc_alloc_string (const char *contents, int length ); extern void ggc_collect (void); extern void ggc_trim (void); extern void ggc_grow (void); extern void ggc_register_root_tab (const struct ggc_root_tab *); extern void gt_pch_restore (FILE *f); extern void ggc_print_statistics (void); extern void stringpool_statistics (void); extern void init_ggc_heuristics (void); extern void report_heap_memory_use (void); inline struct rtx_def * ggc_alloc_rtx_def_stat (size_t s ) { return (struct rtx_def *) ggc_internal_alloc (s ); } inline union tree_node * ggc_alloc_tree_node_stat (size_t s ) { return (union tree_node *) ggc_internal_alloc (s ); } inline union tree_node * ggc_alloc_cleared_tree_node_stat (size_t s ) { return (union tree_node *) ggc_internal_cleared_alloc (s ); } inline gimple * ggc_alloc_cleared_gimple_statement_stat (size_t s ) { return (gimple *) ggc_internal_cleared_alloc (s ); } inline void gt_ggc_mx (const char *s) { ((const_cast<char *> (s)) != nullptr && ((void *) (const_cast<char *> (s))) != (void *) 1 && ! ggc_set_mark (const_cast<char *> (s))); } inline void gt_pch_nx (const char *) { } inline void gt_ggc_mx (int) { } inline void gt_pch_nx (int) { } inline void gt_pch_nx (unsigned int) { } # 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 1 # 30 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" extern void ggc_free (void *); extern size_t ggc_round_alloc_size (size_t requested_size); extern void *ggc_realloc (void *, size_t ); # 183 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" extern void dump_vec_loc_statistics (void); extern htab_t vec_mem_usage_hash; struct vec_prefix { void register_overhead (void *, size_t, size_t ); void release_overhead (void *, size_t, size_t, bool ); static unsigned calculate_allocation (vec_prefix *, unsigned, bool); static unsigned calculate_allocation_1 (unsigned, unsigned); template <typename, typename, typename> friend struct vec; friend struct va_gc; friend struct va_gc_atomic; friend struct va_heap; unsigned m_alloc : 31; unsigned m_using_auto_storage : 1; unsigned m_num; }; inline unsigned vec_prefix::calculate_allocation (vec_prefix *pfx, unsigned reserve, bool exact) { if (exact) return (pfx ? pfx->m_num : 0) + reserve; else if (!pfx) return ((4) > (reserve) ? (4) : (reserve)); return calculate_allocation_1 (pfx->m_alloc, pfx->m_num + reserve); } template<typename, typename, typename> struct vec; struct vl_embed { }; struct vl_ptr { }; # 254 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" struct va_heap { typedef vl_ptr default_layout; template<typename T> static void reserve (vec<T, va_heap, vl_embed> *&, unsigned, bool ); template<typename T> static void release (vec<T, va_heap, vl_embed> *&); }; template<typename T> inline void va_heap::reserve (vec<T, va_heap, vl_embed> *&v, unsigned reserve, bool exact ) { size_t elt_size = sizeof (T); unsigned alloc = vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact); ((void)(!(alloc) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 282, __FUNCTION__), 0 : 0)); if (0 && v) v->m_vecpfx.release_overhead (v, elt_size * v->allocated (), v->allocated (), false); size_t size = vec<T, va_heap, vl_embed>::embedded_size (alloc); unsigned nelem = v ? v->length () : 0; v = static_cast <vec<T, va_heap, vl_embed> *> (xrealloc (v, size)); v->embedded_init (alloc, nelem); if (0) v->m_vecpfx.register_overhead (v, alloc, elt_size ); } #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wfree-nonheap-object" template<typename T> void va_heap::release (vec<T, va_heap, vl_embed> *&v) { size_t elt_size = sizeof (T); if (v == nullptr) return; if (0) v->m_vecpfx.release_overhead (v, elt_size * v->allocated (), v->allocated (), true); ::free (v); v = nullptr; } #pragma GCC diagnostic pop struct va_gc { typedef vl_embed default_layout; template<typename T, typename A> static void reserve (vec<T, A, vl_embed> *&, unsigned, bool ); template<typename T, typename A> static void release (vec<T, A, vl_embed> *&v); }; template<typename T, typename A> inline void va_gc::release (vec<T, A, vl_embed> *&v) { if (v) ::ggc_free (v); v = nullptr; } template<typename T, typename A> void va_gc::reserve (vec<T, A, vl_embed> *&v, unsigned reserve, bool exact ) { unsigned alloc = vec_prefix::calculate_allocation (v ? &v->m_vecpfx : 0, reserve, exact); if (!alloc) { ::ggc_free (v); v = nullptr; return; } size_t size = vec<T, A, vl_embed>::embedded_size (alloc); size = ::ggc_round_alloc_size (size); size_t vec_offset = sizeof (vec_prefix); size_t elt_size = sizeof (T); alloc = (size - vec_offset) / elt_size; size = vec_offset + alloc * elt_size; unsigned nelem = v ? v->length () : 0; v = static_cast <vec<T, A, vl_embed> *> (::ggc_realloc (v, size )); v->embedded_init (alloc, nelem); } struct va_gc_atomic : va_gc { }; # 415 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A = va_heap, typename L = typename A::default_layout> struct vec { }; # 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T> void debug_helper (vec<T> &ref) { unsigned i; for (i = 0; i < ref.length (); ++i) { fprintf ( # 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 stderr # 440 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" , "[%d] = ", i); debug_slim (ref[i]); fputc ('\n', # 442 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 stderr # 442 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" ); } } template<typename T> void debug_helper (vec<T, va_gc> &ref) { unsigned i; for (i = 0; i < ref.length (); ++i) { fprintf ( # 458 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 stderr # 458 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" , "[%d] = ", i); debug_slim (ref[i]); fputc ('\n', # 460 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 stderr # 460 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" ); } } # 501 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template <typename T> inline void vec_default_construct (T *dst, unsigned n) { # 520 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" for ( ; n; ++dst, --n) ::new (static_cast<void*>(dst)) T (); } template <typename T> inline void vec_copy_construct (T *dst, const T *src, unsigned n) { for ( ; n; ++dst, ++src, --n) ::new (static_cast<void*>(dst)) T (*src); } struct vnull { template <typename T, typename A, typename L> constexpr operator vec<T, A, L> () { return vec<T, A, L>(); } }; extern vnull vNULL; # 574 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> struct vec<T, A, vl_embed> { public: unsigned allocated (void) const { return m_vecpfx.m_alloc; } unsigned length (void) const { return m_vecpfx.m_num; } bool is_empty (void) const { return m_vecpfx.m_num == 0; } T *address (void) { return m_vecdata; } const T *address (void) const { return m_vecdata; } T *begin () { return address (); } const T *begin () const { return address (); } T *end () { return address () + length (); } const T *end () const { return address () + length (); } const T &operator[] (unsigned) const; T &operator[] (unsigned); T &last (void); bool space (unsigned) const; bool iterate (unsigned, T *) const; bool iterate (unsigned, T **) const; vec *copy () const; void splice (const vec &); void splice (const vec *src); T *quick_push (const T &); T &pop (void); void truncate (unsigned); void quick_insert (unsigned, const T &); void ordered_remove (unsigned); void unordered_remove (unsigned); void block_remove (unsigned, unsigned); void qsort (int (*) (const void *, const void *)); void sort (int (*) (const void *, const void *, void *), void *); T *bsearch (const void *key, int (*compar)(const void *, const void *)); T *bsearch (const void *key, int (*compar)(const void *, const void *, void *), void *); unsigned lower_bound (T, bool (*)(const T &, const T &)) const; bool contains (const T &search) const; static size_t embedded_size (unsigned); void embedded_init (unsigned, unsigned = 0, unsigned = 0); void quick_grow (unsigned len); void quick_grow_cleared (unsigned len); template <typename, typename, typename> friend struct vec; friend struct va_gc; friend struct va_gc_atomic; friend struct va_heap; vec_prefix m_vecpfx; T m_vecdata[1]; }; # 645 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline bool vec_safe_space (const vec<T, A, vl_embed> *v, unsigned nelems) { return v ? v->space (nelems) : nelems == 0; } template<typename T, typename A> inline unsigned vec_safe_length (const vec<T, A, vl_embed> *v) { return v ? v->length () : 0; } template<typename T, typename A> inline T * vec_safe_address (vec<T, A, vl_embed> *v) { return v ? v->address () : nullptr; } template<typename T, typename A> inline bool vec_safe_is_empty (vec<T, A, vl_embed> *v) { return v ? v->is_empty () : true; } template<typename T, typename A> inline bool vec_safe_reserve (vec<T, A, vl_embed> *&v, unsigned nelems, bool exact = false ) { bool extend = nelems ? !vec_safe_space (v, nelems) : false; if (extend) A::reserve (v, nelems, exact ); return extend; } template<typename T, typename A> inline bool vec_safe_reserve_exact (vec<T, A, vl_embed> *&v, unsigned nelems ) { return vec_safe_reserve (v, nelems, true ); } template<typename T, typename A> inline void vec_alloc (vec<T, A, vl_embed> *&v, unsigned nelems ) { v = nullptr; vec_safe_reserve (v, nelems, false ); } template<typename T, typename A> inline void vec_free (vec<T, A, vl_embed> *&v) { A::release (v); } template<typename T, typename A> inline void vec_safe_grow (vec<T, A, vl_embed> *&v, unsigned len ) { unsigned oldlen = vec_safe_length (v); ((void)(!(len >= oldlen) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 729, __FUNCTION__), 0 : 0)); vec_safe_reserve_exact (v, len - oldlen ); v->quick_grow (len); } template<typename T, typename A> inline void vec_safe_grow_cleared (vec<T, A, vl_embed> *&v, unsigned len ) { unsigned oldlen = vec_safe_length (v); vec_safe_grow (v, len ); vec_default_construct (v->address () + oldlen, len - oldlen); } template<typename T> inline void vec_safe_grow_cleared (vec<T, va_heap, vl_ptr> *&v, unsigned len ) { v->safe_grow_cleared (len ); } template<typename T> inline bool vec_safe_reserve (vec<T, va_heap, vl_ptr> *&v, unsigned nelems, bool exact = false ) { return v->reserve (nelems, exact); } template<typename T, typename A> inline bool vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T **ptr) { if (v) return v->iterate (ix, ptr); else { *ptr = 0; return false; } } template<typename T, typename A> inline bool vec_safe_iterate (const vec<T, A, vl_embed> *v, unsigned ix, T *ptr) { if (v) return v->iterate (ix, ptr); else { *ptr = 0; return false; } } template<typename T, typename A> inline T * vec_safe_push (vec<T, A, vl_embed> *&v, const T &obj ) { vec_safe_reserve (v, 1, false ); return v->quick_push (obj); } template<typename T, typename A> inline void vec_safe_insert (vec<T, A, vl_embed> *&v, unsigned ix, const T &obj ) { vec_safe_reserve (v, 1, false ); v->quick_insert (ix, obj); } template<typename T, typename A> inline void vec_safe_truncate (vec<T, A, vl_embed> *v, unsigned size) { if (v) v->truncate (size); } template<typename T, typename A> inline vec<T, A, vl_embed> * vec_safe_copy (vec<T, A, vl_embed> *src ) { return src ? src->copy () : nullptr; } template<typename T, typename A> inline void vec_safe_splice (vec<T, A, vl_embed> *&dst, const vec<T, A, vl_embed> *src ) { unsigned src_len = vec_safe_length (src); if (src_len) { vec_safe_reserve_exact (dst, vec_safe_length (dst) + src_len ); dst->splice (*src); } } template<typename T, typename A> inline bool vec_safe_contains (vec<T, A, vl_embed> *v, const T &search) { return v ? v->contains (search) : false; } template<typename T, typename A> inline const T & vec<T, A, vl_embed>::operator[] (unsigned ix) const { ((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 870, __FUNCTION__), 0 : 0)); return m_vecdata[ix]; } template<typename T, typename A> inline T & vec<T, A, vl_embed>::operator[] (unsigned ix) { ((void)(!(ix < m_vecpfx.m_num) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 878, __FUNCTION__), 0 : 0)); return m_vecdata[ix]; } template<typename T, typename A> inline T & vec<T, A, vl_embed>::last (void) { ((void)(!(m_vecpfx.m_num > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 889, __FUNCTION__), 0 : 0)); return (*this)[m_vecpfx.m_num - 1]; } # 900 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline bool vec<T, A, vl_embed>::space (unsigned nelems) const { return m_vecpfx.m_alloc - m_vecpfx.m_num >= nelems; } # 915 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline bool vec<T, A, vl_embed>::iterate (unsigned ix, T *ptr) const { if (ix < m_vecpfx.m_num) { *ptr = m_vecdata[ix]; return true; } else { *ptr = 0; return false; } } # 941 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline bool vec<T, A, vl_embed>::iterate (unsigned ix, T **ptr) const { if (ix < m_vecpfx.m_num) { *ptr = (const_cast<T *> ((&m_vecdata[ix]))); return true; } else { *ptr = 0; return false; } } template<typename T, typename A> inline vec<T, A, vl_embed> * vec<T, A, vl_embed>::copy (void) const { vec<T, A, vl_embed> *new_vec = nullptr; unsigned len = length (); if (len) { vec_alloc (new_vec, len ); new_vec->embedded_init (len, len); vec_copy_construct (new_vec->address (), m_vecdata, len); } return new_vec; } template<typename T, typename A> inline void vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> &src) { unsigned len = src.length (); if (len) { ((void)(!(space (len)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 986, __FUNCTION__), 0 : 0)); vec_copy_construct (end (), src.address (), len); m_vecpfx.m_num += len; } } template<typename T, typename A> inline void vec<T, A, vl_embed>::splice (const vec<T, A, vl_embed> *src) { if (src) splice (*src); } template<typename T, typename A> inline T * vec<T, A, vl_embed>::quick_push (const T &obj) { ((void)(!(space (1)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1009, __FUNCTION__), 0 : 0)); T *slot = &m_vecdata[m_vecpfx.m_num++]; *slot = obj; return slot; } template<typename T, typename A> inline T & vec<T, A, vl_embed>::pop (void) { ((void)(!(length () > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1022, __FUNCTION__), 0 : 0)); return m_vecdata[--m_vecpfx.m_num]; } template<typename T, typename A> inline void vec<T, A, vl_embed>::truncate (unsigned size) { ((void)(!(length () >= size) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1034, __FUNCTION__), 0 : 0)); m_vecpfx.m_num = size; } template<typename T, typename A> inline void vec<T, A, vl_embed>::quick_insert (unsigned ix, const T &obj) { ((void)(!(length () < allocated ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1046, __FUNCTION__), 0 : 0)); ((void)(!(ix <= length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1047, __FUNCTION__), 0 : 0)); T *slot = &m_vecdata[ix]; memmove (slot + 1, slot, (m_vecpfx.m_num++ - ix) * sizeof (T)); *slot = obj; } template<typename T, typename A> inline void vec<T, A, vl_embed>::ordered_remove (unsigned ix) { ((void)(!(ix < length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1062, __FUNCTION__), 0 : 0)); T *slot = &m_vecdata[ix]; memmove (slot, slot + 1, (--m_vecpfx.m_num - ix) * sizeof (T)); } # 1105 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline void vec<T, A, vl_embed>::unordered_remove (unsigned ix) { ((void)(!(ix < length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1109, __FUNCTION__), 0 : 0)); m_vecdata[ix] = m_vecdata[--m_vecpfx.m_num]; } template<typename T, typename A> inline void vec<T, A, vl_embed>::block_remove (unsigned ix, unsigned len) { ((void)(!(ix + len <= length ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1121, __FUNCTION__), 0 : 0)); T *slot = &m_vecdata[ix]; m_vecpfx.m_num -= len; memmove (slot, slot + len, (m_vecpfx.m_num - ix) * sizeof (T)); } template<typename T, typename A> inline void vec<T, A, vl_embed>::qsort (int (*cmp) (const void *, const void *)) { if (length () > 1) gcc_qsort (address (), length (), sizeof (T), cmp); } template<typename T, typename A> inline void vec<T, A, vl_embed>::sort (int (*cmp) (const void *, const void *, void *), void *data) { if (length () > 1) gcc_sort_r (address (), length (), sizeof (T), cmp, data); } template<typename T, typename A> inline T * vec<T, A, vl_embed>::bsearch (const void *key, int (*compar) (const void *, const void *)) { const void *base = this->address (); size_t nmemb = this->length (); size_t size = sizeof (T); size_t l, u, idx; const void *p; int comparison; l = 0; u = nmemb; while (l < u) { idx = (l + u) / 2; p = (const void *) (((const char *) base) + (idx * size)); comparison = (*compar) (key, p); if (comparison < 0) u = idx; else if (comparison > 0) l = idx + 1; else return (T *)const_cast<void *>(p); } return nullptr; } template<typename T, typename A> inline T * vec<T, A, vl_embed>::bsearch (const void *key, int (*compar) (const void *, const void *, void *), void *data) { const void *base = this->address (); size_t nmemb = this->length (); size_t size = sizeof (T); size_t l, u, idx; const void *p; int comparison; l = 0; u = nmemb; while (l < u) { idx = (l + u) / 2; p = (const void *) (((const char *) base) + (idx * size)); comparison = (*compar) (key, p, data); if (comparison < 0) u = idx; else if (comparison > 0) l = idx + 1; else return (T *)const_cast<void *>(p); } return nullptr; } template<typename T, typename A> inline bool vec<T, A, vl_embed>::contains (const T &search) const { unsigned int len = length (); for (unsigned int i = 0; i < len; i++) if ((*this)[i] == search) return true; return false; } template<typename T, typename A> unsigned vec<T, A, vl_embed>::lower_bound (T obj, bool (*lessthan)(const T &, const T &)) const { unsigned int len = length (); unsigned int half, middle; unsigned int first = 0; while (len > 0) { half = len / 2; middle = first; middle += half; T middle_elem = (*this)[middle]; if (lessthan (middle_elem, obj)) { first = middle; ++first; len = len - half - 1; } else len = half; } return first; } # 1280 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, typename A> inline size_t vec<T, A, vl_embed>::embedded_size (unsigned alloc) { struct alignas (T) U { char data[sizeof (T)]; }; typedef vec<U, A, vl_embed> vec_embedded; typedef typename std::conditional<std::is_standard_layout<T>::value, vec, vec_embedded>::type vec_stdlayout; static_assert (sizeof (vec_stdlayout) == sizeof (vec), ""); static_assert (alignof (vec_stdlayout) == alignof (vec), ""); return # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 __builtin_offsetof ( # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" vec_stdlayout # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 , # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" m_vecdata # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" 3 4 ) # 1290 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" + alloc * sizeof (T); } template<typename T, typename A> inline void vec<T, A, vl_embed>::embedded_init (unsigned alloc, unsigned num, unsigned aut) { m_vecpfx.m_alloc = alloc; m_vecpfx.m_using_auto_storage = aut; m_vecpfx.m_num = num; } template<typename T, typename A> inline void vec<T, A, vl_embed>::quick_grow (unsigned len) { ((void)(!(length () <= len && len <= m_vecpfx.m_alloc) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1314, __FUNCTION__), 0 : 0)); m_vecpfx.m_num = len; } template<typename T, typename A> inline void vec<T, A, vl_embed>::quick_grow_cleared (unsigned len) { unsigned oldlen = length (); size_t growby = len - oldlen; quick_grow (len); if (growby != 0) vec_default_construct (address () + oldlen, growby); } template<typename T> void gt_ggc_mx (vec<T, va_gc> *v) { extern void gt_ggc_mx (T &); for (unsigned i = 0; i < v->length (); i++) gt_ggc_mx ((*v)[i]); } template<typename T> void gt_ggc_mx (vec<T, va_gc_atomic, vl_embed> *v __attribute__ ((__unused__))) { } template<typename T, typename A> void gt_pch_nx (vec<T, A, vl_embed> *v) { extern void gt_pch_nx (T &); for (unsigned i = 0; i < v->length (); i++) gt_pch_nx ((*v)[i]); } template<typename T, typename A> void gt_pch_nx (vec<T *, A, vl_embed> *v, gt_pointer_operator op, void *cookie) { for (unsigned i = 0; i < v->length (); i++) op (&((*v)[i]), cookie); } template<typename T, typename A> void gt_pch_nx (vec<T, A, vl_embed> *v, gt_pointer_operator op, void *cookie) { extern void gt_pch_nx (T *, gt_pointer_operator, void *); for (unsigned i = 0; i < v->length (); i++) gt_pch_nx (&((*v)[i]), op, cookie); } # 1410 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T> struct vec<T, va_heap, vl_ptr> { public: void create (unsigned nelems ); void release (void); bool exists (void) const { return m_vec != nullptr; } bool is_empty (void) const { return m_vec ? m_vec->is_empty () : true; } unsigned length (void) const { return m_vec ? m_vec->length () : 0; } T *address (void) { return m_vec ? m_vec->m_vecdata : nullptr; } const T *address (void) const { return m_vec ? m_vec->m_vecdata : nullptr; } T *begin () { return address (); } const T *begin () const { return address (); } T *end () { return begin () + length (); } const T *end () const { return begin () + length (); } const T &operator[] (unsigned ix) const { return (*m_vec)[ix]; } bool operator!=(const vec &other) const { return !(*this == other); } bool operator==(const vec &other) const { return address () == other.address (); } T &operator[] (unsigned ix) { return (*m_vec)[ix]; } T &last (void) { return m_vec->last (); } bool space (int nelems) const { return m_vec ? m_vec->space (nelems) : nelems == 0; } bool iterate (unsigned ix, T *p) const; bool iterate (unsigned ix, T **p) const; vec copy () const; bool reserve (unsigned, bool = false ); bool reserve_exact (unsigned ); void splice (const vec &); void safe_splice (const vec & ); T *quick_push (const T &); T *safe_push (const T &); T &pop (void); void truncate (unsigned); void safe_grow (unsigned ); void safe_grow_cleared (unsigned ); void quick_grow (unsigned); void quick_grow_cleared (unsigned); void quick_insert (unsigned, const T &); void safe_insert (unsigned, const T & ); void ordered_remove (unsigned); void unordered_remove (unsigned); void block_remove (unsigned, unsigned); void qsort (int (*) (const void *, const void *)); void sort (int (*) (const void *, const void *, void *), void *); T *bsearch (const void *key, int (*compar)(const void *, const void *)); T *bsearch (const void *key, int (*compar)(const void *, const void *, void *), void *); unsigned lower_bound (T, bool (*)(const T &, const T &)) const; bool contains (const T &search) const; void reverse (void); bool using_auto_storage () const; vec<T, va_heap, vl_embed> *m_vec; }; # 1500 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T, size_t N = 0> class auto_vec : public vec<T, va_heap> { public: auto_vec () { m_auto.embedded_init (((N) > (2) ? (N) : (2)), 0, 1); this->m_vec = &m_auto; } auto_vec (size_t s) { if (s > N) { this->create (s); return; } m_auto.embedded_init (((N) > (2) ? (N) : (2)), 0, 1); this->m_vec = &m_auto; } ~auto_vec () { this->release (); } private: vec<T, va_heap, vl_embed> m_auto; T m_data[((N - 1) > (1) ? (N - 1) : (1))]; }; template<typename T> class auto_vec<T, 0> : public vec<T, va_heap> { public: auto_vec () { this->m_vec = nullptr; } auto_vec (size_t n) { this->create (n); } ~auto_vec () { this->release (); } }; template<typename T> inline void vec_alloc (vec<T> *&v, unsigned nelems ) { v = new vec<T>; v->create (nelems ); } class auto_string_vec : public auto_vec <char *> { public: ~auto_string_vec (); }; # 1578 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template <typename T> class auto_delete_vec : public auto_vec <T *> { public: auto_delete_vec () {} auto_delete_vec (size_t s) : auto_vec <T *> (s) {} ~auto_delete_vec (); private: auto_delete_vec<T> (const auto_delete_vec<T>&) = delete; void operator= (const auto_delete_vec<T> &) = delete; }; template<typename T> inline void vec_check_alloc (vec<T, va_heap> *&vec, unsigned nelems ) { if (!vec) vec_alloc (vec, nelems ); } template<typename T> inline void vec_free (vec<T> *&v) { if (v == nullptr) return; v->release (); delete v; v = nullptr; } # 1624 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T> inline bool vec<T, va_heap, vl_ptr>::iterate (unsigned ix, T *ptr) const { if (m_vec) return m_vec->iterate (ix, ptr); else { *ptr = 0; return false; } } # 1647 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T> inline bool vec<T, va_heap, vl_ptr>::iterate (unsigned ix, T **ptr) const { if (m_vec) return m_vec->iterate (ix, ptr); else { *ptr = 0; return false; } } # 1686 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" inline auto_string_vec::~auto_string_vec () { int i; char *str; for (i = 0; (*this).iterate ((i), &(str)); ++(i)) free (str); } template <typename T> inline auto_delete_vec<T>::~auto_delete_vec () { int i; T *item; for (i = 0; (*this).iterate ((i), &(item)); ++(i)) delete item; } template<typename T> inline vec<T, va_heap, vl_ptr> vec<T, va_heap, vl_ptr>::copy (void) const { vec<T, va_heap, vl_ptr> new_vec = vNULL; if (length ()) new_vec.m_vec = m_vec->copy (); return new_vec; } # 1731 "/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h" template<typename T> inline bool vec<T, va_heap, vl_ptr>::reserve (unsigned nelems, bool exact ) { if (space (nelems)) return false; vec<T, va_heap, vl_embed> *oldvec = m_vec; unsigned int oldsize = 0; bool handle_auto_vec = m_vec && using_auto_storage (); if (handle_auto_vec) { m_vec = nullptr; oldsize = oldvec->length (); nelems += oldsize; } va_heap::reserve (m_vec, nelems, exact ); if (handle_auto_vec) { vec_copy_construct (m_vec->address (), oldvec->address (), oldsize); m_vec->m_vecpfx.m_num = oldsize; } return true; } template<typename T> inline bool vec<T, va_heap, vl_ptr>::reserve_exact (unsigned nelems ) { return reserve (nelems, true ); } template<typename T> inline void vec<T, va_heap, vl_ptr>::create (unsigned nelems ) { m_vec = nullptr; if (nelems > 0) reserve_exact (nelems ); } template<typename T> inline void vec<T, va_heap, vl_ptr>::release (void) { if (!m_vec) return; if (using_auto_storage ()) { m_vec->m_vecpfx.m_num = 0; return; } va_heap::release (m_vec); } template<typename T> inline void vec<T, va_heap, vl_ptr>::splice (const vec<T, va_heap, vl_ptr> &src) { if (src.length ()) m_vec->splice (*(src.m_vec)); } template<typename T> inline void vec<T, va_heap, vl_ptr>::safe_splice (const vec<T, va_heap, vl_ptr> &src ) { if (src.length ()) { reserve_exact (src.length ()); splice (src); } } template<typename T> inline T * vec<T, va_heap, vl_ptr>::quick_push (const T &obj) { return m_vec->quick_push (obj); } template<typename T> inline T * vec<T, va_heap, vl_ptr>::safe_push (const T &obj ) { reserve (1, false ); return quick_push (obj); } template<typename T> inline T & vec<T, va_heap, vl_ptr>::pop (void) { return m_vec->pop (); } template<typename T> inline void vec<T, va_heap, vl_ptr>::truncate (unsigned size) { if (m_vec) m_vec->truncate (size); else ((void)(!(size == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1885, __FUNCTION__), 0 : 0)); } template<typename T> inline void vec<T, va_heap, vl_ptr>::safe_grow (unsigned len ) { unsigned oldlen = length (); ((void)(!(oldlen <= len) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1898, __FUNCTION__), 0 : 0)); reserve_exact (len - oldlen ); if (m_vec) m_vec->quick_grow (len); else ((void)(!(len == 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1903, __FUNCTION__), 0 : 0)); } template<typename T> inline void vec<T, va_heap, vl_ptr>::safe_grow_cleared (unsigned len ) { unsigned oldlen = length (); size_t growby = len - oldlen; safe_grow (len ); if (growby != 0) vec_default_construct (address () + oldlen, growby); } template<typename T> inline void vec<T, va_heap, vl_ptr>::quick_grow (unsigned len) { ((void)(!(m_vec) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1930, __FUNCTION__), 0 : 0)); m_vec->quick_grow (len); } template<typename T> inline void vec<T, va_heap, vl_ptr>::quick_grow_cleared (unsigned len) { ((void)(!(m_vec) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/vec.h", 1943, __FUNCTION__), 0 : 0)); m_vec->quick_grow_cleared (len); } template<typename T> inline void vec<T, va_heap, vl_ptr>::quick_insert (unsigned ix, const T &obj) { m_vec->quick_insert (ix, obj); } template<typename T> inline void vec<T, va_heap, vl_ptr>::safe_insert (unsigned ix, const T &obj ) { reserve (1, false ); quick_insert (ix, obj); } template<typename T> inline void vec<T, va_heap, vl_ptr>::ordered_remove (unsigned ix) { m_vec->ordered_remove (ix); } template<typename T> inline void vec<T, va_heap, vl_ptr>::unordered_remove (unsigned ix) { m_vec->unordered_remove (ix); } template<typename T> inline void vec<T, va_heap, vl_ptr>::block_remove (unsigned ix, unsigned len) { m_vec->block_remove (ix, len); } template<typename T> inline void vec<T, va_heap, vl_ptr>::qsort (int (*cmp) (const void *, const void *)) { if (m_vec) m_vec->qsort (cmp); } template<typename T> inline void vec<T, va_heap, vl_ptr>::sort (int (*cmp) (const void *, const void *, void *), void *data) { if (m_vec) m_vec->sort (cmp, data); } template<typename T> inline T * vec<T, va_heap, vl_ptr>::bsearch (const void *key, int (*cmp) (const void *, const void *)) { if (m_vec) return m_vec->bsearch (key, cmp); return nullptr; } template<typename T> inline T * vec<T, va_heap, vl_ptr>::bsearch (const void *key, int (*cmp) (const void *, const void *, void *), void *data) { if (m_vec) return m_vec->bsearch (key, cmp, data); return nullptr; } template<typename T> inline unsigned vec<T, va_heap, vl_ptr>::lower_bound (T obj, bool (*lessthan)(const T &, const T &)) const { return m_vec ? m_vec->lower_bound (obj, lessthan) : 0; } template<typename T> inline bool vec<T, va_heap, vl_ptr>::contains (const T &search) const { return m_vec ? m_vec->contains (search) : false; } template<typename T> inline void vec<T, va_heap, vl_ptr>::reverse (void) { unsigned l = length (); T *ptr = address (); for (unsigned i = 0; i < l / 2; i++) std::swap (ptr[i], ptr[l - i - 1]); } template<typename T> inline bool vec<T, va_heap, vl_ptr>::using_auto_storage () const { return m_vec->m_vecpfx.m_using_auto_storage; } template<typename T> inline void release_vec_vec (vec<vec<T> > &vec) { for (unsigned i = 0; i < vec.length (); i++) vec[i].release (); vec.release (); } # 249 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/hashtab.h" 1 # 250 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h" 1 # 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h" hashval_t iterative_hash_host_wide_int (long, hashval_t); hashval_t iterative_hash_hashval_t (hashval_t, hashval_t); namespace inchash { class hash { public: hash (hashval_t seed = 0) { val = seed; bits = 0; } hashval_t end () { return val; } void add_int (unsigned v) { val = iterative_hash_hashval_t (v, val); } template<unsigned int N, typename T> void add_poly_int (const poly_int_pod<N, T> &v) { for (unsigned int i = 0; i < N; ++i) add_int (v.coeffs[i]); } void add_hwi (long v) { val = iterative_hash_host_wide_int (v, val); } template<unsigned int N, typename T> void add_poly_hwi (const poly_int_pod<N, T> &v) { for (unsigned int i = 0; i < N; ++i) add_hwi (v.coeffs[i]); } template<typename T> void add_wide_int (const generic_wide_int<T> &x) { add_int (x.get_len ()); for (unsigned i = 0; i < x.get_len (); i++) add_hwi (x.sext_elt (i)); } void add_ptr (const void *ptr) { add (&ptr, sizeof (ptr)); } void add (const void *data, size_t len) { val = iterative_hash (data, len, val); } void merge_hash (hashval_t other) { val = iterative_hash_hashval_t (other, val); } void merge (hash &other) { merge_hash (other.val); } template<class T> void add_object(T &obj) { add (&obj, sizeof(T)); } void add_flag (bool flag) { bits = (bits << 1) | flag; } void commit_flag () { add_int (bits); bits = 0; } void add_commutative (hash &a, hash &b) { if (a.end() > b.end()) { merge (b); merge (a); } else { merge (a); merge (b); } } private: hashval_t val; unsigned bits; }; } # 174 "/home/giulianob/gcc_git_gnu/gcc/gcc/inchash.h" inline hashval_t iterative_hash_hashval_t (hashval_t val, hashval_t val2) { hashval_t a = 0x9e3779b9; { a -= val; a -= val2; a ^= (val2>>13); val -= val2; val -= a; val ^= (a<< 8); val2 -= a; val2 -= val; val2 ^= ((val&0xffffffff)>>13); a -= val; a -= val2; a ^= ((val2&0xffffffff)>>12); val -= val2; val -= a; val = (val ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= val; val2 = (val2 ^ (val>> 5)) & 0xffffffff; a -= val; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; val -= val2; val -= a; val = (val ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= val; val2 = (val2 ^ (val>>15)) & 0xffffffff; }; return val2; } inline hashval_t iterative_hash_host_wide_int (long val, hashval_t val2) { if (sizeof (long) == sizeof (hashval_t)) return iterative_hash_hashval_t (val, val2); else { hashval_t a = (hashval_t) val; int zero = 0; hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 8 + zero)); { a -= b; a -= val2; a ^= (val2>>13); b -= val2; b -= a; b ^= (a<< 8); val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13); a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12); b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff; a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff; }; if (sizeof (long) > 2 * sizeof (hashval_t)) { hashval_t a = (hashval_t) (val >> (sizeof (hashval_t) * 16 + zero)); hashval_t b = (hashval_t) (val >> (sizeof (hashval_t) * 24 + zero)); { a -= b; a -= val2; a ^= (val2>>13); b -= val2; b -= a; b ^= (a<< 8); val2 -= a; val2 -= b; val2 ^= ((b&0xffffffff)>>13); a -= b; a -= val2; a ^= ((val2&0xffffffff)>>12); b -= val2; b -= a; b = (b ^ (a<<16)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>> 5)) & 0xffffffff; a -= b; a -= val2; a = (a ^ (val2>> 3)) & 0xffffffff; b -= val2; b -= a; b = (b ^ (a<<10)) & 0xffffffff; val2 -= a; val2 -= b; val2 = (val2 ^ (b>>15)) & 0xffffffff; }; } return val2; } } # 251 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats-traits.h" 1 # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats-traits.h" enum mem_alloc_origin { HASH_TABLE_ORIGIN, HASH_MAP_ORIGIN, HASH_SET_ORIGIN, VEC_ORIGIN, BITMAP_ORIGIN, GGC_ORIGIN, ALLOC_POOL_ORIGIN, MEM_ALLOC_ORIGIN_LENGTH }; static const char * mem_alloc_origin_names[] = { "Hash tables", "Hash maps", "Hash sets", "Heap vectors", "Bitmaps", "GGC memory", "Allocation pool" }; # 252 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h" 1 # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h" template <typename Type> struct typed_free_remove { static inline void remove (Type *p); }; template <typename Type> inline void typed_free_remove <Type>::remove (Type *p) { free (p); } template <typename Type> struct typed_delete_remove { static inline void remove (Type *p); }; template <typename Type> inline void typed_delete_remove <Type>::remove (Type *p) { delete p; } template <typename Type> struct typed_noop_remove { static inline void remove (Type &); }; template <typename Type> inline void typed_noop_remove <Type>::remove (Type &) { } template <typename Type, Type Empty, Type Deleted = Empty> struct int_hash : typed_noop_remove <Type> { typedef Type value_type; typedef Type compare_type; static inline hashval_t hash (value_type); static inline bool equal (value_type existing, value_type candidate); static inline void mark_deleted (Type &); static const bool empty_zero_p = Empty == 0; static inline void mark_empty (Type &); static inline bool is_deleted (Type); static inline bool is_empty (Type); }; template <typename Type, Type Empty, Type Deleted> inline hashval_t int_hash <Type, Empty, Deleted>::hash (value_type x) { return x; } template <typename Type, Type Empty, Type Deleted> inline bool int_hash <Type, Empty, Deleted>::equal (value_type x, value_type y) { return x == y; } template <typename Type, Type Empty, Type Deleted> inline void int_hash <Type, Empty, Deleted>::mark_deleted (Type &x) { ((void)(!(Empty != Deleted) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-traits.h", 115, __FUNCTION__), 0 : 0)); x = Deleted; } template <typename Type, Type Empty, Type Deleted> inline void int_hash <Type, Empty, Deleted>::mark_empty (Type &x) { x = Empty; } template <typename Type, Type Empty, Type Deleted> inline bool int_hash <Type, Empty, Deleted>::is_deleted (Type x) { return Empty != Deleted && x == Deleted; } template <typename Type, Type Empty, Type Deleted> inline bool int_hash <Type, Empty, Deleted>::is_empty (Type x) { return x == Empty; } template <typename Type> struct pointer_hash { typedef Type *value_type; typedef Type *compare_type; static inline hashval_t hash (const value_type &); static inline bool equal (const value_type &existing, const compare_type &candidate); static inline void mark_deleted (Type *&); static const bool empty_zero_p = true; static inline void mark_empty (Type *&); static inline bool is_deleted (Type *); static inline bool is_empty (Type *); }; template <typename Type> inline hashval_t pointer_hash <Type>::hash (const value_type &candidate) { return (hashval_t) ((intptr_t)candidate >> 3); } template <typename Type> inline bool pointer_hash <Type>::equal (const value_type &existing, const compare_type &candidate) { return existing == candidate; } template <typename Type> inline void pointer_hash <Type>::mark_deleted (Type *&e) { e = reinterpret_cast<Type *> (1); } template <typename Type> inline void pointer_hash <Type>::mark_empty (Type *&e) { e = nullptr; } template <typename Type> inline bool pointer_hash <Type>::is_deleted (Type *e) { return e == reinterpret_cast<Type *> (1); } template <typename Type> inline bool pointer_hash <Type>::is_empty (Type *e) { return e == nullptr; } struct string_hash : pointer_hash <const char> { static inline hashval_t hash (const char *); static inline bool equal (const char *, const char *); }; inline hashval_t string_hash::hash (const char *id) { return htab_hash_string (id); } inline bool string_hash::equal (const char *id1, const char *id2) { return strcmp (id1, id2) == 0; } template<typename T> struct ggc_remove { static void remove (T &) {} static void ggc_mx (T &p) { extern void gt_ggc_mx (T &); gt_ggc_mx (p); } static void ggc_maybe_mx (T &p) { ggc_mx (p); } static void pch_nx (T &p) { extern void gt_pch_nx (T &); gt_pch_nx (p); } static void pch_nx (T &p, gt_pointer_operator op, void *cookie) { op (&p, cookie); } }; template<typename T> struct ggc_cache_remove : ggc_remove<T> { static void ggc_maybe_mx (T &) {} static int keep_cache_entry (T &e) { return ggc_marked_p (e) ? -1 : 0; } }; template <typename T> struct nofree_ptr_hash : pointer_hash <T>, typed_noop_remove <T *> {}; template <typename T> struct free_ptr_hash : pointer_hash <T>, typed_free_remove <T> {}; template <typename T> struct delete_ptr_hash : pointer_hash <T>, typed_delete_remove <T> {}; template <typename T> struct ggc_ptr_hash : pointer_hash <T>, ggc_remove <T *> {}; template <typename T> struct ggc_cache_ptr_hash : pointer_hash <T>, ggc_cache_remove <T *> {}; struct nofree_string_hash : string_hash, typed_noop_remove <const char *> {}; template <typename T1, typename T2> struct pair_hash { typedef std::pair <typename T1::value_type, typename T2::value_type> value_type; typedef std::pair <typename T1::compare_type, typename T2::compare_type> compare_type; static inline hashval_t hash (const value_type &); static inline bool equal (const value_type &, const compare_type &); static inline void remove (value_type &); static inline void mark_deleted (value_type &); static const bool empty_zero_p = T1::empty_zero_p; static inline void mark_empty (value_type &); static inline bool is_deleted (const value_type &); static inline bool is_empty (const value_type &); }; template <typename T1, typename T2> inline hashval_t pair_hash <T1, T2>::hash (const value_type &x) { return iterative_hash_hashval_t (T1::hash (x.first), T2::hash (x.second)); } template <typename T1, typename T2> inline bool pair_hash <T1, T2>::equal (const value_type &x, const compare_type &y) { return T1::equal (x.first, y.first) && T2::equal (x.second, y.second); } template <typename T1, typename T2> inline void pair_hash <T1, T2>::remove (value_type &x) { T1::remove (x.first); T2::remove (x.second); } template <typename T1, typename T2> inline void pair_hash <T1, T2>::mark_deleted (value_type &x) { T1::mark_deleted (x.first); } template <typename T1, typename T2> inline void pair_hash <T1, T2>::mark_empty (value_type &x) { T1::mark_empty (x.first); } template <typename T1, typename T2> inline bool pair_hash <T1, T2>::is_deleted (const value_type &x) { return T1::is_deleted (x.first); } template <typename T1, typename T2> inline bool pair_hash <T1, T2>::is_empty (const value_type &x) { return T1::is_empty (x.first); } template <typename T> struct default_hash_traits : T {}; template <typename T> struct default_hash_traits <T *> : ggc_ptr_hash <T> {}; # 253 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map-traits.h" 1 # 31 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map-traits.h" template <typename H, typename Value> struct simple_hashmap_traits { typedef typename H::value_type key_type; static const bool maybe_mx = true; static inline hashval_t hash (const key_type &); static inline bool equal_keys (const key_type &, const key_type &); template <typename T> static inline void remove (T &); static const bool empty_zero_p = H::empty_zero_p; template <typename T> static inline bool is_empty (const T &); template <typename T> static inline bool is_deleted (const T &); template <typename T> static inline void mark_empty (T &); template <typename T> static inline void mark_deleted (T &); }; template <typename H, typename Value> inline hashval_t simple_hashmap_traits <H, Value>::hash (const key_type &h) { return H::hash (h); } template <typename H, typename Value> inline bool simple_hashmap_traits <H, Value>::equal_keys (const key_type &k1, const key_type &k2) { return H::equal (k1, k2); } template <typename H, typename Value> template <typename T> inline void simple_hashmap_traits <H, Value>::remove (T &entry) { H::remove (entry.m_key); entry.m_value.~Value (); } template <typename H, typename Value> template <typename T> inline bool simple_hashmap_traits <H, Value>::is_empty (const T &entry) { return H::is_empty (entry.m_key); } template <typename H, typename Value> template <typename T> inline bool simple_hashmap_traits <H, Value>::is_deleted (const T &entry) { return H::is_deleted (entry.m_key); } template <typename H, typename Value> template <typename T> inline void simple_hashmap_traits <H, Value>::mark_empty (T &entry) { H::mark_empty (entry.m_key); } template <typename H, typename Value> template <typename T> inline void simple_hashmap_traits <H, Value>::mark_deleted (T &entry) { H::mark_deleted (entry.m_key); } template <typename H, typename Value> struct simple_cache_map_traits: public simple_hashmap_traits<H,Value> { static const bool maybe_mx = false; }; template <typename Value> struct unbounded_hashmap_traits { template <typename T> static inline void remove (T &); static const bool empty_zero_p = default_hash_traits <Value>::empty_zero_p; template <typename T> static inline bool is_empty (const T &); template <typename T> static inline bool is_deleted (const T &); template <typename T> static inline void mark_empty (T &); template <typename T> static inline void mark_deleted (T &); }; template <typename Value> template <typename T> inline void unbounded_hashmap_traits <Value>::remove (T &entry) { default_hash_traits <Value>::remove (entry.m_value); } template <typename Value> template <typename T> inline bool unbounded_hashmap_traits <Value>::is_empty (const T &entry) { return default_hash_traits <Value>::is_empty (entry.m_value); } template <typename Value> template <typename T> inline bool unbounded_hashmap_traits <Value>::is_deleted (const T &entry) { return default_hash_traits <Value>::is_deleted (entry.m_value); } template <typename Value> template <typename T> inline void unbounded_hashmap_traits <Value>::mark_empty (T &entry) { default_hash_traits <Value>::mark_empty (entry.m_value); } template <typename Value> template <typename T> inline void unbounded_hashmap_traits <Value>::mark_deleted (T &entry) { default_hash_traits <Value>::mark_deleted (entry.m_value); } template <typename Key, typename Value> struct unbounded_int_hashmap_traits : unbounded_hashmap_traits <Value> { typedef Key key_type; static inline hashval_t hash (Key); static inline bool equal_keys (Key, Key); }; template <typename Key, typename Value> inline hashval_t unbounded_int_hashmap_traits <Key, Value>::hash (Key k) { return k; } template <typename Key, typename Value> inline bool unbounded_int_hashmap_traits <Key, Value>::equal_keys (Key k1, Key k2) { return k1 == k2; } # 254 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 template<typename, typename, typename> class hash_map; template<typename, bool, typename> class hash_set; template <typename Type> struct xcallocator { static Type *data_alloc (size_t count); static void data_free (Type *memory); }; template <typename Type> inline Type * xcallocator <Type>::data_alloc (size_t count) { return static_cast <Type *> (xcalloc (count, sizeof (Type))); } template <typename Type> inline void xcallocator <Type>::data_free (Type *memory) { return ::free (memory); } struct prime_ent { hashval_t prime; hashval_t inv; hashval_t inv_m2; hashval_t shift; }; extern struct prime_ent const prime_tab[]; extern unsigned int hash_table_sanitize_eq_limit; extern unsigned int hash_table_higher_prime_index (unsigned long n) __attribute__ ((__pure__)); extern __attribute__ ((__noreturn__)) __attribute__ ((__cold__)) void hashtab_chk_error (); # 322 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" inline hashval_t mul_mod (hashval_t x, hashval_t y, hashval_t inv, int shift) { hashval_t t1, t2, t3, t4, q, r; t1 = ((uint64_t)x * inv) >> 32; t2 = x - t1; t3 = t2 >> 1; t4 = t1 + t3; q = t4 >> shift; r = x - (q * y); return r; } inline hashval_t hash_table_mod1 (hashval_t hash, unsigned int index) { const struct prime_ent *p = &prime_tab[index]; ((void)(!(sizeof (hashval_t) * 8 <= 32) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 343, __FUNCTION__), 0 : 0)); return mul_mod (hash, p->prime, p->inv, p->shift); } inline hashval_t hash_table_mod2 (hashval_t hash, unsigned int index) { const struct prime_ent *p = &prime_tab[index]; ((void)(!(sizeof (hashval_t) * 8 <= 32) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 353, __FUNCTION__), 0 : 0)); return 1 + mul_mod (hash, p->prime - 2, p->inv_m2, p->shift); } class mem_usage; # 372 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" template <typename Descriptor, bool Lazy = false, template<typename Type> class Allocator = xcallocator> class hash_table { typedef typename Descriptor::value_type value_type; typedef typename Descriptor::compare_type compare_type; public: explicit hash_table (size_t, bool ggc = false, bool sanitize_eq_and_hash = true, bool gather_mem_stats = 0, mem_alloc_origin origin = HASH_TABLE_ORIGIN ); explicit hash_table (const hash_table &, bool ggc = false, bool sanitize_eq_and_hash = true, bool gather_mem_stats = 0, mem_alloc_origin origin = HASH_TABLE_ORIGIN ); ~hash_table (); static hash_table * create_ggc (size_t n, bool sanitize_eq_and_hash = true ) { hash_table *table = ggc_alloc<hash_table> (); new (table) hash_table (n, true, sanitize_eq_and_hash, 0, HASH_TABLE_ORIGIN ); return table; } size_t size () const { return m_size; } size_t elements () const { return m_n_elements - m_n_deleted; } size_t elements_with_deleted () const { return m_n_elements; } void empty () { if (elements ()) empty_slow (); } bool is_empty () const { return elements () == 0; } void clear_slot (value_type *); value_type &find_with_hash (const compare_type &, hashval_t); value_type &find (const value_type &value) { return find_with_hash (value, Descriptor::hash (value)); } value_type *find_slot (const value_type &value, insert_option insert) { return find_slot_with_hash (value, Descriptor::hash (value), insert); } # 445 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" value_type *find_slot_with_hash (const compare_type &comparable, hashval_t hash, enum insert_option insert); void remove_elt_with_hash (const compare_type &, hashval_t); void remove_elt (const value_type &value) { remove_elt_with_hash (value, Descriptor::hash (value)); } template <typename Argument, int (*Callback) (value_type *slot, Argument argument)> void traverse_noresize (Argument argument); template <typename Argument, int (*Callback) (value_type *slot, Argument argument)> void traverse (Argument argument); class iterator { public: iterator () : m_slot (nullptr), m_limit (nullptr) {} iterator (value_type *slot, value_type *limit) : m_slot (slot), m_limit (limit) {} inline value_type &operator * () { return *m_slot; } void slide (); inline iterator &operator ++ (); bool operator != (const iterator &other) const { return m_slot != other.m_slot || m_limit != other.m_limit; } private: value_type *m_slot; value_type *m_limit; }; iterator begin () const { if (Lazy && m_entries == nullptr) return iterator (); iterator iter (m_entries, m_entries + m_size); iter.slide (); return iter; } iterator end () const { return iterator (); } double collisions () const { return m_searches ? static_cast <double> (m_collisions) / m_searches : 0; } private: void operator= (hash_table&); template<typename T> friend void gt_ggc_mx (hash_table<T> *); template<typename T> friend void gt_pch_nx (hash_table<T> *); template<typename T> friend void hashtab_entry_note_pointers (void *, void *, gt_pointer_operator, void *); template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *); template<typename T, typename U> friend void gt_pch_nx (hash_set<T, false, U> *, gt_pointer_operator, void *); template<typename T> friend void gt_pch_nx (hash_table<T> *, gt_pointer_operator, void *); template<typename T> friend void gt_cleare_cache (hash_table<T> *); void empty_slow (); value_type *alloc_entries (size_t n ) const; value_type *find_empty_slot_for_expand (hashval_t); void verify (const compare_type &comparable, hashval_t hash); bool too_empty_p (unsigned int); void expand (); static bool is_deleted (value_type &v) { return Descriptor::is_deleted (v); } static bool is_empty (value_type &v) { return Descriptor::is_empty (v); } static void mark_deleted (value_type &v) { Descriptor::mark_deleted (v); } static void mark_empty (value_type &v) { Descriptor::mark_empty (v); } typename Descriptor::value_type *m_entries; size_t m_size; size_t m_n_elements; size_t m_n_deleted; unsigned int m_searches; unsigned int m_collisions; unsigned int m_size_prime_index; bool m_ggc; bool m_sanitize_eq_and_hash; static const bool m_gather_mem_stats = false; }; # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 1 # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" template<typename Key, typename Value, typename Traits = simple_hashmap_traits<default_hash_traits<Key>, Value> > class hash_map; class mem_location { public: inline mem_location () {} inline mem_location (mem_alloc_origin origin, bool ggc, const char *filename = nullptr, int line = 0, const char *function = nullptr): m_filename (filename), m_function (function), m_line (line), m_origin (origin), m_ggc (ggc) {} inline mem_location (mem_location &other): m_filename (other.m_filename), m_function (other.m_function), m_line (other.m_line), m_origin (other.m_origin), m_ggc (other.m_ggc) {} hashval_t hash () { inchash::hash hash; hash.add_ptr (m_filename); hash.add_ptr (m_function); hash.add_int (m_line); return hash.end (); } int equal (const mem_location &other) { return m_filename == other.m_filename && m_function == other.m_function && m_line == other.m_line; } inline const char * get_trimmed_filename () { const char *s1 = m_filename; const char *s2; while ((s2 = strstr (s1, "gcc/"))) s1 = s2 + 4; return s1; } inline char * to_string () { unsigned l = strlen (get_trimmed_filename ()) + strlen (m_function) + 30; char *s = ((char *) xmalloc (sizeof (char) * (l))); sprintf (s, "%s:%i (%s)", get_trimmed_filename (), m_line, m_function); s[((48) < (l - 1) ? (48) : (l - 1))] = '\0'; return s; } static const char * get_origin_name (mem_alloc_origin origin) { return mem_alloc_origin_names[(unsigned) origin]; } const char *m_filename; const char *m_function; int m_line; mem_alloc_origin m_origin; bool m_ggc; }; class mem_usage { public: mem_usage (): m_allocated (0), m_times (0), m_peak (0), m_instances (1) {} mem_usage (size_t allocated, size_t times, size_t peak, size_t instances = 0): m_allocated (allocated), m_times (times), m_peak (peak), m_instances (instances) {} inline void register_overhead (size_t size) { m_allocated += size; m_times++; if (m_peak < m_allocated) m_peak = m_allocated; } inline void release_overhead (size_t size) { ((void)(!(size <= m_allocated) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h", 153, __FUNCTION__), 0 : 0)); m_allocated -= size; } mem_usage operator+ (const mem_usage &second) { return mem_usage (m_allocated + second.m_allocated, m_times + second.m_times, m_peak + second.m_peak, m_instances + second.m_instances); } inline bool operator== (const mem_usage &second) const { return (m_allocated == second.m_allocated && m_peak == second.m_peak && m_times == second.m_times); } inline bool operator< (const mem_usage &second) const { if (*this == second) return false; return (m_allocated == second.m_allocated ? (m_peak == second.m_peak ? m_times < second.m_times : m_peak < second.m_peak) : m_allocated < second.m_allocated); } static int compare (const void *first, const void *second) { typedef std::pair<mem_location *, mem_usage *> mem_pair_t; const mem_pair_t f = *(const mem_pair_t *)first; const mem_pair_t s = *(const mem_pair_t *)second; if (*f.second == *s.second) return 0; return *f.second < *s.second ? 1 : -1; } inline void dump (mem_location *loc, const mem_usage &total) const { char *location_string = loc->to_string (); fprintf ( # 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" , "%-48s " "%" "9" # 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 "l" "u" # 210 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" "%c" ":%5.1f%%" "%" "9" # 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 "l" "u" # 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" "%c" "%" "9" # 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 "l" "u" # 211 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" "%c" ":%5.1f%%%10s\n", location_string, (uint64_t)(((m_allocated) < 10 * 1024 ? (m_allocated) : ((m_allocated) < 10 * (1024 * 1024) ? (m_allocated) / 1024 : (m_allocated) / (1024 * 1024)))), ((m_allocated) < 10 * 1024 ? ' ' : ((m_allocated) < 10 * (1024 * 1024) ? 'k' : 'M')), get_percent (m_allocated, total.m_allocated), (uint64_t)(((m_peak) < 10 * 1024 ? (m_peak) : ((m_peak) < 10 * (1024 * 1024) ? (m_peak) / 1024 : (m_peak) / (1024 * 1024)))), ((m_peak) < 10 * 1024 ? ' ' : ((m_peak) < 10 * (1024 * 1024) ? 'k' : 'M')), (uint64_t)(((m_times) < 10 * 1024 ? (m_times) : ((m_times) < 10 * (1024 * 1024) ? (m_times) / 1024 : (m_times) / (1024 * 1024)))), ((m_times) < 10 * 1024 ? ' ' : ((m_times) < 10 * (1024 * 1024) ? 'k' : 'M')), get_percent (m_times, total.m_times), loc->m_ggc ? "ggc" : "heap"); free (location_string); } inline void dump_footer () const { fprintf ( # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" , "%s" "%" "53" # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 "l" "u" # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" "%c" "%" "26" # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 "l" "u" # 224 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" "%c" "\n", "Total", (uint64_t)(((m_allocated) < 10 * 1024 ? (m_allocated) : ((m_allocated) < 10 * (1024 * 1024) ? (m_allocated) / 1024 : (m_allocated) / (1024 * 1024)))), ((m_allocated) < 10 * 1024 ? ' ' : ((m_allocated) < 10 * (1024 * 1024) ? 'k' : 'M')), (uint64_t)(((m_times) < 10 * 1024 ? (m_times) : ((m_times) < 10 * (1024 * 1024) ? (m_times) / 1024 : (m_times) / (1024 * 1024)))), ((m_times) < 10 * 1024 ? ' ' : ((m_times) < 10 * (1024 * 1024) ? 'k' : 'M'))); } static inline float get_percent (size_t nominator, size_t denominator) { return denominator == 0 ? 0.0f : nominator * 100.0 / denominator; } static inline void print_dash_line (size_t count = 140) { while (count--) fputc ('-', # 240 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 240 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" ); fputc ('\n', # 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 241 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" ); } static inline void dump_header (const char *name) { fprintf ( # 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 248 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" , "%-48s %11s%16s%10s%17s\n", name, "Leak", "Peak", "Times", "Type"); } size_t m_allocated; size_t m_times; size_t m_peak; size_t m_instances; }; template <class T> class mem_usage_pair { public: mem_usage_pair (T *usage_, size_t allocated_): usage (usage_), allocated (allocated_) {} T *usage; size_t allocated; }; template <class T> class mem_alloc_description { public: struct mem_location_hash : nofree_ptr_hash <mem_location> { static hashval_t hash (value_type l) { inchash::hash hstate; hstate.add_ptr ((const void *)l->m_filename); hstate.add_ptr (l->m_function); hstate.add_int (l->m_line); return hstate.end (); } static bool equal (value_type l1, value_type l2) { return (l1->m_filename == l2->m_filename && l1->m_function == l2->m_function && l1->m_line == l2->m_line); } }; typedef hash_map <mem_location_hash, T *> mem_map_t; typedef hash_map <const void *, mem_usage_pair<T> > reverse_mem_map_t; typedef hash_map <const void *, std::pair<T *, size_t> > reverse_object_map_t; typedef std::pair <mem_location *, T *> mem_list_t; mem_alloc_description (); ~mem_alloc_description (); bool contains_descriptor_for_instance (const void *ptr); T *get_descriptor_for_instance (const void *ptr); T *register_descriptor (const void *ptr, mem_location *location); T *register_descriptor (const void *ptr, mem_alloc_origin origin, bool ggc, const char *name, int line, const char *function); T *register_instance_overhead (size_t size, const void *ptr); void register_object_overhead (T *usage, size_t size, const void *ptr); T *release_instance_overhead (void *ptr, size_t size, bool remove_from_map = false); void release_object_overhead (void *ptr); void unregister_descriptor (void *ptr); T get_sum (mem_alloc_origin origin); mem_list_t *get_list (mem_alloc_origin origin, unsigned *length); void dump (mem_alloc_origin origin); reverse_object_map_t *m_reverse_object_map; private: T *register_overhead (size_t size, mem_alloc_origin origin, const char *name, int line, const char *function, const void *ptr); mem_location m_location; mem_map_t *m_map; reverse_mem_map_t *m_reverse_map; }; template <class T> inline bool mem_alloc_description<T>::contains_descriptor_for_instance (const void *ptr) { return m_reverse_map->get (ptr); } template <class T> inline T* mem_alloc_description<T>::get_descriptor_for_instance (const void *ptr) { return m_reverse_map->get (ptr) ? (*m_reverse_map->get (ptr)).usage : nullptr; } template <class T> inline T* mem_alloc_description<T>::register_descriptor (const void *ptr, mem_location *location) { T *usage = nullptr; T **slot = m_map->get (location); if (slot) { delete location; usage = *slot; usage->m_instances++; } else { usage = new T (); m_map->put (location, usage); } if (!m_reverse_map->get (ptr)) m_reverse_map->put (ptr, mem_usage_pair<T> (usage, 0)); return usage; } template <class T> inline T* mem_alloc_description<T>::register_descriptor (const void *ptr, mem_alloc_origin origin, bool ggc, const char *filename, int line, const char *function) { mem_location *l = new mem_location (origin, ggc, filename, line, function); return register_descriptor (ptr, l); } template <class T> inline T* mem_alloc_description<T>::register_instance_overhead (size_t size, const void *ptr) { mem_usage_pair <T> *slot = m_reverse_map->get (ptr); if (!slot) { return nullptr; } T *usage = (*slot).usage; usage->register_overhead (size); return usage; } template <class T> void mem_alloc_description<T>::register_object_overhead (T *usage, size_t size, const void *ptr) { m_reverse_object_map->put (ptr, std::pair<T *, size_t> (usage, size)); } template <class T> inline T* mem_alloc_description<T>::register_overhead (size_t size, mem_alloc_origin origin, const char *filename, int line, const char *function, const void *ptr) { T *usage = register_descriptor (ptr, origin, filename, line, function); usage->register_overhead (size); return usage; } template <class T> inline T * mem_alloc_description<T>::release_instance_overhead (void *ptr, size_t size, bool remove_from_map) { mem_usage_pair<T> *slot = m_reverse_map->get (ptr); if (!slot) { return nullptr; } T *usage = (*slot).usage; usage->release_overhead (size); if (remove_from_map) m_reverse_map->remove (ptr); return usage; } template <class T> inline void mem_alloc_description<T>::release_object_overhead (void *ptr) { std::pair <T *, size_t> *entry = m_reverse_object_map->get (ptr); entry->first->release_overhead (entry->second); m_reverse_object_map->remove (ptr); } template <class T> inline void mem_alloc_description<T>::unregister_descriptor (void *ptr) { m_reverse_map->remove (ptr); } template <class T> inline mem_alloc_description<T>::mem_alloc_description () { m_map = new mem_map_t (13, false, false, false); m_reverse_map = new reverse_mem_map_t (13, false, false, false); m_reverse_object_map = new reverse_object_map_t (13, false, false, false); } template <class T> inline mem_alloc_description<T>::~mem_alloc_description () { for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end (); ++it) { delete (*it).first; delete (*it).second; } delete m_map; delete m_reverse_map; delete m_reverse_object_map; } template <class T> inline typename mem_alloc_description<T>::mem_list_t * mem_alloc_description<T>::get_list (mem_alloc_origin origin, unsigned *length) { size_t element_size = sizeof (mem_list_t); mem_list_t *list = ((mem_list_t *) xcalloc ((m_map->elements ()), sizeof (mem_list_t))); unsigned i = 0; for (typename mem_map_t::iterator it = m_map->begin (); it != m_map->end (); ++it) if ((*it).first->m_origin == origin) list[i++] = std::pair<mem_location*, T*> (*it); gcc_qsort (list, i, element_size, T::compare); *length = i; return list; } template <class T> inline T mem_alloc_description<T>::get_sum (mem_alloc_origin origin) { unsigned length; mem_list_t *list = get_list (origin, &length); T sum; for (unsigned i = 0; i < length; i++) sum = sum + *list[i].second; free ((void*) (list)); return sum; } template <class T> inline void mem_alloc_description<T>::dump (mem_alloc_origin origin) { unsigned length; fprintf ( # 636 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 636 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" , "\n"); mem_list_t *list = get_list (origin, &length); T total = get_sum (origin); T::print_dash_line (); T::dump_header (mem_location::get_origin_name (origin)); T::print_dash_line (); for (int i = length - 1; i >= 0; i--) list[i].second->dump (list[i].first, total); T::print_dash_line (); T::dump_header (mem_location::get_origin_name (origin)); T::print_dash_line (); total.dump_footer (); T::print_dash_line (); free ((void*) (list)); fprintf ( # 655 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" 3 4 stderr # 655 "/home/giulianob/gcc_git_gnu/gcc/gcc/mem-stats.h" , "\n"); } # 595 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map.h" 1 # 35 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-map.h" const size_t default_hash_map_size = 13; template<typename KeyId, typename Value, typename Traits > class hash_map { typedef typename Traits::key_type Key; struct hash_entry { Key m_key; Value m_value; typedef hash_entry value_type; typedef Key compare_type; static hashval_t hash (const hash_entry &e) { return Traits::hash (e.m_key); } static bool equal (const hash_entry &a, const Key &b) { return Traits::equal_keys (a.m_key, b); } static void remove (hash_entry &e) { Traits::remove (e); } static void mark_deleted (hash_entry &e) { Traits::mark_deleted (e); } static bool is_deleted (const hash_entry &e) { return Traits::is_deleted (e); } static const bool empty_zero_p = Traits::empty_zero_p; static void mark_empty (hash_entry &e) { Traits::mark_empty (e); } static bool is_empty (const hash_entry &e) { return Traits::is_empty (e); } static void ggc_mx (hash_entry &e) { gt_ggc_mx (e.m_key); gt_ggc_mx (e.m_value); } static void ggc_maybe_mx (hash_entry &e) { if (Traits::maybe_mx) ggc_mx (e); } static void pch_nx (hash_entry &e) { gt_pch_nx (e.m_key); gt_pch_nx (e.m_value); } static void pch_nx (hash_entry &e, gt_pointer_operator op, void *c) { pch_nx_helper (e.m_key, op, c); pch_nx_helper (e.m_value, op, c); } static int keep_cache_entry (hash_entry &e) { return ggc_marked_p (e.m_key); } private: template<typename T> static void pch_nx_helper (T &x, gt_pointer_operator op, void *cookie) { gt_pch_nx (&x, op, cookie); } static void pch_nx_helper (int, gt_pointer_operator, void *) { } static void pch_nx_helper (unsigned int, gt_pointer_operator, void *) { } static void pch_nx_helper (bool, gt_pointer_operator, void *) { } template<typename T> static void pch_nx_helper (T *&x, gt_pointer_operator op, void *cookie) { op (&x, cookie); } }; public: explicit hash_map (size_t n = default_hash_map_size, bool ggc = false, bool sanitize_eq_and_hash = true, bool gather_mem_stats = 0 ) : m_table (n, ggc, sanitize_eq_and_hash, gather_mem_stats, HASH_MAP_ORIGIN ) { } explicit hash_map (const hash_map &h, bool ggc = false, bool sanitize_eq_and_hash = true, bool gather_mem_stats = 0 ) : m_table (h.m_table, ggc, sanitize_eq_and_hash, gather_mem_stats, HASH_MAP_ORIGIN ) {} static hash_map *create_ggc (size_t size = default_hash_map_size, bool gather_mem_stats = 0 ) { hash_map *map = ggc_alloc<hash_map> (); new (map) hash_map (size, true, true, gather_mem_stats ); return map; } bool put (const Key &k, const Value &v) { hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k), INSERT); bool ins = hash_entry::is_empty (*e); if (ins) { e->m_key = k; new ((void *) &e->m_value) Value (v); } else e->m_value = v; return !ins; } Value *get (const Key &k) { hash_entry &e = m_table.find_with_hash (k, Traits::hash (k)); return Traits::is_empty (e) ? nullptr : &e.m_value; } Value &get_or_insert (const Key &k, bool *existed = nullptr) { hash_entry *e = m_table.find_slot_with_hash (k, Traits::hash (k), INSERT); bool ins = Traits::is_empty (*e); if (ins) { e->m_key = k; new ((void *)&e->m_value) Value (); } if (existed != nullptr) *existed = !ins; return e->m_value; } void remove (const Key &k) { m_table.remove_elt_with_hash (k, Traits::hash (k)); } template<typename Arg, bool (*f)(const typename Traits::key_type &, const Value &, Arg)> void traverse (Arg a) const { for (typename hash_table<hash_entry>::iterator iter = m_table.begin (); iter != m_table.end (); ++iter) f ((*iter).m_key, (*iter).m_value, a); } template<typename Arg, bool (*f)(const typename Traits::key_type &, Value *, Arg)> void traverse (Arg a) const { for (typename hash_table<hash_entry>::iterator iter = m_table.begin (); iter != m_table.end (); ++iter) if (!f ((*iter).m_key, &(*iter).m_value, a)) break; } size_t elements () const { return m_table.elements (); } void empty () { m_table.empty(); } bool is_empty () const { return m_table.is_empty (); } class iterator { public: explicit iterator (const typename hash_table<hash_entry>::iterator &iter) : m_iter (iter) {} iterator &operator++ () { ++m_iter; return *this; } class reference_pair { public: const Key &first; Value &second; reference_pair (const Key &key, Value &value) : first (key), second (value) {} template <typename K, typename V> operator std::pair<K, V> () const { return std::pair<K, V> (first, second); } }; reference_pair operator* () { hash_entry &e = *m_iter; return reference_pair (e.m_key, e.m_value); } bool operator != (const iterator &other) const { return m_iter != other.m_iter; } private: typename hash_table<hash_entry>::iterator m_iter; }; iterator begin () const { return iterator (m_table.begin ()); } iterator end () const { return iterator (m_table.end ()); } private: template<typename T, typename U, typename V> friend void gt_ggc_mx (hash_map<T, U, V> *); template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *); template<typename T, typename U, typename V> friend void gt_pch_nx (hash_map<T, U, V> *, gt_pointer_operator, void *); template<typename T, typename U, typename V> friend void gt_cleare_cache (hash_map<T, U, V> *); hash_table<hash_entry> m_table; }; template<typename K, typename V, typename H> static inline void gt_ggc_mx (hash_map<K, V, H> *h) { gt_ggc_mx (&h->m_table); } template<typename K, typename V, typename H> static inline void gt_pch_nx (hash_map<K, V, H> *h) { gt_pch_nx (&h->m_table); } template<typename K, typename V, typename H> static inline void gt_cleare_cache (hash_map<K, V, H> *h) { if (h) gt_cleare_cache (&h->m_table); } template<typename K, typename V, typename H> static inline void gt_pch_nx (hash_map<K, V, H> *h, gt_pointer_operator op, void *cookie) { op (&h->m_table.m_entries, cookie); } enum hm_alloc { hm_heap = false, hm_ggc = true }; template<bool ggc, typename K, typename V, typename H> inline hash_map<K,V,H> * hash_map_maybe_create (hash_map<K,V,H> *&h, size_t size = default_hash_map_size) { if (!h) { if (ggc) h = hash_map<K,V,H>::create_ggc (size); else h = new hash_map<K,V,H> (size); } return h; } template<typename K, typename V, typename H> inline V* hash_map_safe_get (hash_map<K,V,H> *h, const K& k) { return h ? h->get (k) : nullptr; } template<bool ggc, typename K, typename V, typename H> inline V& hash_map_safe_get_or_insert (hash_map<K,V,H> *&h, const K& k, bool *e = nullptr, size_t size = default_hash_map_size) { return hash_map_maybe_create<ggc> (h, size)->get_or_insert (k, e); } template<bool ggc, typename K, typename V, typename H> inline bool hash_map_safe_put (hash_map<K,V,H> *&h, const K& k, const V& v, size_t size = default_hash_map_size) { return hash_map_maybe_create<ggc> (h, size)->put (k, v); } # 596 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" 2 extern mem_alloc_description<mem_usage>& hash_table_usage (void); extern void dump_hash_table_loc_statistics (void); template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> hash_table<Descriptor, Lazy, Allocator>::hash_table (size_t size, bool ggc, bool sanitize_eq_and_hash, bool gather_mem_stats __attribute__ ((__unused__)), mem_alloc_origin origin ) : m_n_elements (0), m_n_deleted (0), m_searches (0), m_collisions (0), m_ggc (ggc), m_sanitize_eq_and_hash (sanitize_eq_and_hash) { unsigned int size_prime_index; size_prime_index = hash_table_higher_prime_index (size); size = prime_tab[size_prime_index].prime; if (m_gather_mem_stats) hash_table_usage ().register_descriptor (this, origin, ggc , 0,0,0); if (Lazy) m_entries = nullptr; else m_entries = alloc_entries (size ); m_size = size; m_size_prime_index = size_prime_index; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> hash_table<Descriptor, Lazy, Allocator>::hash_table (const hash_table &h, bool ggc, bool sanitize_eq_and_hash, bool gather_mem_stats __attribute__ ((__unused__)), mem_alloc_origin origin ) : m_n_elements (h.m_n_elements), m_n_deleted (h.m_n_deleted), m_searches (0), m_collisions (0), m_ggc (ggc), m_sanitize_eq_and_hash (sanitize_eq_and_hash) { size_t size = h.m_size; if (m_gather_mem_stats) hash_table_usage ().register_descriptor (this, origin, ggc , 0,0,0); if (Lazy && h.m_entries == nullptr) m_entries = nullptr; else { value_type *nentries = alloc_entries (size ); for (size_t i = 0; i < size; ++i) { value_type &entry = h.m_entries[i]; if (is_deleted (entry)) mark_deleted (nentries[i]); else if (!is_empty (entry)) new ((void*) (nentries + i)) value_type (entry); } m_entries = nentries; } m_size = size; m_size_prime_index = h.m_size_prime_index; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> hash_table<Descriptor, Lazy, Allocator>::~hash_table () { if (!Lazy || m_entries) { for (size_t i = m_size - 1; i < m_size; i--) if (!is_empty (m_entries[i]) && !is_deleted (m_entries[i])) Descriptor::remove (m_entries[i]); if (!m_ggc) Allocator <value_type> ::data_free (m_entries); else ggc_free (m_entries); if (m_gather_mem_stats) hash_table_usage ().release_instance_overhead (this, sizeof (value_type) * m_size, true); } else if (m_gather_mem_stats) hash_table_usage ().unregister_descriptor (this); } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> inline typename hash_table<Descriptor, Lazy, Allocator>::value_type * hash_table<Descriptor, Lazy, Allocator>::alloc_entries (size_t n ) const { value_type *nentries; if (m_gather_mem_stats) hash_table_usage ().register_instance_overhead (sizeof (value_type) * n, this); if (!m_ggc) nentries = Allocator <value_type> ::data_alloc (n); else nentries = ::ggc_cleared_vec_alloc<value_type> (n ); ((void)(!(nentries != nullptr) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 715, __FUNCTION__), 0 : 0)); if (!Descriptor::empty_zero_p) for (size_t i = 0; i < n; i++) mark_empty (nentries[i]); return nentries; } # 730 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> typename hash_table<Descriptor, Lazy, Allocator>::value_type * hash_table<Descriptor, Lazy, Allocator>::find_empty_slot_for_expand (hashval_t hash) { hashval_t index = hash_table_mod1 (hash, m_size_prime_index); size_t size = m_size; value_type *slot = m_entries + index; hashval_t hash2; if (is_empty (*slot)) return slot; ((void)(!(!is_deleted (*slot)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 743, __FUNCTION__), 0 : 0)); hash2 = hash_table_mod2 (hash, m_size_prime_index); for (;;) { index += hash2; if (index >= size) index -= size; slot = m_entries + index; if (is_empty (*slot)) return slot; ((void)(!(!is_deleted (*slot)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 755, __FUNCTION__), 0 : 0)); } } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> inline bool hash_table<Descriptor, Lazy, Allocator>::too_empty_p (unsigned int elts) { return elts * 8 < m_size && m_size > 32; } # 776 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator>::expand () { value_type *oentries = m_entries; unsigned int oindex = m_size_prime_index; size_t osize = size (); value_type *olimit = oentries + osize; size_t elts = elements (); unsigned int nindex; size_t nsize; if (elts * 2 > osize || too_empty_p (elts)) { nindex = hash_table_higher_prime_index (elts * 2); nsize = prime_tab[nindex].prime; } else { nindex = oindex; nsize = osize; } value_type *nentries = alloc_entries (nsize); if (m_gather_mem_stats) hash_table_usage ().release_instance_overhead (this, sizeof (value_type) * osize); m_entries = nentries; m_size = nsize; m_size_prime_index = nindex; m_n_elements -= m_n_deleted; m_n_deleted = 0; value_type *p = oentries; do { value_type &x = *p; if (!is_empty (x) && !is_deleted (x)) { value_type *q = find_empty_slot_for_expand (Descriptor::hash (x)); new ((void*) q) value_type (x); } p++; } while (p < olimit); if (!m_ggc) Allocator <value_type> ::data_free (oentries); else ggc_free (oentries); } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator>::empty_slow () { size_t size = m_size; size_t nsize = size; value_type *entries = m_entries; for (size_t i = size - 1; i < size; i--) if (!is_empty (entries[i]) && !is_deleted (entries[i])) Descriptor::remove (entries[i]); if (size > 1024*1024 / sizeof (value_type)) nsize = 1024 / sizeof (value_type); else if (too_empty_p (m_n_elements)) nsize = m_n_elements * 2; if (nsize != size) { unsigned int nindex = hash_table_higher_prime_index (nsize); nsize = prime_tab[nindex].prime; if (!m_ggc) Allocator <value_type> ::data_free (m_entries); else ggc_free (m_entries); m_entries = alloc_entries (nsize); m_size = nsize; m_size_prime_index = nindex; } else if (Descriptor::empty_zero_p) memset ((void *) entries, 0, size * sizeof (value_type)); else for (size_t i = 0; i < size; i++) mark_empty (entries[i]); m_n_deleted = 0; m_n_elements = 0; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator>::clear_slot (value_type *slot) { ((void)(!(!(slot < m_entries || slot >= m_entries + size () || is_empty (*slot) || is_deleted (*slot))) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 890, __FUNCTION__), 0 : 0)) ; Descriptor::remove (*slot); mark_deleted (*slot); m_n_deleted++; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> typename hash_table<Descriptor, Lazy, Allocator>::value_type & hash_table<Descriptor, Lazy, Allocator> ::find_with_hash (const compare_type &comparable, hashval_t hash) { m_searches++; size_t size = m_size; hashval_t index = hash_table_mod1 (hash, m_size_prime_index); if (Lazy && m_entries == nullptr) m_entries = alloc_entries (size); if (m_sanitize_eq_and_hash) verify (comparable, hash); value_type *entry = &m_entries[index]; if (is_empty (*entry) || (!is_deleted (*entry) && Descriptor::equal (*entry, comparable))) return *entry; hashval_t hash2 = hash_table_mod2 (hash, m_size_prime_index); for (;;) { m_collisions++; index += hash2; if (index >= size) index -= size; entry = &m_entries[index]; if (is_empty (*entry) || (!is_deleted (*entry) && Descriptor::equal (*entry, comparable))) return *entry; } } # 949 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> typename hash_table<Descriptor, Lazy, Allocator>::value_type * hash_table<Descriptor, Lazy, Allocator> ::find_slot_with_hash (const compare_type &comparable, hashval_t hash, enum insert_option insert) { if (Lazy && m_entries == nullptr) { if (insert == INSERT) m_entries = alloc_entries (m_size); else return nullptr; } if (insert == INSERT && m_size * 3 <= m_n_elements * 4) expand (); if (m_sanitize_eq_and_hash) verify (comparable, hash); m_searches++; value_type *first_deleted_slot = nullptr; hashval_t index = hash_table_mod1 (hash, m_size_prime_index); hashval_t hash2 = hash_table_mod2 (hash, m_size_prime_index); value_type *entry = &m_entries[index]; size_t size = m_size; if (is_empty (*entry)) goto empty_entry; else if (is_deleted (*entry)) first_deleted_slot = &m_entries[index]; else if (Descriptor::equal (*entry, comparable)) return &m_entries[index]; for (;;) { m_collisions++; index += hash2; if (index >= size) index -= size; entry = &m_entries[index]; if (is_empty (*entry)) goto empty_entry; else if (is_deleted (*entry)) { if (!first_deleted_slot) first_deleted_slot = &m_entries[index]; } else if (Descriptor::equal (*entry, comparable)) return &m_entries[index]; } empty_entry: if (insert == NO_INSERT) return nullptr; if (first_deleted_slot) { m_n_deleted--; mark_empty (*first_deleted_slot); return first_deleted_slot; } m_n_elements++; return &m_entries[index]; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator> ::verify (const compare_type &comparable, hashval_t hash) { for (size_t i = 0; i < ((hash_table_sanitize_eq_limit) < (m_size) ? (hash_table_sanitize_eq_limit) : (m_size)); i++) { value_type *entry = &m_entries[i]; if (!is_empty (*entry) && !is_deleted (*entry) && hash != Descriptor::hash (*entry) && Descriptor::equal (*entry, comparable)) hashtab_chk_error (); } } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator> ::remove_elt_with_hash (const compare_type &comparable, hashval_t hash) { value_type *slot = find_slot_with_hash (comparable, hash, NO_INSERT); if (slot == nullptr) return; Descriptor::remove (*slot); mark_deleted (*slot); m_n_deleted++; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> template<typename Argument, int (*Callback) (typename hash_table<Descriptor, Lazy, Allocator>::value_type *slot, Argument argument)> void hash_table<Descriptor, Lazy, Allocator>::traverse_noresize (Argument argument) { if (Lazy && m_entries == nullptr) return; value_type *slot = m_entries; value_type *limit = slot + size (); do { value_type &x = *slot; if (!is_empty (x) && !is_deleted (x)) if (! Callback (slot, argument)) break; } while (++slot < limit); } template <typename Descriptor, bool Lazy, template <typename Type> class Allocator> template <typename Argument, int (*Callback) (typename hash_table<Descriptor, Lazy, Allocator>::value_type *slot, Argument argument)> void hash_table<Descriptor, Lazy, Allocator>::traverse (Argument argument) { if (too_empty_p (elements ()) && (!Lazy || m_entries)) expand (); traverse_noresize <Argument, Callback> (argument); } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> void hash_table<Descriptor, Lazy, Allocator>::iterator::slide () { for ( ; m_slot < m_limit; ++m_slot ) { value_type &x = *m_slot; if (!is_empty (x) && !is_deleted (x)) return; } m_slot = nullptr; m_limit = nullptr; } template<typename Descriptor, bool Lazy, template<typename Type> class Allocator> inline typename hash_table<Descriptor, Lazy, Allocator>::iterator & hash_table<Descriptor, Lazy, Allocator>::iterator::operator ++ () { ++m_slot; slide (); return *this; } # 1146 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h" template<typename E> static inline void gt_ggc_mx (hash_table<E> *h) { typedef hash_table<E> table; if (!((h->m_entries) != nullptr && ((void *) (h->m_entries)) != (void *) 1 && ! ggc_set_mark (h->m_entries))) return; for (size_t i = 0; i < h->m_size; i++) { if (table::is_empty (h->m_entries[i]) || table::is_deleted (h->m_entries[i])) continue; E::ggc_maybe_mx (h->m_entries[i]); } } template<typename D> static inline void hashtab_entry_note_pointers (void *obj, void *h, gt_pointer_operator op, void *cookie) { hash_table<D> *map = static_cast<hash_table<D> *> (h); ((void)(!(map->m_entries == obj) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 1173, __FUNCTION__), 0 : 0)); for (size_t i = 0; i < map->m_size; i++) { typedef hash_table<D> table; if (table::is_empty (map->m_entries[i]) || table::is_deleted (map->m_entries[i])) continue; D::pch_nx (map->m_entries[i], op, cookie); } } template<typename D> static void gt_pch_nx (hash_table<D> *h) { bool success = gt_pch_note_object (h->m_entries, h, hashtab_entry_note_pointers<D>); ((void)(!(success) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/hash-table.h", 1191, __FUNCTION__), 0 : 0)); for (size_t i = 0; i < h->m_size; i++) { if (hash_table<D>::is_empty (h->m_entries[i]) || hash_table<D>::is_deleted (h->m_entries[i])) continue; D::pch_nx (h->m_entries[i]); } } template<typename D> static inline void gt_pch_nx (hash_table<D> *h, gt_pointer_operator op, void *cookie) { op (&h->m_entries, cookie); } template<typename H> inline void gt_cleare_cache (hash_table<H> *h) { typedef hash_table<H> table; if (!h) return; for (typename table::iterator iter = h->begin (); iter != h->end (); ++iter) if (!table::is_empty (*iter) && !table::is_deleted (*iter)) { int res = H::keep_cache_entry (*iter); if (res == 0) h->clear_slot (&*iter); else if (res != -1) H::ggc_mx (*iter); } } # 477 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" 1 # 34 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" template<typename KeyId, bool Lazy = false, typename Traits = default_hash_traits<KeyId> > class hash_set { public: typedef typename Traits::value_type Key; explicit hash_set (size_t n = 13, bool ggc = false ) : m_table (n, ggc, true, 0, HASH_SET_ORIGIN ) {} static hash_set * create_ggc (size_t n) { hash_set *set = ggc_alloc<hash_set> (); new (set) hash_set (n, true); return set; } bool add (const Key &k) { Key *e = m_table.find_slot_with_hash (k, Traits::hash (k), INSERT); bool existed = !Traits::is_empty (*e); if (!existed) new (e) Key (k); return existed; } bool contains (const Key &k) { if (Lazy) return (m_table.find_slot_with_hash (k, Traits::hash (k), NO_INSERT) != nullptr); Key &e = m_table.find_with_hash (k, Traits::hash (k)); return !Traits::is_empty (e); } void remove (const Key &k) { m_table.remove_elt_with_hash (k, Traits::hash (k)); } template<typename Arg, bool (*f)(const typename Traits::value_type &, Arg)> void traverse (Arg a) const { for (typename hash_table<Traits, Lazy>::iterator iter = m_table.begin (); iter != m_table.end (); ++iter) f (*iter, a); } size_t elements () const { return m_table.elements (); } void empty () { m_table.empty (); } bool is_empty () const { return m_table.is_empty (); } class iterator { public: explicit iterator (const typename hash_table<Traits, Lazy>::iterator &iter) : m_iter (iter) {} iterator &operator++ () { ++m_iter; return *this; } Key operator* () { return *m_iter; } bool operator != (const iterator &other) const { return m_iter != other.m_iter; } private: typename hash_table<Traits, Lazy>::iterator m_iter; }; iterator begin () const { return iterator (m_table.begin ()); } iterator end () const { return iterator (m_table.end ()); } private: template<typename T, typename U> friend void gt_ggc_mx (hash_set<T, false, U> *); template<typename T, typename U> friend void gt_pch_nx (hash_set<T, false, U> *); template<typename T, typename U> friend void gt_pch_nx (hash_set<T, false, U> *, gt_pointer_operator, void *); hash_table<Traits, Lazy> m_table; }; # 161 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" template<typename T> void debug_helper (hash_set<T> &ref) { for (typename hash_set<T>::iterator it = ref.begin (); it != ref.end (); ++it) { debug_slim (*it); fputc ('\n', # 169 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" 3 4 stderr # 169 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" ); } } # 191 "/home/giulianob/gcc_git_gnu/gcc/gcc/hash-set.h" template<typename K, typename H> static inline void gt_ggc_mx (hash_set<K, false, H> *h) { gt_ggc_mx (&h->m_table); } template<typename K, typename H> static inline void gt_pch_nx (hash_set<K, false, H> *h) { gt_pch_nx (&h->m_table); } template<typename K, typename H> static inline void gt_pch_nx (hash_set<K, false, H> *h, gt_pointer_operator op, void *cookie) { op (&h->m_table.m_entries, cookie); } # 478 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" 1 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" 1 # 50 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" typedef unsigned int linenum_type; typedef long long linenum_arith_t; inline int compare (linenum_type lhs, linenum_type rhs) { linenum_arith_t diff = (linenum_arith_t)lhs - (linenum_arith_t)rhs; if (diff) return diff > 0 ? 1 : -1; return 0; } enum lc_reason { LC_ENTER = 0, LC_LEAVE, LC_RENAME, LC_RENAME_VERBATIM, LC_ENTER_MACRO, LC_HWM }; # 291 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" typedef unsigned int location_t; const unsigned int LINE_MAP_MAX_COLUMN_NUMBER = (1U << 12); const location_t LINE_MAP_MAX_LOCATION_WITH_PACKED_RANGES = 0x50000000; const location_t LINE_MAP_MAX_LOCATION_WITH_COLS = 0x60000000; const location_t LINE_MAP_MAX_LOCATION = 0x70000000; # 319 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" struct source_range { location_t m_start; location_t m_finish; static source_range from_location (location_t loc) { source_range result; result.m_start = loc; result.m_finish = loc; return result; } static source_range from_locations (location_t start, location_t finish) { source_range result; result.m_start = start; result.m_finish = finish; return result; } }; typedef void *(*line_map_realloc) (void *, size_t); typedef size_t (*line_map_round_alloc_size_func) (size_t); # 384 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" struct line_map { location_t start_location; }; # 402 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" struct line_map_ordinary : public line_map { enum lc_reason reason : 8; unsigned char sysp; unsigned int m_column_and_range_bits : 8; # 433 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" unsigned int m_range_bits : 8; const char *to_file; linenum_type to_line; location_t included_from; }; const location_t MAX_LOCATION_T = 0x7FFFFFFF; struct cpp_hashnode; struct line_map_macro : public line_map { unsigned int n_tokens; struct cpp_hashnode * macro; # 527 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" location_t * macro_locations; location_t expansion; }; # 566 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" inline bool IS_ORDINARY_LOC (location_t loc) { return loc < LINE_MAP_MAX_LOCATION; } inline bool IS_ADHOC_LOC (location_t loc) { return loc > MAX_LOCATION_T; } inline bool IS_MACRO_LOC (location_t loc) { return !IS_ORDINARY_LOC (loc) && !IS_ADHOC_LOC (loc); } inline bool MAP_ORDINARY_P (const line_map *map) { return IS_ORDINARY_LOC (map->start_location); } bool linemap_macro_expansion_map_p (const line_map *); inline line_map_ordinary * linemap_check_ordinary (line_map *map) { do { if (! (MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 604, __FUNCTION__); } while (0); return (line_map_ordinary *)map; } inline const line_map_ordinary * linemap_check_ordinary (const line_map *map) { do { if (! (MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 615, __FUNCTION__); } while (0); return (const line_map_ordinary *)map; } inline line_map_macro *linemap_check_macro (line_map *map) { do { if (! (!MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 624, __FUNCTION__); } while (0); return (line_map_macro *)map; } inline const line_map_macro * linemap_check_macro (const line_map *map) { do { if (! (!MAP_ORDINARY_P (map))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 634, __FUNCTION__); } while (0); return (const line_map_macro *)map; } inline location_t MAP_START_LOCATION (const line_map *map) { return map->start_location; } inline linenum_type ORDINARY_MAP_STARTING_LINE_NUMBER (const line_map_ordinary *ord_map) { return ord_map->to_line; } inline unsigned char ORDINARY_MAP_IN_SYSTEM_HEADER_P (const line_map_ordinary *ord_map) { return ord_map->sysp; } inline const char * ORDINARY_MAP_FILE_NAME (const line_map_ordinary *ord_map) { return ord_map->to_file; } inline cpp_hashnode * MACRO_MAP_MACRO (const line_map_macro *macro_map) { return macro_map->macro; } inline unsigned int MACRO_MAP_NUM_MACRO_TOKENS (const line_map_macro *macro_map) { return macro_map->n_tokens; } inline location_t * MACRO_MAP_LOCATIONS (const line_map_macro *macro_map) { return macro_map->macro_locations; } inline location_t MACRO_MAP_EXPANSION_POINT_LOCATION (const line_map_macro *macro_map) { return macro_map->expansion; } # 714 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" struct maps_info_ordinary { line_map_ordinary * maps; unsigned int allocated; unsigned int used; mutable unsigned int cache; }; struct maps_info_macro { line_map_macro * maps; unsigned int allocated; unsigned int used; mutable unsigned int cache; }; struct location_adhoc_data { location_t locus; source_range src_range; void * data; }; struct htab; # 765 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" struct location_adhoc_data_map { struct htab * htab; location_t curr_loc; unsigned int allocated; struct location_adhoc_data *data; }; class line_maps { public: ~line_maps (); maps_info_ordinary info_ordinary; maps_info_macro info_macro; unsigned int depth; bool trace_includes; location_t highest_location; location_t highest_line; unsigned int max_column_hint; line_map_realloc reallocator; line_map_round_alloc_size_func round_alloc_size; struct location_adhoc_data_map location_adhoc_data_map; location_t builtin_location; bool seen_line_directive; unsigned int default_range_bits; unsigned int num_optimized_ranges; unsigned int num_unoptimized_ranges; }; inline unsigned int LINEMAPS_ALLOCATED (const line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.allocated; else return set->info_ordinary.allocated; } inline unsigned int & LINEMAPS_ALLOCATED (line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.allocated; else return set->info_ordinary.allocated; } inline unsigned int LINEMAPS_USED (const line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.used; else return set->info_ordinary.used; } inline unsigned int & LINEMAPS_USED (line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.used; else return set->info_ordinary.used; } inline unsigned int & LINEMAPS_CACHE (const line_maps *set, bool map_kind) { if (map_kind) return set->info_macro.cache; else return set->info_ordinary.cache; } inline line_map * LINEMAPS_MAP_AT (const line_maps *set, bool map_kind, int index) { if (map_kind) return &set->info_macro.maps[index]; else return &set->info_ordinary.maps[index]; } inline line_map * LINEMAPS_LAST_MAP (const line_maps *set, bool map_kind) { return LINEMAPS_MAP_AT (set, map_kind, LINEMAPS_USED (set, map_kind) - 1); } inline line_map * LINEMAPS_LAST_ALLOCATED_MAP (const line_maps *set, bool map_kind) { return LINEMAPS_MAP_AT (set, map_kind, LINEMAPS_ALLOCATED (set, map_kind) - 1); } inline line_map_ordinary * LINEMAPS_ORDINARY_MAPS (const line_maps *set) { return set->info_ordinary.maps; } inline line_map_ordinary * LINEMAPS_ORDINARY_MAP_AT (const line_maps *set, int index) { do { if (! (index >= 0 && (unsigned int)index < LINEMAPS_USED (set, false))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 919, __FUNCTION__); } while (0) ; return (line_map_ordinary *)LINEMAPS_MAP_AT (set, false, index); } inline unsigned int LINEMAPS_ORDINARY_ALLOCATED (const line_maps *set) { return LINEMAPS_ALLOCATED (set, false); } inline unsigned int LINEMAPS_ORDINARY_USED (const line_maps *set) { return LINEMAPS_USED (set, false); } inline unsigned int & LINEMAPS_ORDINARY_CACHE (const line_maps *set) { return LINEMAPS_CACHE (set, false); } inline line_map_ordinary * LINEMAPS_LAST_ORDINARY_MAP (const line_maps *set) { return (line_map_ordinary *)LINEMAPS_LAST_MAP (set, false); } inline line_map_ordinary * LINEMAPS_LAST_ALLOCATED_ORDINARY_MAP (const line_maps *set) { return (line_map_ordinary *)LINEMAPS_LAST_ALLOCATED_MAP (set, false); } inline line_map_macro * LINEMAPS_MACRO_MAPS (const line_maps *set) { return set->info_macro.maps; } inline line_map_macro * LINEMAPS_MACRO_MAP_AT (const line_maps *set, int index) { do { if (! (index >= 0 && (unsigned int)index < LINEMAPS_USED (set, true))) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 975, __FUNCTION__); } while (0) ; return (line_map_macro *)LINEMAPS_MAP_AT (set, true, index); } inline unsigned int LINEMAPS_MACRO_ALLOCATED (const line_maps *set) { return LINEMAPS_ALLOCATED (set, true); } inline unsigned int LINEMAPS_MACRO_USED (const line_maps *set) { return LINEMAPS_USED (set, true); } inline unsigned int & LINEMAPS_MACRO_CACHE (const line_maps *set) { return LINEMAPS_CACHE (set, true); } inline line_map_macro * LINEMAPS_LAST_MACRO_MAP (const line_maps *set) { return (line_map_macro *)LINEMAPS_LAST_MAP (set, true); } inline location_t LINEMAPS_MACRO_LOWEST_LOCATION (const line_maps *set) { return LINEMAPS_MACRO_USED (set) ? MAP_START_LOCATION (LINEMAPS_LAST_MACRO_MAP (set)) : MAX_LOCATION_T + 1; } inline line_map_macro * LINEMAPS_LAST_ALLOCATED_MACRO_MAP (const line_maps *set) { return (line_map_macro *)LINEMAPS_LAST_ALLOCATED_MAP (set, true); } extern location_t get_combined_adhoc_loc (line_maps *, location_t, source_range, void *); extern void *get_data_from_adhoc_loc (const line_maps *, location_t); extern location_t get_location_from_adhoc_loc (const line_maps *, location_t); extern source_range get_range_from_loc (line_maps *set, location_t loc); bool pure_location_p (line_maps *set, location_t loc); extern location_t get_pure_location (line_maps *set, location_t loc); inline location_t COMBINE_LOCATION_DATA (class line_maps *set, location_t loc, source_range src_range, void *block) { return get_combined_adhoc_loc (set, loc, src_range, block); } extern void rebuild_location_adhoc_htab (class line_maps *); extern void linemap_init (class line_maps *set, location_t builtin_location); extern void linemap_check_files_exited (class line_maps *); extern location_t linemap_line_start (class line_maps *set, linenum_type to_line, unsigned int max_column_hint); # 1092 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" extern const line_map *linemap_add (class line_maps *, enum lc_reason, unsigned int sysp, const char *to_file, linenum_type to_line); extern const line_map *linemap_lookup (const line_maps *, location_t); bool linemap_tracks_macro_expansion_locs_p (class line_maps *); const char* linemap_map_get_macro_name (const line_map_macro *); # 1121 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" int linemap_location_in_system_header_p (class line_maps *, location_t); bool linemap_location_from_macro_expansion_p (const line_maps *, location_t); bool linemap_location_from_macro_definition_p (class line_maps *, location_t); extern location_t linemap_macro_map_loc_unwind_toward_spelling (line_maps *set, const line_map_macro *macro_map, location_t location); const location_t RESERVED_LOCATION_COUNT = 2; inline linenum_type SOURCE_LINE (const line_map_ordinary *ord_map, location_t loc) { return ((loc - ord_map->start_location) >> ord_map->m_column_and_range_bits) + ord_map->to_line; } inline linenum_type SOURCE_COLUMN (const line_map_ordinary *ord_map, location_t loc) { return ((loc - ord_map->start_location) & ((1 << ord_map->m_column_and_range_bits) - 1)) >> ord_map->m_range_bits; } inline location_t linemap_included_from (const line_map_ordinary *ord_map) { return ord_map->included_from; } const line_map_ordinary *linemap_included_from_linemap (line_maps *set, const line_map_ordinary *map); inline bool MAIN_FILE_P (const line_map_ordinary *ord_map) { return ord_map->included_from == 0; } extern location_t linemap_position_for_column (class line_maps *, unsigned int); location_t linemap_position_for_line_and_column (line_maps *set, const line_map_ordinary *, linenum_type, unsigned int); location_t linemap_position_for_loc_and_offset (class line_maps *set, location_t loc, unsigned int offset); inline const char * LINEMAP_FILE (const line_map_ordinary *ord_map) { return ord_map->to_file; } inline linenum_type LINEMAP_LINE (const line_map_ordinary *ord_map) { return ord_map->to_line; } inline unsigned char LINEMAP_SYSP (const line_map_ordinary *ord_map) { return ord_map->sysp; } int linemap_compare_locations (class line_maps *set, location_t pre, location_t post); inline bool linemap_location_before_p (class line_maps *set, location_t loc_a, location_t loc_b) { return linemap_compare_locations (set, loc_a, loc_b) >= 0; } typedef struct { const char *file; int line; int column; void *data; bool sysp; } expanded_location; class range_label; # 1279 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" enum range_display_kind { SHOW_RANGE_WITH_CARET, SHOW_RANGE_WITHOUT_CARET, SHOW_LINES_WITHOUT_RANGE }; struct location_range { location_t m_loc; enum range_display_kind m_range_display_kind; const range_label *m_label; }; # 1320 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" template <typename T, int NUM_EMBEDDED> class semi_embedded_vec { public: semi_embedded_vec (); ~semi_embedded_vec (); unsigned int count () const { return m_num; } T& operator[] (int idx); const T& operator[] (int idx) const; void push (const T&); void truncate (int len); private: int m_num; T m_embedded[NUM_EMBEDDED]; int m_alloc; T *m_extra; }; template <typename T, int NUM_EMBEDDED> semi_embedded_vec<T, NUM_EMBEDDED>::semi_embedded_vec () : m_num (0), m_alloc (0), m_extra (nullptr) { } template <typename T, int NUM_EMBEDDED> semi_embedded_vec<T, NUM_EMBEDDED>::~semi_embedded_vec () { free ((void*) (m_extra)); } template <typename T, int NUM_EMBEDDED> T& semi_embedded_vec<T, NUM_EMBEDDED>::operator[] (int idx) { do { if (! (idx < m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1364, __FUNCTION__); } while (0); if (idx < NUM_EMBEDDED) return m_embedded[idx]; else { do { if (! (m_extra != nullptr)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1369, __FUNCTION__); } while (0); return m_extra[idx - NUM_EMBEDDED]; } } template <typename T, int NUM_EMBEDDED> const T& semi_embedded_vec<T, NUM_EMBEDDED>::operator[] (int idx) const { do { if (! (idx < m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1380, __FUNCTION__); } while (0); if (idx < NUM_EMBEDDED) return m_embedded[idx]; else { do { if (! (m_extra != nullptr)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1385, __FUNCTION__); } while (0); return m_extra[idx - NUM_EMBEDDED]; } } template <typename T, int NUM_EMBEDDED> void semi_embedded_vec<T, NUM_EMBEDDED>::push (const T& value) { int idx = m_num++; if (idx < NUM_EMBEDDED) m_embedded[idx] = value; else { idx -= NUM_EMBEDDED; if (nullptr == m_extra) { do { if (! (m_alloc == 0)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1405, __FUNCTION__); } while (0); m_alloc = 16; m_extra = ((T *) xmalloc (sizeof (T) * (m_alloc))); } else if (idx >= m_alloc) { do { if (! (m_alloc > 0)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1411, __FUNCTION__); } while (0); m_alloc *= 2; m_extra = ((T *) xrealloc ((void *) (m_extra), sizeof (T) * (m_alloc))); } do { if (! (m_extra)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1415, __FUNCTION__); } while (0); do { if (! (idx < m_alloc)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1416, __FUNCTION__); } while (0); m_extra[idx] = value; } } template <typename T, int NUM_EMBEDDED> void semi_embedded_vec<T, NUM_EMBEDDED>::truncate (int len) { do { if (! (len <= m_num)) fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h", 1427, __FUNCTION__); } while (0); m_num = len; } class fixit_hint; class diagnostic_path; # 1609 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" class rich_location { public: rich_location (line_maps *set, location_t loc, const range_label *label = nullptr); ~rich_location (); location_t get_loc () const { return get_loc (0); } location_t get_loc (unsigned int idx) const; void add_range (location_t loc, enum range_display_kind range_display_kind = SHOW_RANGE_WITHOUT_CARET, const range_label *label = nullptr); void set_range (unsigned int idx, location_t loc, enum range_display_kind range_display_kind); unsigned int get_num_locations () const { return m_ranges.count (); } const location_range *get_range (unsigned int idx) const; location_range *get_range (unsigned int idx); expanded_location get_expanded_location (unsigned int idx); void override_column (int column); void add_fixit_insert_before (const char *new_content); void add_fixit_insert_before (location_t where, const char *new_content); void add_fixit_insert_after (const char *new_content); void add_fixit_insert_after (location_t where, const char *new_content); void add_fixit_remove (); void add_fixit_remove (location_t where); void add_fixit_remove (source_range src_range); void add_fixit_replace (const char *new_content); void add_fixit_replace (location_t where, const char *new_content); void add_fixit_replace (source_range src_range, const char *new_content); unsigned int get_num_fixit_hints () const { return m_fixit_hints.count (); } fixit_hint *get_fixit_hint (int idx) const { return m_fixit_hints[idx]; } fixit_hint *get_last_fixit_hint () const; bool seen_impossible_fixit_p () const { return m_seen_impossible_fixit; } # 1718 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" void fixits_cannot_be_auto_applied () { m_fixits_cannot_be_auto_applied = true; } bool fixits_can_be_auto_applied_p () const { return !m_fixits_cannot_be_auto_applied; } const diagnostic_path *get_path () const { return m_path; } void set_path (const diagnostic_path *path) { m_path = path; } private: bool reject_impossible_fixit (location_t where); void stop_supporting_fixits (); void maybe_add_fixit (location_t start, location_t next_loc, const char *new_content); public: static const int STATICALLY_ALLOCATED_RANGES = 3; protected: line_maps *m_line_table; semi_embedded_vec <location_range, STATICALLY_ALLOCATED_RANGES> m_ranges; int m_column_override; bool m_have_expanded_location; expanded_location m_expanded_location; static const int MAX_STATIC_FIXIT_HINTS = 2; semi_embedded_vec <fixit_hint *, MAX_STATIC_FIXIT_HINTS> m_fixit_hints; bool m_seen_impossible_fixit; bool m_fixits_cannot_be_auto_applied; const diagnostic_path *m_path; }; class label_text { public: label_text () : m_buffer (nullptr), m_caller_owned (false) {} void maybe_free () { if (m_caller_owned) free (m_buffer); } static label_text borrow (const char *buffer) { return label_text (const_cast <char *> (buffer), false); } static label_text take (char *buffer) { return label_text (buffer, true); } char *take_or_copy () { if (m_caller_owned) return m_buffer; else return xstrdup (m_buffer); } char *m_buffer; bool m_caller_owned; private: label_text (char *buffer, bool owned) : m_buffer (buffer), m_caller_owned (owned) {} }; # 1823 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" class range_label { public: virtual ~range_label () {} virtual label_text get_text (unsigned range_idx) const = 0; }; # 1848 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" class fixit_hint { public: fixit_hint (location_t start, location_t next_loc, const char *new_content); ~fixit_hint () { free (m_bytes); } bool affects_line_p (const char *file, int line) const; location_t get_start_loc () const { return m_start; } location_t get_next_loc () const { return m_next_loc; } bool maybe_append (location_t start, location_t next_loc, const char *new_content); const char *get_string () const { return m_bytes; } size_t get_length () const { return m_len; } bool insertion_p () const { return m_start == m_next_loc; } bool ends_with_newline_p () const; private: location_t m_start; location_t m_next_loc; char *m_bytes; size_t m_len; }; enum location_resolution_kind { LRK_MACRO_EXPANSION_POINT, LRK_SPELLING_LOCATION, LRK_MACRO_DEFINITION_LOCATION }; # 1940 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" location_t linemap_resolve_location (class line_maps *, location_t loc, enum location_resolution_kind lrk, const line_map_ordinary **loc_map); # 1952 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" location_t linemap_unwind_toward_expansion (class line_maps *, location_t loc, const line_map **loc_map); # 1970 "/home/giulianob/gcc_git_gnu/gcc/gcc/../libcpp/include/line-map.h" location_t linemap_unwind_to_first_non_reserved_loc (class line_maps *, location_t loc, const line_map **map); expanded_location linemap_expand_location (class line_maps *, const line_map *, location_t loc); struct linemap_stats { long num_ordinary_maps_allocated; long num_ordinary_maps_used; long ordinary_maps_allocated_size; long ordinary_maps_used_size; long num_expanded_macros; long num_macro_tokens; long num_macro_maps_used; long macro_maps_allocated_size; long macro_maps_used_size; long macro_maps_locations_size; long duplicated_macro_maps_locations_size; long adhoc_table_size; long adhoc_table_entries_used; }; bool linemap_get_file_highest_location (class line_maps * set, const char *file_name, location_t *loc); void linemap_get_statistics (line_maps *, struct linemap_stats *); void linemap_dump_location (line_maps *, location_t, FILE *); void linemap_dump (FILE *, line_maps *, unsigned, bool); void line_table_dump (FILE *, line_maps *, unsigned int, unsigned int); enum location_aspect { LOCATION_ASPECT_CARET, LOCATION_ASPECT_START, LOCATION_ASPECT_FINISH }; extern expanded_location linemap_client_expand_location_to_spelling_point (location_t, enum location_aspect); # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" 2 extern class line_maps *line_table; extern class line_maps *saved_line_table; # 37 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" static_assert ((((location_t) 1) < RESERVED_LOCATION_COUNT), "BUILTINS_LOCATION < RESERVED_LOCATION_COUNT"); extern bool is_location_from_builtin_token (location_t); extern expanded_location expand_location (location_t); extern int location_compute_display_column (expanded_location exploc, int tabstop); class char_span { public: char_span (const char *ptr, size_t n_elts) : m_ptr (ptr), m_n_elts (n_elts) {} operator bool() const { return m_ptr; } size_t length () const { return m_n_elts; } const char *get_buffer () const { return m_ptr; } char operator[] (int idx) const { ((void)(!(idx >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 64, __FUNCTION__), 0 : 0)); ((void)(!((size_t)idx < m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 65, __FUNCTION__), 0 : 0)); return m_ptr[idx]; } char_span subspan (int offset, int n_elts) const { ((void)(!(offset >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 71, __FUNCTION__), 0 : 0)); ((void)(!(offset < (int)m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 72, __FUNCTION__), 0 : 0)); ((void)(!(n_elts >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 73, __FUNCTION__), 0 : 0)); ((void)(!(offset + n_elts <= (int)m_n_elts) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/input.h", 74, __FUNCTION__), 0 : 0)); return char_span (m_ptr + offset, n_elts); } char *xstrdup () const { return ::xstrndup (m_ptr, m_n_elts); } private: const char *m_ptr; size_t m_n_elts; }; extern char_span location_get_source_line (const char *file_path, int line); extern bool location_missing_trailing_newline (const char *file_path); extern expanded_location expand_location_to_spelling_point (location_t, enum location_aspect aspect = LOCATION_ASPECT_CARET); extern location_t expansion_point_location_if_in_system_header (location_t); extern location_t expansion_point_location (location_t); extern location_t input_location; # 122 "/home/giulianob/gcc_git_gnu/gcc/gcc/input.h" static inline int in_system_header_at (location_t loc) { return linemap_location_in_system_header_p (line_table, loc); } static inline bool from_macro_expansion_at (location_t loc) { return linemap_location_from_macro_expansion_p (line_table, loc); } static inline bool from_macro_definition_at (location_t loc) { return linemap_location_from_macro_definition_p (line_table, loc); } static inline location_t get_pure_location (location_t loc) { return get_pure_location (line_table, loc); } static inline location_t get_start (location_t loc) { return get_range_from_loc (line_table, loc).m_start; } static inline location_t get_finish (location_t loc) { return get_range_from_loc (line_table, loc).m_finish; } extern location_t make_location (location_t caret, location_t start, location_t finish); extern location_t make_location (location_t caret, source_range src_range); void dump_line_table_statistics (void); void dump_location_info (FILE *stream); void diagnostics_file_cache_fini (void); void diagnostics_file_cache_forcibly_evict_file (const char *file_path); class string_concat { public: string_concat (int num, location_t *locs); int m_num; location_t * m_locs; }; struct location_hash : int_hash <location_t, ((location_t) 0)> { }; class string_concat_db { public: string_concat_db (); void record_string_concatenation (int num, location_t *locs); bool get_string_concatenation (location_t loc, int *out_num, location_t **out_locs); private: static location_t get_key_loc (location_t loc); friend void ::gt_ggc_mx_string_concat_db (void *x_p); friend void ::gt_pch_nx_string_concat_db (void *x_p); friend void ::gt_pch_p_16string_concat_db (void *this_obj, void *x_p, gt_pointer_operator op, void *cookie); hash_map <location_hash, string_concat *> *m_table; }; # 479 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h" 1 # 150 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h" template <typename T> struct is_a_helper { template <typename U> static inline bool test (U *p); template <typename U> static inline T cast (U *p); }; # 168 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h" template <typename T> template <typename U> inline T is_a_helper <T>::cast (U *p) { return reinterpret_cast <T> (p); } # 183 "/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h" template <typename T, typename U> inline bool is_a (U *p) { return is_a_helper<T>::test (p); } template <typename T, typename U> inline T as_a (U *p) { ((void)(!(is_a <T> (p)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h", 197, __FUNCTION__), 0 : 0)); return is_a_helper <T>::cast (p); } template <typename T, typename U> inline T safe_as_a (U *p) { if (p) { ((void)(!(is_a <T> (p)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/is-a.h", 210, __FUNCTION__), 0 : 0)); return is_a_helper <T>::cast (p); } else return nullptr; } template <typename T, typename U> inline T dyn_cast (U *p) { if (is_a <T> (p)) return is_a_helper <T>::cast (p); else return static_cast <T> (0); } template <typename T, typename U> inline T safe_dyn_cast (U *p) { return p ? dyn_cast <T> (p) : 0; } # 480 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/memory-block.h" 1 # 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/memory-block.h" class memory_block_pool { public: static const size_t block_size = 64 * 1024; static const size_t freelist_size = 1024 * 1024 / block_size; memory_block_pool (); static inline void *allocate () __attribute__ ((__malloc__)); static inline void release (void *); static void trim (int nblocks = freelist_size); void reduce_free_list (int); private: static memory_block_pool instance; struct block_list { block_list *m_next; }; block_list *m_blocks; }; inline void * memory_block_pool::allocate () { if (instance.m_blocks == nullptr) return ((char *) xmalloc (sizeof (char) * (block_size))); void *result = instance.m_blocks; instance.m_blocks = instance.m_blocks->m_next; ; return result; } inline void memory_block_pool::release (void *uncast_block) { block_list *block = new (uncast_block) block_list; block->m_next = instance.m_blocks; instance.m_blocks = block; ; } extern void *mempool_obstack_chunk_alloc (size_t) __attribute__ ((__malloc__)); extern void mempool_obstack_chunk_free (void *); # 481 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" 1 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" 1 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" struct function; struct profile_count; class sreal; enum profile_quality { UNINITIALIZED_PROFILE, GUESSED_LOCAL, GUESSED_GLOBAL0, GUESSED_GLOBAL0_ADJUSTED, GUESSED, AFDO, ADJUSTED, PRECISE }; extern const char *profile_quality_as_string (enum profile_quality); extern bool parse_profile_quality (const char *value, profile_quality *quality); bool slow_safe_scale_64bit (uint64_t a, uint64_t b, uint64_t c, uint64_t *res); inline bool safe_scale_64bit (uint64_t a, uint64_t b, uint64_t c, uint64_t *res) { uint64_t tmp; if (!__builtin_mul_overflow (a, b, &tmp) && !__builtin_add_overflow (tmp, c/2, &tmp)) { *res = tmp / c; return true; } if (c == 1) { *res = (uint64_t) -1; return false; } # 106 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" return slow_safe_scale_64bit (a, b, c, res); } # 146 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" class profile_probability { static const int n_bits = 29; static const uint32_t max_probability = (uint32_t) 1 << (n_bits - 2); static const uint32_t uninitialized_probability = ((uint32_t) 1 << (n_bits - 1)) - 1; uint32_t m_val : 29; enum profile_quality m_quality : 3; friend struct profile_count; public: profile_probability (): m_val (uninitialized_probability), m_quality (GUESSED) {} profile_probability (uint32_t val, profile_quality quality): m_val (val), m_quality (quality) {} static profile_probability never () { profile_probability ret; ret.m_val = 0; ret.m_quality = PRECISE; return ret; } static profile_probability guessed_never () { profile_probability ret; ret.m_val = 0; ret.m_quality = GUESSED; return ret; } static profile_probability very_unlikely () { profile_probability r = guessed_always ().apply_scale (1, 2000); r.m_val--; return r; } static profile_probability unlikely () { profile_probability r = guessed_always ().apply_scale (1, 5); r.m_val--; return r; } static profile_probability even () { return guessed_always ().apply_scale (1, 2); } static profile_probability very_likely () { return always () - very_unlikely (); } static profile_probability likely () { return always () - unlikely (); } static profile_probability guessed_always () { profile_probability ret; ret.m_val = max_probability; ret.m_quality = GUESSED; return ret; } static profile_probability always () { profile_probability ret; ret.m_val = max_probability; ret.m_quality = PRECISE; return ret; } static profile_probability uninitialized () { profile_probability c; c.m_val = uninitialized_probability; c.m_quality = GUESSED; return c; } bool initialized_p () const { return m_val != uninitialized_probability; } bool reliable_p () const { return m_quality >= ADJUSTED; } static profile_probability from_reg_br_prob_base (int v) { profile_probability ret; ((void)(!(v >= 0 && v <= 10000) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 259, __FUNCTION__), 0 : 0)); ret.m_val = (((v * (uint64_t) max_probability) + (10000) / 2) / (10000)); ret.m_quality = GUESSED; return ret; } profile_probability adjusted () const { profile_probability ret = *this; if (!initialized_p ()) return *this; ret.m_quality = ADJUSTED; return ret; } int to_reg_br_prob_base () const { ((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 277, __FUNCTION__), 0 : 0)); return (((m_val * (uint64_t) 10000) + (max_probability) / 2) / (max_probability)); } static profile_probability from_reg_br_prob_note (int v) { profile_probability ret; ret.m_val = ((unsigned int)v) / 8; ret.m_quality = (enum profile_quality)(v & 7); return ret; } int to_reg_br_prob_note () const { ((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 292, __FUNCTION__), 0 : 0)); int ret = m_val * 8 + m_quality; ((void)(!(from_reg_br_prob_note (ret) == *this) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 294, __FUNCTION__), 0 : 0)); return ret; } static profile_probability probability_in_gcov_type (gcov_type val1, gcov_type val2) { profile_probability ret; ((void)(!(val1 >= 0 && val2 > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 303, __FUNCTION__), 0 : 0)); if (val1 > val2) ret.m_val = max_probability; else { uint64_t tmp; safe_scale_64bit (val1, max_probability, val2, &tmp); ((void)(!(tmp <= max_probability) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 310, __FUNCTION__), 0 : 0)); ret.m_val = tmp; } ret.m_quality = PRECISE; return ret; } bool operator== (const profile_probability &other) const { return m_val == other.m_val && m_quality == other.m_quality; } profile_probability operator+ (const profile_probability &other) const { if (other == never ()) return *this; if (*this == never ()) return other; if (!initialized_p () || !other.initialized_p ()) return uninitialized (); profile_probability ret; ret.m_val = (((uint32_t)(m_val + other.m_val)) < (max_probability) ? ((uint32_t)(m_val + other.m_val)) : (max_probability)); ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); return ret; } profile_probability &operator+= (const profile_probability &other) { if (other == never ()) return *this; if (*this == never ()) { *this = other; return *this; } if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { m_val = (((uint32_t)(m_val + other.m_val)) < (max_probability) ? ((uint32_t)(m_val + other.m_val)) : (max_probability)); m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); } return *this; } profile_probability operator- (const profile_probability &other) const { if (*this == never () || other == never ()) return *this; if (!initialized_p () || !other.initialized_p ()) return uninitialized (); profile_probability ret; ret.m_val = m_val >= other.m_val ? m_val - other.m_val : 0; ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); return ret; } profile_probability &operator-= (const profile_probability &other) { if (*this == never () || other == never ()) return *this; if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { m_val = m_val >= other.m_val ? m_val - other.m_val : 0; m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); } return *this; } profile_probability operator* (const profile_probability &other) const { if (*this == never () || other == never ()) return never (); if (!initialized_p () || !other.initialized_p ()) return uninitialized (); profile_probability ret; ret.m_val = ((((uint64_t)m_val * other.m_val) + (max_probability) / 2) / (max_probability)); ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED)); return ret; } profile_probability &operator*= (const profile_probability &other) { if (*this == never () || other == never ()) return *this = never (); if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { m_val = ((((uint64_t)m_val * other.m_val) + (max_probability) / 2) / (max_probability)); m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED)); } return *this; } profile_probability operator/ (const profile_probability &other) const { if (*this == never ()) return never (); if (!initialized_p () || !other.initialized_p ()) return uninitialized (); profile_probability ret; if (m_val >= other.m_val) { ret.m_val = max_probability; ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (GUESSED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (GUESSED)) ; return ret; } else if (!m_val) ret.m_val = 0; else { ((void)(!(other.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 432, __FUNCTION__), 0 : 0)); ret.m_val = ((((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) < (max_probability) ? (((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) : (max_probability)) ; } ret.m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED)); return ret; } profile_probability &operator/= (const profile_probability &other) { if (*this == never ()) return *this = never (); if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { if (m_val > other.m_val) { m_val = max_probability; m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (GUESSED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (GUESSED)) ; return *this; } else if (!m_val) ; else { ((void)(!(other.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 462, __FUNCTION__), 0 : 0)); m_val = ((((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) < (max_probability) ? (((((uint64_t)m_val * max_probability) + (other.m_val) / 2) / (other.m_val))) : (max_probability)) ; } m_quality = ((((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) < (ADJUSTED) ? (((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality))) : (ADJUSTED)); } return *this; } # 487 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" profile_probability split (const profile_probability &cprob) { profile_probability ret = *this * cprob; if (!(*this == always ())) *this = (*this - ret) / ret.invert (); return ret; } gcov_type apply (gcov_type val) const { if (*this == uninitialized ()) return val / 2; return (((val * m_val) + (max_probability) / 2) / (max_probability)); } profile_probability invert () const { return always() - *this; } profile_probability guessed () const { profile_probability ret = *this; ret.m_quality = GUESSED; return ret; } profile_probability afdo () const { profile_probability ret = *this; ret.m_quality = AFDO; return ret; } profile_probability apply_scale (int64_t num, int64_t den) const { if (*this == never ()) return *this; if (!initialized_p ()) return uninitialized (); profile_probability ret; uint64_t tmp; safe_scale_64bit (m_val, num, den, &tmp); ret.m_val = ((tmp) < (max_probability) ? (tmp) : (max_probability)); ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED)); return ret; } # 560 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" bool probably_reliable_p () const { if (m_quality >= ADJUSTED) return true; if (!initialized_p ()) return false; return m_val < max_probability / 100 || m_val > max_probability - max_probability / 100; } bool verify () const { ((void)(!(m_quality != UNINITIALIZED_PROFILE) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 573, __FUNCTION__), 0 : 0)); if (m_val == uninitialized_probability) return m_quality == GUESSED; else if (m_quality < GUESSED) return false; return m_val <= max_probability; } bool operator< (const profile_probability &other) const { return initialized_p () && other.initialized_p () && m_val < other.m_val; } bool operator> (const profile_probability &other) const { return initialized_p () && other.initialized_p () && m_val > other.m_val; } bool operator<= (const profile_probability &other) const { return initialized_p () && other.initialized_p () && m_val <= other.m_val; } bool operator>= (const profile_probability &other) const { return initialized_p () && other.initialized_p () && m_val >= other.m_val; } uint32_t value () const { return m_val; } enum profile_quality quality () const { return m_quality; } void dump (FILE *f) const; void debug () const; bool differs_from_p (profile_probability other) const; bool differs_lot_from_p (profile_probability other) const; profile_probability combine_with_count (profile_count count1, profile_probability other, profile_count count2) const; sreal to_sreal () const; static profile_probability stream_in (class lto_input_block *); void stream_out (struct output_block *); void stream_out (struct lto_output_stream *); }; # 690 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" struct profile_count { public: static const int n_bits = 61; static const uint64_t max_count = ((uint64_t) 1 << n_bits) - 2; private: static const uint64_t uninitialized_count = ((uint64_t) 1 << n_bits) - 1; # 711 "/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h" uint64_t m_val : n_bits; enum profile_quality m_quality : 3; public: bool compatible_p (const profile_count other) const { if (!initialized_p () || !other.initialized_p ()) return true; if (*this == zero () || other == zero ()) return true; if (ipa ().nonzero_p () && !(other.ipa () == other)) return false; if (other.ipa ().nonzero_p () && !(ipa () == *this)) return false; return ipa_p () == other.ipa_p (); } static profile_count zero () { return from_gcov_type (0); } static profile_count adjusted_zero () { profile_count c; c.m_val = 0; c.m_quality = ADJUSTED; return c; } static profile_count guessed_zero () { profile_count c; c.m_val = 0; c.m_quality = GUESSED; return c; } static profile_count one () { return from_gcov_type (1); } static profile_count uninitialized () { profile_count c; c.m_val = uninitialized_count; c.m_quality = GUESSED_LOCAL; return c; } gcov_type to_gcov_type () const { ((void)(!(initialized_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 778, __FUNCTION__), 0 : 0)); return m_val; } bool initialized_p () const { return m_val != uninitialized_count; } bool reliable_p () const { return m_quality >= ADJUSTED; } bool ipa_p () const { return !initialized_p () || m_quality >= GUESSED_GLOBAL0; } bool precise_p () const { return m_quality == PRECISE; } uint32_t value () const { return m_val; } enum profile_quality quality () const { return m_quality; } bool ok_for_merging (profile_count other) const { if (m_quality < ADJUSTED || other.m_quality < ADJUSTED) return true; return !(other < *this); } profile_count merge (profile_count other) const { if (*this == other || !other.initialized_p () || m_quality > other.m_quality) return *this; if (other.m_quality > m_quality || other > *this) return other; return *this; } bool operator== (const profile_count &other) const { return m_val == other.m_val && m_quality == other.m_quality; } profile_count operator+ (const profile_count &other) const { if (other == zero ()) return *this; if (*this == zero ()) return other; if (!initialized_p () || !other.initialized_p ()) return uninitialized (); profile_count ret; ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 853, __FUNCTION__), 0 : 0)); ret.m_val = m_val + other.m_val; ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); return ret; } profile_count &operator+= (const profile_count &other) { if (other == zero ()) return *this; if (*this == zero ()) { *this = other; return *this; } if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 872, __FUNCTION__), 0 : 0)); m_val += other.m_val; m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); } return *this; } profile_count operator- (const profile_count &other) const { if (*this == zero () || other == zero ()) return *this; if (!initialized_p () || !other.initialized_p ()) return uninitialized (); ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 885, __FUNCTION__), 0 : 0)); profile_count ret; ret.m_val = m_val >= other.m_val ? m_val - other.m_val : 0; ret.m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); return ret; } profile_count &operator-= (const profile_count &other) { if (*this == zero () || other == zero ()) return *this; if (!initialized_p () || !other.initialized_p ()) return *this = uninitialized (); else { ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 900, __FUNCTION__), 0 : 0)); m_val = m_val >= other.m_val ? m_val - other.m_val: 0; m_quality = ((m_quality) < (other.m_quality) ? (m_quality) : (other.m_quality)); } return *this; } bool verify () const { ((void)(!(m_quality != UNINITIALIZED_PROFILE) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 910, __FUNCTION__), 0 : 0)); return m_val != uninitialized_count || m_quality == GUESSED_LOCAL; } bool operator< (const profile_count &other) const { if (!initialized_p () || !other.initialized_p ()) return false; if (*this == zero ()) return !(other == zero ()); if (other == zero ()) return false; ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 924, __FUNCTION__), 0 : 0)); return m_val < other.m_val; } bool operator> (const profile_count &other) const { if (!initialized_p () || !other.initialized_p ()) return false; if (*this == zero ()) return false; if (other == zero ()) return !(*this == zero ()); ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 936, __FUNCTION__), 0 : 0)); return initialized_p () && other.initialized_p () && m_val > other.m_val; } bool operator< (const gcov_type other) const { ((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 942, __FUNCTION__), 0 : 0)); ((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 943, __FUNCTION__), 0 : 0)); return ipa ().initialized_p () && ipa ().m_val < (uint64_t) other; } bool operator> (const gcov_type other) const { ((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 949, __FUNCTION__), 0 : 0)); ((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 950, __FUNCTION__), 0 : 0)); return ipa ().initialized_p () && ipa ().m_val > (uint64_t) other; } bool operator<= (const profile_count &other) const { if (!initialized_p () || !other.initialized_p ()) return false; if (*this == zero ()) return true; if (other == zero ()) return (*this == zero ()); ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 962, __FUNCTION__), 0 : 0)); return m_val <= other.m_val; } bool operator>= (const profile_count &other) const { if (!initialized_p () || !other.initialized_p ()) return false; if (other == zero ()) return true; if (*this == zero ()) return (other == zero ()); ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 974, __FUNCTION__), 0 : 0)); return m_val >= other.m_val; } bool operator<= (const gcov_type other) const { ((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 980, __FUNCTION__), 0 : 0)); ((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 981, __FUNCTION__), 0 : 0)); return ipa ().initialized_p () && ipa ().m_val <= (uint64_t) other; } bool operator>= (const gcov_type other) const { ((void)(!(ipa_p ()) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 987, __FUNCTION__), 0 : 0)); ((void)(!(other >= 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 988, __FUNCTION__), 0 : 0)); return ipa ().initialized_p () && ipa ().m_val >= (uint64_t) other; } bool nonzero_p () const { return initialized_p () && m_val != 0; } profile_count force_nonzero () const { if (!initialized_p ()) return *this; profile_count ret = *this; if (ret.m_val == 0) { ret.m_val = 1; ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED)); } return ret; } profile_count max (profile_count other) const { profile_count val = *this; if (ipa ().nonzero_p () || other.ipa ().nonzero_p ()) { val = ipa (); other = other.ipa (); } if (!initialized_p ()) return other; if (!other.initialized_p ()) return *this; if (*this == zero ()) return other; if (other == zero ()) return *this; ((void)(!(compatible_p (other)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1032, __FUNCTION__), 0 : 0)); if (val.m_val < other.m_val || (m_val == other.m_val && val.m_quality < other.m_quality)) return other; return *this; } profile_count apply_probability (int prob) const { ((void)(!(prob >= 0 && prob <= 10000) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1043, __FUNCTION__), 0 : 0)); if (m_val == 0) return *this; if (!initialized_p ()) return uninitialized (); profile_count ret; ret.m_val = (((m_val * prob) + (10000) / 2) / (10000)); ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED)); return ret; } profile_count apply_probability (profile_probability prob) const { if (*this == zero ()) return *this; if (prob == profile_probability::never ()) return zero (); if (!initialized_p ()) return uninitialized (); profile_count ret; uint64_t tmp; safe_scale_64bit (m_val, prob.m_val, profile_probability::max_probability, &tmp); ret.m_val = tmp; ret.m_quality = ((m_quality) < (prob.m_quality) ? (m_quality) : (prob.m_quality)); return ret; } profile_count apply_scale (int64_t num, int64_t den) const { if (m_val == 0) return *this; if (!initialized_p ()) return uninitialized (); profile_count ret; uint64_t tmp; ((void)(!(num >= 0 && den > 0) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1082, __FUNCTION__), 0 : 0)); safe_scale_64bit (m_val, num, den, &tmp); ret.m_val = ((tmp) < (max_count) ? (tmp) : (max_count)); ret.m_quality = ((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED)); return ret; } profile_count apply_scale (profile_count num, profile_count den) const { if (*this == zero ()) return *this; if (num == zero ()) return num; if (!initialized_p () || !num.initialized_p () || !den.initialized_p ()) return uninitialized (); if (num == den) return *this; ((void)(!(den.m_val) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1099, __FUNCTION__), 0 : 0)); profile_count ret; uint64_t val; safe_scale_64bit (m_val, num.m_val, den.m_val, &val); ret.m_val = ((val) < (max_count) ? (val) : (max_count)); ret.m_quality = ((((((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) < (num.m_quality) ? (((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) : (num.m_quality))) < (den.m_quality) ? (((((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) < (num.m_quality) ? (((m_quality) < (ADJUSTED) ? (m_quality) : (ADJUSTED))) : (num.m_quality))) : (den.m_quality)) ; if (num.ipa_p ()) ret.m_quality = ((ret.m_quality) > (num == num.ipa () ? GUESSED : num.m_quality) ? (ret.m_quality) : (num == num.ipa () ? GUESSED : num.m_quality)) ; return ret; } profile_count guessed_local () const { profile_count ret = *this; if (!initialized_p ()) return *this; ret.m_quality = GUESSED_LOCAL; return ret; } profile_count global0 () const { profile_count ret = *this; if (!initialized_p ()) return *this; ret.m_quality = GUESSED_GLOBAL0; return ret; } profile_count global0adjusted () const { profile_count ret = *this; if (!initialized_p ()) return *this; ret.m_quality = GUESSED_GLOBAL0_ADJUSTED; return ret; } profile_count guessed () const { profile_count ret = *this; ret.m_quality = ((ret.m_quality) < (GUESSED) ? (ret.m_quality) : (GUESSED)); return ret; } profile_count ipa () const { if (m_quality > GUESSED_GLOBAL0_ADJUSTED) return *this; if (m_quality == GUESSED_GLOBAL0) return zero (); if (m_quality == GUESSED_GLOBAL0_ADJUSTED) return adjusted_zero (); return uninitialized (); } profile_count afdo () const { profile_count ret = *this; ret.m_quality = AFDO; return ret; } profile_probability probability_in (const profile_count overall) const { if (*this == zero () && !(overall == zero ())) return profile_probability::never (); if (!initialized_p () || !overall.initialized_p () || !overall.m_val) return profile_probability::uninitialized (); if (*this == overall && m_quality == PRECISE) return profile_probability::always (); profile_probability ret; ((void)(!(compatible_p (overall)) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/profile-count.h", 1188, __FUNCTION__), 0 : 0)); if (overall.m_val < m_val) { ret.m_val = profile_probability::max_probability; ret.m_quality = GUESSED; return ret; } else ret.m_val = (((m_val * profile_probability::max_probability) + (overall.m_val) / 2) / (overall.m_val)) ; ret.m_quality = ((((((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) > (GUESSED) ? (((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) : (GUESSED))) < (ADJUSTED) ? (((((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) > (GUESSED) ? (((m_quality) < (overall.m_quality) ? (m_quality) : (overall.m_quality))) : (GUESSED))) : (ADJUSTED)) ; return ret; } int to_frequency (struct function *fun) const; int to_cgraph_frequency (profile_count entry_bb_count) const; sreal to_sreal_scale (profile_count in, bool *known = nullptr) const; void dump (FILE *f) const; void debug () const; bool differs_from_p (profile_count other) const; static void adjust_for_ipa_scaling (profile_count *num, profile_count *den); profile_count combine_with_ipa_count (profile_count ipa); profile_count combine_with_ipa_count_within (profile_count ipa, profile_count ipa2); static profile_count from_gcov_type (gcov_type v, profile_quality quality = PRECISE); static profile_count stream_in (class lto_input_block *); void stream_out (struct output_block *); void stream_out (struct lto_output_stream *); }; # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" 2 # 41 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" enum tree_dump_index { TDI_none, TDI_cgraph, TDI_inheritance, TDI_clones, TDI_original, TDI_gimple, TDI_nested, TDI_lto_stream_out, TDI_profile_report, TDI_lang_all, TDI_tree_all, TDI_rtl_all, TDI_ipa_all, TDI_end }; enum dump_kind { DK_none, DK_lang, DK_tree, DK_rtl, DK_ipa }; enum dump_flag { TDF_NONE = 0, TDF_ADDRESS = (1 << 0), TDF_SLIM = (1 << 1), TDF_RAW = (1 << 2), TDF_DETAILS = (1 << 3), TDF_STATS = (1 << 4), TDF_BLOCKS = (1 << 5), TDF_VOPS = (1 << 6), TDF_LINENO = (1 << 7), TDF_UID = (1 << 8), TDF_STMTADDR = (1 << 9), TDF_GRAPH = (1 << 10), TDF_MEMSYMS = (1 << 11), TDF_RHS_ONLY = (1 << 12), TDF_ASMNAME = (1 << 13), TDF_EH = (1 << 14), TDF_NOUID = (1 << 15), TDF_ALIAS = (1 << 16), TDF_ENUMERATE_LOCALS = (1 << 17), TDF_CSELIB = (1 << 18), TDF_SCEV = (1 << 19), TDF_GIMPLE = (1 << 20), TDF_FOLDING = (1 << 21), MSG_OPTIMIZED_LOCATIONS = (1 << 22), MSG_MISSED_OPTIMIZATION = (1 << 23), MSG_NOTE = (1 << 24), MSG_ALL_KINDS = (MSG_OPTIMIZED_LOCATIONS | MSG_MISSED_OPTIMIZATION | MSG_NOTE), # 178 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" MSG_PRIORITY_USER_FACING = (1 << 25), MSG_PRIORITY_INTERNALS = (1 << 26), MSG_PRIORITY_REEMITTED = (1 << 27), MSG_ALL_PRIORITIES = (MSG_PRIORITY_USER_FACING | MSG_PRIORITY_INTERNALS | MSG_PRIORITY_REEMITTED), TDF_COMPARE_DEBUG = (1 << 28), TDF_ERROR = (1 << 26), TDF_ALL_VALUES = (1 << 29) - 1 }; typedef enum dump_flag dump_flags_t; static inline dump_flags_t operator| (dump_flags_t lhs, dump_flags_t rhs) { return (dump_flags_t)((int)lhs | (int)rhs); } static inline dump_flags_t operator& (dump_flags_t lhs, dump_flags_t rhs) { return (dump_flags_t)((int)lhs & (int)rhs); } static inline dump_flags_t operator~ (dump_flags_t flags) { return (dump_flags_t)~((int)flags); } static inline dump_flags_t & operator|= (dump_flags_t &lhs, dump_flags_t rhs) { lhs = (dump_flags_t)((int)lhs | (int)rhs); return lhs; } static inline dump_flags_t & operator&= (dump_flags_t &lhs, dump_flags_t rhs) { lhs = (dump_flags_t)((int)lhs & (int)rhs); return lhs; } enum optgroup_flag { OPTGROUP_NONE = 0, OPTGROUP_IPA = (1 << 1), OPTGROUP_LOOP = (1 << 2), OPTGROUP_INLINE = (1 << 3), OPTGROUP_OMP = (1 << 4), OPTGROUP_VEC = (1 << 5), OPTGROUP_OTHER = (1 << 6), OPTGROUP_ALL = (OPTGROUP_IPA | OPTGROUP_LOOP | OPTGROUP_INLINE | OPTGROUP_OMP | OPTGROUP_VEC | OPTGROUP_OTHER) }; typedef enum optgroup_flag optgroup_flags_t; static inline optgroup_flags_t operator| (optgroup_flags_t lhs, optgroup_flags_t rhs) { return (optgroup_flags_t)((int)lhs | (int)rhs); } static inline optgroup_flags_t & operator|= (optgroup_flags_t &lhs, optgroup_flags_t rhs) { lhs = (optgroup_flags_t)((int)lhs | (int)rhs); return lhs; } struct dump_file_info { const char *suffix; const char *swtch; const char *glob; const char *pfilename; const char *alt_filename; FILE *pstream; FILE *alt_stream; dump_kind dkind; dump_flags_t pflags; dump_flags_t alt_flags; optgroup_flags_t optgroup_flags; int pstate; int alt_state; int num; bool owns_strings; bool graph_dump_initialized; }; class dump_user_location_t { public: dump_user_location_t () : m_count (), m_loc (((location_t) 0)) {} dump_user_location_t (const gimple *stmt); dump_user_location_t (const rtx_insn *insn); static dump_user_location_t from_location_t (location_t loc) { return dump_user_location_t (profile_count (), loc); } static dump_user_location_t from_function_decl (tree fndecl); profile_count get_count () const { return m_count; } location_t get_location_t () const { return m_loc; } private: dump_user_location_t (profile_count count, location_t loc) : m_count (count), m_loc (loc) {} profile_count m_count; location_t m_loc; }; class dump_impl_location_t { public: dump_impl_location_t ( const char *file = __builtin_FILE (), int line = __builtin_LINE (), const char *function = __builtin_FUNCTION () ) : m_file (file), m_line (line), m_function (function) {} const char *m_file; int m_line; const char *m_function; }; # 404 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" class dump_metadata_t { public: dump_metadata_t (dump_flags_t dump_flags, const dump_impl_location_t &impl_location = dump_impl_location_t ()) : m_dump_flags (dump_flags), m_impl_location (impl_location) { } dump_flags_t get_dump_flags () const { return m_dump_flags; } const dump_impl_location_t & get_impl_location () const { return m_impl_location; } private: dump_flags_t m_dump_flags; dump_impl_location_t m_impl_location; }; # 436 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" class dump_location_t { public: dump_location_t (const dump_impl_location_t &impl_location = dump_impl_location_t ()) : m_user_location (dump_user_location_t ()), m_impl_location (impl_location) { } dump_location_t (const gimple *stmt, const dump_impl_location_t &impl_location = dump_impl_location_t ()) : m_user_location (dump_user_location_t (stmt)), m_impl_location (impl_location) { } dump_location_t (const rtx_insn *insn, const dump_impl_location_t &impl_location = dump_impl_location_t ()) : m_user_location (dump_user_location_t (insn)), m_impl_location (impl_location) { } dump_location_t (const dump_user_location_t &user_location, const dump_impl_location_t &impl_location = dump_impl_location_t ()) : m_user_location (user_location), m_impl_location (impl_location) { } static dump_location_t from_location_t (location_t loc, const dump_impl_location_t &impl_location = dump_impl_location_t ()) { return dump_location_t (dump_user_location_t::from_location_t (loc), impl_location); } const dump_user_location_t & get_user_location () const { return m_user_location; } const dump_impl_location_t & get_impl_location () const { return m_impl_location; } location_t get_location_t () const { return m_user_location.get_location_t (); } profile_count get_count () const { return m_user_location.get_count (); } private: dump_user_location_t m_user_location; dump_impl_location_t m_impl_location; }; extern FILE *dump_begin (int, dump_flags_t *, int part=-1); extern void dump_end (int, FILE *); extern int opt_info_switch_p (const char *); extern const char *dump_flag_name (int); extern const kv_pair<optgroup_flags_t> optgroup_options[]; extern dump_flags_t parse_dump_option (const char *, const char **); extern FILE *dump_file; extern dump_flags_t dump_flags; extern const char *dump_file_name; extern bool dumps_are_enabled; extern void set_dump_file (FILE *new_dump_file); static inline bool dump_enabled_p (void) { return dumps_are_enabled; } # 563 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" extern void dump_printf (const dump_metadata_t &, const char *, ...) __attribute__ ((__format__ (__gcc_dump_printf__, 2 ,3))) __attribute__ ((__nonnull__ (2))); extern void dump_printf_loc (const dump_metadata_t &, const dump_user_location_t &, const char *, ...) __attribute__ ((__format__ (__gcc_dump_printf__, 3 ,0))) __attribute__ ((__nonnull__ (3))); extern void dump_function (int phase, tree fn); extern void dump_basic_block (dump_flags_t, basic_block, int); extern void dump_generic_expr_loc (const dump_metadata_t &, const dump_user_location_t &, dump_flags_t, tree); extern void dump_generic_expr (const dump_metadata_t &, dump_flags_t, tree); extern void dump_gimple_stmt_loc (const dump_metadata_t &, const dump_user_location_t &, dump_flags_t, gimple *, int); extern void dump_gimple_stmt (const dump_metadata_t &, dump_flags_t, gimple *, int); extern void dump_gimple_expr_loc (const dump_metadata_t &, const dump_user_location_t &, dump_flags_t, gimple *, int); extern void dump_gimple_expr (const dump_metadata_t &, dump_flags_t, gimple *, int); extern void dump_symtab_node (const dump_metadata_t &, symtab_node *); template<unsigned int N, typename C> void dump_dec (const dump_metadata_t &, const poly_int<N, C> &); extern void dump_dec (dump_flags_t, const poly_wide_int &, signop); extern void dump_hex (dump_flags_t, const poly_wide_int &); extern void dumpfile_ensure_any_optinfo_are_flushed (); extern unsigned int get_dump_scope_depth (); extern void dump_begin_scope (const char *name, const dump_user_location_t &user_location, const dump_impl_location_t &impl_location); extern void dump_end_scope (); class auto_dump_scope { public: auto_dump_scope (const char *name, const dump_user_location_t &user_location, const dump_impl_location_t &impl_location = dump_impl_location_t ()) { if (dump_enabled_p ()) dump_begin_scope (name, user_location, impl_location); } ~auto_dump_scope () { if (dump_enabled_p ()) dump_end_scope (); } }; # 640 "/home/giulianob/gcc_git_gnu/gcc/gcc/dumpfile.h" extern void dump_function (int phase, tree fn); extern void print_combine_total_stats (void); extern bool enable_rtl_dump_file (void); extern void dump_node (const_tree, dump_flags_t, FILE *); extern void dump_combine_total_stats (FILE *); extern void dump_bb (FILE *, basic_block, int, dump_flags_t); class opt_pass; namespace gcc { class dump_manager { public: dump_manager (); ~dump_manager (); unsigned int dump_register (const char *suffix, const char *swtch, const char *glob, dump_kind dkind, optgroup_flags_t optgroup_flags, bool take_ownership); void register_dumps (); struct dump_file_info * get_dump_file_info (int phase) const; struct dump_file_info * get_dump_file_info_by_switch (const char *swtch) const; char * get_dump_file_name (int phase, int part = -1) const; char * get_dump_file_name (struct dump_file_info *dfi, int part = -1) const; void dump_switch_p (const char *arg); int dump_start (int phase, dump_flags_t *flag_ptr); void dump_finish (int phase); FILE * dump_begin (int phase, dump_flags_t *flag_ptr, int part); int dump_initialized_p (int phase) const; const char * dump_flag_name (int phase) const; void register_pass (opt_pass *pass); private: int dump_phase_enabled_p (int phase) const; int dump_switch_p_1 (const char *arg, struct dump_file_info *dfi, bool doglob); int dump_enable_all (dump_kind dkind, dump_flags_t flags, const char *filename); int opt_info_enable_passes (optgroup_flags_t optgroup_flags, dump_flags_t flags, const char *filename); bool update_dfi_for_opt_info (dump_file_info *dfi) const; private: int m_next_dump; struct dump_file_info *m_extra_dump_files; size_t m_extra_dump_files_in_use; size_t m_extra_dump_files_alloced; optgroup_flags_t m_optgroup_flags; dump_flags_t m_optinfo_flags; char *m_optinfo_filename; friend bool ::enable_rtl_dump_file (void); friend int ::opt_info_switch_p (const char *arg); }; } # 482 "/home/giulianob/gcc_git_gnu/gcc/gcc/coretypes.h" 2 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 1 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 1 # 111 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" # 1 "/usr/lib/gcc/x86_64-linux-gnu/10/include/stddef.h" 1 3 4 # 112 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 2 # 153 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" extern "C" { struct _obstack_chunk { char *limit; struct _obstack_chunk *prev; char contents[4]; }; struct obstack { size_t chunk_size; struct _obstack_chunk *chunk; char *object_base; char *next_free; char *chunk_limit; union { size_t i; void *p; } temp; size_t alignment_mask; union { void *(*plain) (size_t); void *(*extra) (void *, size_t); } chunkfun; union { void (*plain) (void *); void (*extra) (void *, void *); } freefun; void *extra_arg; unsigned use_extra_arg : 1; unsigned maybe_empty_object : 1; unsigned alloc_failed : 1; }; extern void _obstack_newchunk (struct obstack *, size_t); extern void _obstack_free (struct obstack *, void *); extern int _obstack_begin (struct obstack *, size_t, size_t, void *(*) (size_t), void (*) (void *)); extern int _obstack_begin_1 (struct obstack *, size_t, size_t, void *(*) (void *, size_t), void (*) (void *, void *), void *); extern size_t _obstack_memory_used (struct obstack *) # 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" 3 4 __attribute__ ((__pure__)) # 212 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" ; extern void (*obstack_alloc_failed_handler) (void); extern int obstack_exit_failure; # 532 "/home/giulianob/gcc_git_gnu/gcc/gcc/../include/obstack.h" } # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/diagnostic-url.h" 1 # 27 "/home/giulianob/gcc_git_gnu/gcc/gcc/diagnostic-url.h" typedef enum { DIAGNOSTICS_URL_NO = 0, DIAGNOSTICS_URL_YES = 1, DIAGNOSTICS_URL_AUTO = 2 } diagnostic_url_rule_t; enum diagnostic_url_format { URL_FORMAT_NONE, URL_FORMAT_ST, URL_FORMAT_BEL }; const diagnostic_url_format URL_FORMAT_DEFAULT = URL_FORMAT_BEL; extern diagnostic_url_format determine_url_format (diagnostic_url_rule_t); # 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 2 struct text_info { const char *format_spec; va_list *args_ptr; int err_no; void **x_data; rich_location *m_richloc; void set_location (unsigned int idx, location_t loc, enum range_display_kind range_display_kind); location_t get_location (unsigned int index_of_location) const; }; enum diagnostic_prefixing_rule_t { DIAGNOSTICS_SHOW_PREFIX_ONCE = 0x0, DIAGNOSTICS_SHOW_PREFIX_NEVER = 0x1, DIAGNOSTICS_SHOW_PREFIX_EVERY_LINE = 0x2 }; struct chunk_info { struct chunk_info *prev; const char *args[30 * 2]; }; class output_buffer { public: output_buffer (); ~output_buffer (); struct obstack formatted_obstack; struct obstack chunk_obstack; struct obstack *obstack; struct chunk_info *cur_chunk_array; FILE *stream; int line_length; char digit_buffer[128]; bool flush_p; }; static inline const char * output_buffer_formatted_text (output_buffer *buff) { __extension__ ({ struct obstack *__o = (buff->obstack); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < 1) _obstack_newchunk (__o, 1); ((void) (*((__o)->next_free)++ = ('\0'))); }); return (const char *) ((void *) (buff->obstack)->object_base); } static inline void output_buffer_append_r (output_buffer *buff, const char *start, int length) { ((void)(!(start) ? fancy_abort ("/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h", 128, __FUNCTION__), 0 : 0)); __extension__ ({ struct obstack *__o = (buff->obstack); size_t __len = (length); if (__extension__ ({ struct obstack const *__o1 = (__o); (size_t) (__o1->chunk_limit - __o1->next_free); }) < __len) _obstack_newchunk (__o, __len); memcpy (__o->next_free, start, __len); __o->next_free += __len; (void) 0; }); for (int i = 0; i < length; i++) if (start[i] == '\n') buff->line_length = 0; else buff->line_length++; } static inline const char * output_buffer_last_position_in_text (const output_buffer *buff) { const char *p = nullptr; struct obstack *text = buff->obstack; if (((void *) (text)->object_base) != ((void *) (text)->next_free)) p = ((const char *) ((void *) (text)->next_free)) - 1; return p; } typedef unsigned int pp_flags; enum pp_padding { pp_none, pp_before, pp_after }; struct pp_wrapping_mode_t { diagnostic_prefixing_rule_t rule; int line_cutoff; }; # 184 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" typedef bool (*printer_fn) (pretty_printer *, text_info *, const char *, int, bool, bool, bool, bool *, const char **); class format_postprocessor { public: virtual ~format_postprocessor () {} virtual format_postprocessor *clone() const = 0; virtual void handle (pretty_printer *) = 0; }; # 220 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" class pretty_printer { public: explicit pretty_printer (int = 0); explicit pretty_printer (const pretty_printer &other); virtual ~pretty_printer (); virtual pretty_printer *clone () const; output_buffer *buffer; char *prefix; pp_padding padding; int maximum_length; int indent_skip; pp_wrapping_mode_t wrapping; # 261 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" printer_fn format_decoder; format_postprocessor *m_format_postprocessor; bool emitted_prefix; bool need_newline; bool translate_identifiers; bool show_color; diagnostic_url_format url_format; }; static inline const char * pp_get_prefix (const pretty_printer *pp) { return pp->prefix; } # 353 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" extern void pp_set_line_maximum_length (pretty_printer *, int); extern void pp_set_prefix (pretty_printer *, char *); extern char *pp_take_prefix (pretty_printer *); extern void pp_destroy_prefix (pretty_printer *); extern int pp_remaining_character_count_for_line (pretty_printer *); extern void pp_clear_output_area (pretty_printer *); extern const char *pp_formatted_text (pretty_printer *); extern const char *pp_last_position_in_text (const pretty_printer *); extern void pp_emit_prefix (pretty_printer *); extern void pp_append_text (pretty_printer *, const char *, const char *); extern void pp_newline_and_flush (pretty_printer *); extern void pp_newline_and_indent (pretty_printer *, int); extern void pp_separate_with (pretty_printer *, char); # 382 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" extern void pp_printf (pretty_printer *, const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 2 ,3))) __attribute__ ((__nonnull__ (2))); extern void pp_verbatim (pretty_printer *, const char *, ...) __attribute__ ((__format__ (__gcc_diag__, 2 ,3))) __attribute__ ((__nonnull__ (2))); extern void pp_flush (pretty_printer *); extern void pp_really_flush (pretty_printer *); extern void pp_format (pretty_printer *, text_info *); extern void pp_output_formatted_text (pretty_printer *); extern void pp_format_verbatim (pretty_printer *, text_info *); extern void pp_indent (pretty_printer *); extern void pp_newline (pretty_printer *); extern void pp_character (pretty_printer *, int); extern void pp_string (pretty_printer *, const char *); extern void pp_write_text_to_stream (pretty_printer *); extern void pp_write_text_as_dot_label_to_stream (pretty_printer *, bool); extern void pp_write_text_as_html_like_dot_to_stream (pretty_printer *pp); extern void pp_maybe_space (pretty_printer *); extern void pp_begin_quote (pretty_printer *, bool); extern void pp_end_quote (pretty_printer *, bool); extern void pp_begin_url (pretty_printer *pp, const char *url); extern void pp_end_url (pretty_printer *pp); static inline pp_wrapping_mode_t pp_set_verbatim_wrapping_ (pretty_printer *pp) { pp_wrapping_mode_t oldmode = (pp)->wrapping; (pp)->wrapping.line_cutoff = 0; (pp)->wrapping.rule = DIAGNOSTICS_SHOW_PREFIX_NEVER; return oldmode; } extern const char *identifier_to_locale (const char *); extern void *(*identifier_to_locale_alloc) (size_t); extern void (*identifier_to_locale_free) (void *); inline void pp_wide_integer (pretty_printer *pp, long i) { do { sprintf ((pp)->buffer->digit_buffer, "%" # 430 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" 3 4 "l" "d" # 430 "/home/giulianob/gcc_git_gnu/gcc/gcc/pretty-print.h" , i); pp_string (pp, (pp)->buffer->digit_buffer); } while (0); } template<unsigned int N, typename T> void pp_wide_integer (pretty_printer *pp, const poly_int_pod<N, T> &); # 25 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2 # 1 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.h" 1 # 24 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.h" namespace ana { class bar_chart { public: typedef unsigned long value_t; void add_item (const char *name, value_t value); void print (pretty_printer *pp) const; private: struct item { item (const char *name, value_t value) : m_name (xstrdup (name)), m_strlen (strlen (name)) , m_value (value) {} ~item () { free (m_name); } char *m_name; size_t m_strlen; value_t m_value; }; static void print_padding (pretty_printer *pp, size_t count); auto_delete_vec<item> m_items; }; } # 26 "/home/giulianob/gcc_git_gnu/gcc/gcc/analyzer/bar-chart.cc" 2 namespace ana { void bar_chart::add_item (const char *name, value_t value) { m_items.safe_push (new item (name, value)); } void bar_chart::print (pretty_printer *pp) const { size_t max_width_name = 0; size_t max_width_value = 0; value_t max_value = 0; unsigned i; item *item; char digit_buffer[128]; for (i = 0; (m_items).iterate ((i), &(item)); ++(i)) { max_width_name = ((max_width_name) > (item->m_strlen) ? (max_width_name) : (item->m_strlen)); sprintf (digit_buffer, "%li", item->m_value); max_width_value = ((max_width_value) > (strlen (digit_buffer)) ? (max_width_value) : (strlen (digit_buffer))); max_value = ((max_value) > (item->m_value) ? (max_value) : (item->m_value)); } for (i = 0; (m_items).iterate ((i), &(item)); ++(i)) { pp_string (pp, item->m_name); print_padding (pp, max_width_name - item->m_strlen); pp_string (pp, ": "); sprintf (digit_buffer, "%li", item->m_value); const size_t value_width = strlen (digit_buffer); print_padding (pp, max_width_value - value_width); pp_string (pp, digit_buffer); pp_character (pp, '|'); const int max_width_bar = ((max_value) < (76 - (max_width_name + max_width_value + 4)) ? (max_value) : (76 - (max_width_name + max_width_value + 4))); const int bar_width = (max_value > 0 ? (max_width_bar * item->m_value) / max_value : 0); for (int j = 0; j < bar_width; j++) pp_character (pp, '#'); print_padding (pp, max_width_bar - bar_width); pp_character (pp, '|'); pp_newline (pp); } } void bar_chart::print_padding (pretty_printer *pp, size_t count) { for (size_t i = 0; i < count; i++) pp_character (pp, ' '); } }
[ "giuliano.belinassi@usp.br" ]
giuliano.belinassi@usp.br
736a7489a8d36a1c937cf64d39ebc56af7595bf8
45e425ccfed054b2c92b6489f05070b02e25e6ef
/codeforce/Robot Vacuum Cleaner.cpp
5fd2d1c45b4b3625ef395875b23d72a0f1b4691c
[]
no_license
riddhi2000/Competitive-programming
7d249d6c8f3756b68da738583dca429bab99f661
13e1d4fd40add753dedf524bf827b01491b6408c
refs/heads/master
2021-09-08T08:11:20.594961
2018-03-08T14:21:45
2018-03-08T14:21:45
108,946,879
0
0
null
null
null
null
UTF-8
C++
false
false
238
cpp
#include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define pp pop_back #define mp make_pair #define MOD 1e9+7 int main(){ int n; cin >> n; for(int i=0;i<n;i++){ string s; cin >> s; } }
[ "riddhi.patel@students.iiit.ac.in" ]
riddhi.patel@students.iiit.ac.in
ac05503fc8391b952bb93fcaf8735c4b205b9c5a
cefa236ced93d5893ff79d48bf4f1eb9e7a625be
/Распределительный контест/2.cpp
58ca487d84e3e34cf6288eba2ba69c767c4b484a
[ "MIT" ]
permissive
NoliVerga/mipt_1course
26a461140eed0779d5128fc8f788e246d3d30c98
6139629d371b1fa1f747d918d7e95ff804e16d78
refs/heads/master
2021-01-20T16:41:59.309307
2015-03-26T10:36:25
2015-03-26T10:36:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
205
cpp
#include <stdio.h> #include <iostream> using namespace std; int main() { int hh, mm, x; cin >> hh >> mm >> x; mm += x; hh += mm/60; mm = mm % 60; printf("%#02d:%#02d", hh, mm); return 0; }
[ "b.bagno@itima.ru" ]
b.bagno@itima.ru
9dde6429e549a56f144a51df5e35eb37d8475c85
2cd65c1db4c92118386ff60fff8ab7d8d2ee93ed
/WrapperFunctions.hpp
c3f731f65c55c9aa7b76864f45ab7658e8b34f34
[ "MIT" ]
permissive
Haaxor1689/Interpreter
8b8042823de5d6b575d905a3cbf0beded173de55
e9221db4c665f82eef0c70a1a3a09745d547b81a
refs/heads/master
2021-04-27T15:18:09.064218
2018-08-19T15:23:51
2018-08-19T15:23:51
122,468,839
0
0
null
2018-02-27T17:57:00
2018-02-22T11:18:02
C++
UTF-8
C++
false
false
689
hpp
#pragma once #include <string> #include <iostream> #include "Helpers.hpp" namespace Interpreter { void Write(const Value& string) { std::cout << ToString(string); } void WriteLine(const Value& string) { std::cout << ToString(string) << std::endl; } double ReadNumber() { std::string read; std::getline(std::cin, read); try { return std::stod(read); } catch (const std::invalid_argument&) { throw InternalException("Failed to convert input to number."); } } std::string ReadText() { std::string read; std::getline(std::cin, read); return read; } }
[ "betkomaros@gmail.com" ]
betkomaros@gmail.com
32fd46e615aa134d1b7eb9f621d4c6319f7ea51f
9e5b086abad65730292b2dad52e3f1999351e318
/example/ConsumeLoop.cpp
5ede5f2fe7e22da5e7cbec002416309d518c8fea
[ "Apache-2.0" ]
permissive
morganstanley/binlog
4cd5da5c4db9db70e3dfe94c0ccddf8a82748302
4cd8f78cfa371921583fa94132b10d68b50f0242
refs/heads/main
2023-06-25T17:51:30.753346
2023-06-19T12:04:31
2023-06-21T09:11:28
226,114,666
289
49
Apache-2.0
2023-06-15T08:30:16
2019-12-05T13:59:09
C++
UTF-8
C++
false
false
872
cpp
#include <binlog/binlog.hpp> #include <fstream> #include <iostream> #include <string> void processInput(const std::string& input, binlog::SessionWriter& writer) { BINLOG_INFO_W(writer, "Input received: {}", input); /* do processing ... */ BINLOG_INFO_W(writer, "Input processed"); } int main() { std::ofstream logfile("consumeloop.blog", std::ofstream::out|std::ofstream::binary); //[loop binlog::Session session; const std::size_t queueCapacityBytes = 1 << 20; binlog::SessionWriter writer(session, queueCapacityBytes); std::string input; while (std::getline(std::cin, input)) { processInput(input, writer); // logs using `writer` session.consume(logfile); } //] if (! logfile) { std::cerr << "Failed to write consumeloop.blog\n"; return 1; } std::cout << "Binary log written to consumeloop.blog\n"; return 0; }
[ "Benedek.Thaler@morganstanley.com" ]
Benedek.Thaler@morganstanley.com
da10169407063a36c889421a77c9ab31671cdb6c
8bc919cd1c0e880b736052154a33a3ffaa3a1c0d
/24.chapter/Demo.04/Demo.h
dfa205af1d72cbbf6bf458111cc7f8311fb06af3
[]
no_license
goodpaperman/inside
84d4ae5c8a0ad322bfa3e73ca77e69a33f27e708
70380057cdc00a6c9033ddaf21669949a23592c9
refs/heads/master
2020-05-30T11:02:41.953202
2019-06-01T03:52:43
2019-06-01T03:52:43
189,687,692
0
0
null
null
null
null
UTF-8
C++
false
false
1,385
h
// Demo.h : main header file for the DEMO application // #if !defined(AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_) #define AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_ #if _MSC_VER > 1000 #pragma once #endif // _MSC_VER > 1000 #ifndef __AFXWIN_H__ #error include 'stdafx.h' before including this file for PCH #endif #include "resource.h" // main symbols ///////////////////////////////////////////////////////////////////////////// // CDemoApp: // See Demo.cpp for the implementation of this class // class CDemoApp : public CWinApp { public: CDemoApp(); // Overrides // ClassWizard generated virtual function overrides //{{AFX_VIRTUAL(CDemoApp) public: virtual BOOL InitInstance(); virtual int ExitInstance(); //}}AFX_VIRTUAL // Implementation COleTemplateServer m_server; // Server object for document creation //{{AFX_MSG(CDemoApp) afx_msg void OnAppAbout(); // NOTE - the ClassWizard will add and remove member functions here. // DO NOT EDIT what you see in these blocks of generated code ! //}}AFX_MSG DECLARE_MESSAGE_MAP() }; ///////////////////////////////////////////////////////////////////////////// //{{AFX_INSERT_LOCATION}} // Microsoft Visual C++ will insert additional declarations immediately before the previous line. #endif // !defined(AFX_DEMO_H__BF9AC911_D0CE_458B_95EA_69FDE17DF1FB__INCLUDED_)
[ "haihai107@126.com" ]
haihai107@126.com
2a13283de0b38ebfd064785dc610d48ae0849d11
274dde0cd7ded9c38d0a71f5af8125c85cb10afe
/src/fj_mesh.cc
b5562a7a171fbd638e60ec5afa19afa13958b3e1
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
theomission/Fujiyama-Renderer
a81572c625421bde63096622d5c4436a505fc80d
e49c074dde1a4ab2abc5e687458487b35a692722
refs/heads/master
2020-12-28T22:46:45.517020
2015-11-20T19:19:35
2015-11-20T19:34:04
48,100,567
1
0
null
2015-12-16T09:28:36
2015-12-16T09:28:36
null
UTF-8
C++
false
false
10,574
cc
// Copyright (c) 2011-2015 Hiroshi Tsubokawa // See LICENSE and README #include "fj_mesh.h" #include "fj_intersection.h" #include "fj_primitive_set.h" #include "fj_triangle.h" #include "fj_ray.h" #define ATTRIBUTE_LIST(ATTR) \ ATTR(Point, Vector, P_, Position) \ ATTR(Point, Vector, N_, Normal) \ ATTR(Point, Color, Cd_, Color) \ ATTR(Point, TexCoord, uv_, Texture) \ ATTR(Point, Vector, velocity_, Velocity) \ ATTR(Face, Index3, indices_, Indices) \ ATTR(Face, int, face_group_id_, GroupID) namespace fj { #define ATTR(Class, Type, Name, Label) \ void Mesh::Add##Class##Label() \ { \ Name.resize(Get##Class##Count()); \ } \ Type Mesh::Get##Class##Label(int idx) const \ { \ if (idx < 0 || idx >= static_cast<int>(Name.size())) { \ return Type(); \ } \ return Name[idx]; \ } \ void Mesh::Set##Class##Label(int idx, const Type &value) \ { \ if (idx < 0 || idx >= static_cast<int>(Name.size())) \ return; \ Name[idx] = value; \ } \ bool Mesh::Has##Class##Label() const \ { \ return !Name.empty(); \ } ATTRIBUTE_LIST(ATTR) #undef ATTR void Mesh::Clear() { point_count_ = 0; face_count_ = 0; bounds_ = Box(); #define ATTR(Class, Type, Name, Label) std::vector<Type>().swap(Name); ATTRIBUTE_LIST(ATTR) #undef ATTR } static void get_point_positions(const Mesh &mesh, Index face_index, Vector &P0, Vector &P1, Vector &P2) { const Index3 face = mesh.GetFaceIndices(face_index); P0 = mesh.GetPointPosition(face.i0); P1 = mesh.GetPointPosition(face.i1); P2 = mesh.GetPointPosition(face.i2); } static void get_point_normals(const Mesh &mesh, Index face_index, Vector &N0, Vector &N1, Vector &N2) { const Index3 face = mesh.GetFaceIndices(face_index); N0 = mesh.GetPointNormal(face.i0); N1 = mesh.GetPointNormal(face.i1); N2 = mesh.GetPointNormal(face.i2); } static void get_point_texture(const Mesh &mesh, Index face_index, TexCoord &T0, TexCoord &T1, TexCoord &T2) { const Index3 face = mesh.GetFaceIndices(face_index); T0 = mesh.GetPointTexture(face.i0); T1 = mesh.GetPointTexture(face.i1); T2 = mesh.GetPointTexture(face.i2); } static void get_point_velocity(const Mesh &mesh, Index face_index, Vector &V0, Vector &V1, Vector &V2) { const Index3 face = mesh.GetFaceIndices(face_index); V0 = mesh.GetPointVelocity(face.i0); V1 = mesh.GetPointVelocity(face.i1); V2 = mesh.GetPointVelocity(face.i2); } static void get_vertex_normals(const Mesh &mesh, Index face_index, Vector &N0, Vector &N1, Vector &N2) { N0 = mesh.GetVertexNormal(3 * face_index + 0); N1 = mesh.GetVertexNormal(3 * face_index + 1); N2 = mesh.GetVertexNormal(3 * face_index + 2); } static Vector compute_shading_normal(const Mesh &mesh, Index face_index, double u, double v) { Vector N0, N1, N2; if (mesh.HasVertexNormal()) { get_vertex_normals(mesh, face_index, N0, N1, N2); } else { get_point_normals(mesh, face_index, N0, N1, N2); } return TriComputeNormal(N0, N1, N2, u, v); } Mesh::Mesh() : point_count_(0), face_count_(0), bounds_() { face_group_name_[""] = 0; } Mesh::~Mesh() { } int Mesh::GetPointCount() const { return point_count_; } int Mesh::GetFaceCount() const { return face_count_; } void Mesh::SetPointCount(int count) { point_count_ = count; } void Mesh::SetFaceCount(int count) { face_count_ = count; } const Box &Mesh::GetBounds() const { return bounds_; } //TODO TEST bool Mesh::HasVertexNormal() const { return !vertex_normal_.IsEmpty(); } Vector Mesh::GetVertexNormal(Index vertex_id) const { if (HasVertexNormal()) { return vertex_normal_.Get(vertex_id); } else { return Vector(0, 0, 0); } } int Mesh::CreateFaceGroup(const std::string &group_name) { std::map<std::string, int>::const_iterator it = face_group_name_.find(group_name); if (it != face_group_name_.end()) { return it->second; } const int new_id = static_cast<int>(face_group_name_.size()); face_group_name_[group_name] = new_id; return new_id; } int Mesh::LookupFaceGroup(const std::string &group_name) const { std::map<std::string, int>::const_iterator it = face_group_name_.find(group_name); if (it != face_group_name_.end()) { return it->second; } else { return -1; } } void Mesh::ComputeNormals() { if (!HasPointPosition() || !HasFaceIndices()) return; const int nverts = GetPointCount(); const int nfaces = GetFaceCount(); if (!HasPointNormal()) { AddPointNormal(); } // initialize N for (int i = 0; i < nverts; i++) { SetPointNormal(i, Vector(0, 0, 0)); } // compute N for (int i = 0; i < nfaces; i++) { Vector P0, P1, P2; get_point_positions(*this, i, P0, P1, P2); Vector N0, N1, N2; get_point_normals(*this, i, N0, N1, N2); const Index3 face = GetFaceIndices(i); const Vector Ng = TriComputeFaceNormal(P0, P1, P2); SetPointNormal(face.i0, N0 + Ng); SetPointNormal(face.i1, N1 + Ng); SetPointNormal(face.i2, N2 + Ng); } // normalize N for (int i = 0; i < nverts; i++) { Vector N = GetPointNormal(i); SetPointNormal(i, Normalize(&N)); } } void Mesh::ComputeBounds() { bounds_.ReverseInfinite(); for (int i = 0; i < GetFaceCount(); i++) { Box tri_bounds; GetPrimitiveBounds(i, &tri_bounds); bounds_.AddBox(tri_bounds); } } bool Mesh::ray_intersect(Index prim_id, const Ray &ray, Real time, Intersection *isect) const { Vector P0, P1, P2; get_point_positions(*this, prim_id, P0, P1, P2); if (HasPointVelocity()) { Vector velocity0, velocity1, velocity2; get_point_velocity(*this, prim_id, velocity0, velocity1, velocity2); P0 += time * velocity0; P1 += time * velocity1; P2 += time * velocity2; } double u, v; double t_hit; const int hit = TriRayIntersect( P0, P1, P2, ray.orig, ray.dir, DO_NOT_CULL_BACKFACES, &t_hit, &u, &v); if (!hit) return false; if (isect == NULL) return true; // we don't know N at time sampled point with velocity motion blur // just using N from mesh data // intersect info isect->N = compute_shading_normal(*this, prim_id, u, v); // TODO TMP uv handling // UV = (1-u-v) * UV0 + u * UV1 + v * UV2 if (HasPointTexture()) { TexCoord uv0, uv1, uv2; get_point_texture(*this, prim_id, uv0, uv1, uv2); const float t = 1 - u - v; isect->uv.u = t * uv0.u + u * uv1.u + v * uv2.u; isect->uv.v = t * uv0.v + u * uv1.v + v * uv2.v; TriComputeDerivatives( P0, P1, P2, uv0, uv1, uv2, &isect->dPdu, &isect->dPdv); } else { isect->uv.u = 0; isect->uv.v = 0; isect->dPdu = Vector(0, 0, 0); isect->dPdv = Vector(0, 0, 0); } isect->P = RayPointAt(ray, t_hit); isect->object = NULL; isect->prim_id = prim_id; isect->shading_group_id = GetFaceGroupID(prim_id); isect->t_hit = t_hit; return true; } struct SubTri { SubTri(): P0(), P1(), P2(), vel0(), vel1(), vel2() {} ~SubTri() {} Vector P0, P1, P2; Vector vel0, vel1, vel2; }; static bool box_tri_intersect(const Box &box, const SubTri &tri) { const int N_STEPS = 8; const Vector step0 = tri.vel0 / N_STEPS; const Vector step1 = tri.vel1 / N_STEPS; const Vector step2 = tri.vel2 / N_STEPS; for (int i = 0; i < N_STEPS; i++) { const Vector P0 = tri.P0 + i * step0; const Vector P1 = tri.P1 + i * step1; const Vector P2 = tri.P2 + i * step2; Box segment_bounds; TriComputeBounds(P0, P1, P2, &segment_bounds); segment_bounds.AddPoint(P0 + step0); segment_bounds.AddPoint(P1 + step1); segment_bounds.AddPoint(P2 + step2); if (BoxBoxIntersect(segment_bounds, box)) { return true; } } return false; } static bool box_tri_intersect_recursive(const Box &box, const SubTri &tri, int depth); static bool box_tri_intersect_recursive(const Box &box, const SubTri &tri, int depth) { if (depth == 0) { return box_tri_intersect(box, tri); } const Vector P01 = (tri.P0 + tri.P1) / 2; const Vector P12 = (tri.P1 + tri.P2) / 2; const Vector P20 = (tri.P2 + tri.P0) / 2; const Vector vel01 = (tri.vel0 + tri.vel1) / 2; const Vector vel12 = (tri.vel1 + tri.vel2) / 2; const Vector vel20 = (tri.vel2 + tri.vel0) / 2; SubTri t; t.P0 = tri.P0; t.P1 = P01; t.P2 = P20; t.vel0 = tri.vel0; t.vel1 = vel01; t.vel2 = vel20; if (box_tri_intersect_recursive(box, t, depth - 1)) { return true; } t.P0 = P01; t.P1 = tri.P1; t.P2 = P12; t.vel0 = vel01; t.vel1 = tri.vel1; t.vel2 = vel12; if (box_tri_intersect_recursive(box, t, depth - 1)) { return true; } t.P0 = P12; t.P1 = tri.P2; t.P2 = P20; t.vel0 = vel12; t.vel1 = tri.vel2; t.vel2 = vel20; if (box_tri_intersect_recursive(box, t, depth - 1)) { return true; } t.P0 = P01; t.P1 = P12; t.P2 = P20; t.vel0 = vel01; t.vel1 = vel12; t.vel2 = vel20; if (box_tri_intersect_recursive(box, t, depth - 1)) { return true; } return false; } bool Mesh::box_intersect(Index prim_id, const Box &box) const { const int recursive_depth = 0; SubTri t; get_point_positions(*this, prim_id, t.P0, t.P1, t.P2); get_point_velocity(*this, prim_id, t.vel0, t.vel1, t.vel2); return box_tri_intersect_recursive(box, t, recursive_depth); #if 0 Vector P0, P1, P2; get_point_positions(*this, prim_id, P0, P1, P2); const Vector centroid = box.Centroid(); const Vector halfsize = .5 * box.Diagonal(); return TriBoxIntersect(P0, P1, P2, centroid, halfsize); #endif } void Mesh::get_primitive_bounds(Index prim_id, Box *bounds) const { Vector P0, P1, P2; get_point_positions(*this, prim_id, P0, P1, P2); TriComputeBounds(P0, P1, P2, bounds); if (HasPointVelocity()) { Vector velocity0, velocity1, velocity2; get_point_velocity(*this, prim_id, velocity0, velocity1, velocity2); const Vector P0_close = P0 + velocity0; const Vector P1_close = P1 + velocity1; const Vector P2_close = P2 + velocity2; bounds->AddPoint(P0_close); bounds->AddPoint(P1_close); bounds->AddPoint(P2_close); } } void Mesh::get_bounds(Box *bounds) const { *bounds = GetBounds(); } Index Mesh::get_primitive_count() const { return GetFaceCount(); } void MshGetFacePointPosition(const Mesh *mesh, int face_index, Vector *P0, Vector *P1, Vector *P2) { get_point_positions(*mesh, face_index, *P0, *P1, *P2); } void MshGetFacePointNormal(const Mesh *mesh, int face_index, Vector *N0, Vector *N1, Vector *N2) { get_point_normals(*mesh, face_index, *N0, *N1, *N2); } } // namespace xxx
[ "hiroshi@fujiyama-renderer.com" ]
hiroshi@fujiyama-renderer.com
9f38e598cccbeb5f9a4fa8900e0bafee22268568
9d816d04ea89bdb424008090dec94725c0005a06
/Src/motor_control_foc.cpp
6a82321d704682adf3257c4ef0d9c207bdc55cbf
[ "MIT", "LicenseRef-scancode-unknown-license-reference" ]
permissive
McuMirror/STM32F303_BLDCMotorControl
457fffc18f66a639d05e7feacdf41a94a0588e64
34e75019983bae31f50efeb63786a76c43e9aef7
refs/heads/master
2020-05-20T16:15:24.679873
2019-03-25T11:31:44
2019-03-25T11:31:44
185,663,106
1
0
null
2019-05-08T18:54:53
2019-05-08T18:54:53
null
UTF-8
C++
false
false
7,030
cpp
/* * motor_control_foc.cpp * * Created on: 2018/07/19 * Author: Shibasaki */ #include "motor_control_foc.hpp" void BLDCMotor::Update(void) { // Calculation of Sine and Cosine Value of the Rotor Position MyDSP::SinCos(theta_e, &sin_val, &cos_val); // a-b-c to alpha-beta Conversion FOCUtil::Clarke_Dynamic(i_a, i_b, i_c, SV_sector, &i_alpha, &i_beta); // alpha-beta to d-q Conversion FOCUtil::Park(i_alpha, i_beta, &i_d, &i_q, sin_val, cos_val); float i_d_hat_prev = i_d_hat; float i_q_hat_prev = i_q_hat; // State Observer // i_d_hat, i_q_hatは1サンプル先の予想値 //// x = (i_d i_q;d_d d_q) //// u = (v_d v_q) //// y = (i_d i_q) //// x_hat[n+1|n] = (A-LC B L) * (x_hat[n|n−1];u[n];y[n]) Eigen::Matrix<float, OBS_NUM_STATE+OBS_NUM_INPUT+OBS_NUM_OUTPUT, OBS_NUM_CHANNEL> obs_in; obs_in << i_d_hat, i_q_hat, d_d_hat, d_q_hat, v_d, v_q, i_d, i_q; Eigen::Map<Eigen::Matrix<float, OBS_NUM_STATE, OBS_NUM_CHANNEL, Eigen::RowMajor>> obs_out(obs_out_data); obs_out.noalias() = obs_mat * obs_in; constexpr float K_XC = R*T_S*L_Q/L_D*std::exp(-R*T_S/L_D)/(1-std::exp(-R*T_S/L_D)); e_d = d_d_hat + omega_e*K_XC*i_q_hat_prev; e_q = d_q_hat - omega_e*K_XC*i_d_hat_prev; // e_d = d_d_hat + omega_e*L_Q*i_q_hat_prev; // e_q = d_q_hat - omega_e*L_Q*i_d_hat_prev; e_abs = MyDSP::Hypot(e_d, e_q); // Damping Control Eigen::Vector2f hpf_e_dq_out = hpf_e_dq(Eigen::Map<Eigen::Vector2f>(e_dq)); float i_damp_d = K_DAMP * hpf_e_dq_out[0]; float i_damp_q = K_DAMP * hpf_e_dq_out[1]; // Current PI Control with Anti-Windup switch (status) { case FOC_Status::STOP: pid_i_d.Clear(); pid_i_q.Clear(); v_d = 0; v_q = 0; break; case FOC_Status::IDENTIFICATION: pid_i_d.Clear(); pid_i_q.Clear(); v_d = v_d_ref; v_q = v_q_ref; break; case FOC_Status::POSITIONING: pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d); pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q); v_d = pid_i_d((i_pos_ref-i_damp_d)-i_d_hat); v_q = pid_i_q(-i_damp_q-i_q_hat); v_d += d_d_hat; v_q += d_q_hat; break; case FOC_Status::OPERATION_FEEDFORWARD: pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d); pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q); v_d = pid_i_d((i_d_ref_ff-i_damp_d)-i_d_hat); v_q = pid_i_q((i_q_ref_ff-i_damp_q)-i_q_hat); v_d += d_d_hat; v_q += d_q_hat; break; default: pid_i_d.SetOutput(pid_i_d.GetOutput() - K_WIND*v_wind_d); pid_i_q.SetOutput(pid_i_q.GetOutput() - K_WIND*v_wind_q); v_d = pid_i_d(i_d_ref-i_d_hat); v_q = pid_i_q(i_q_ref-i_q_hat); v_d += d_d_hat; v_q += d_q_hat; break; } // Voltage Saturation v_abs = MyDSP::Hypot(v_d, v_q); float v_max = v_dc*MyDSP::by_sqrt_three_f; if (v_abs > v_max) { float v_d_tmp = v_d; float v_q_tmp = v_q; if (v_d > v_max) { v_d = v_max; v_q = 0; } else if (v_d < -v_max) { v_d = -v_max; v_q = 0; } else if(v_q > 0) { v_q = MyDSP::Sqrt(v_max*v_max - v_d*v_d); } else if(v_q < 0) { v_q = -MyDSP::Sqrt(v_max*v_max - v_d*v_d); } v_wind_d = v_d_tmp - v_d; v_wind_q = v_q_tmp - v_q; v_abs = v_max; } else { v_wind_d = 0; v_wind_q = 0; } // Error of Position Estimation theta_err = MyDSP::Atan2(-MyDSP::Sign(omega_e)*e_d, MyDSP::Sign(omega_e)*e_q); // Position Calculation and State Transition CalculatePosition(); // Calculation of Sine and Cosine Value of the Corrected Rotor Position float sin_val_v_dq, cos_val_v_dq; MyDSP::SinCos(theta_e+omega_e*0.5f*T_S*L_Q/L_D, &sin_val_v_dq, &cos_val_v_dq); // d-q to alpha-beta Conversion FOCUtil::InvPark(v_d, v_q, &v_alpha, &v_beta, sin_val_v_dq, cos_val_v_dq); // Duty Cycle Generation SV_sector = FOCUtil::SVPWM_3phase(v_alpha, v_beta, v_dc, &duty_a, &duty_b, &duty_c); // Estimation of Next Three-phase Currents float i_alpha_hat, i_beta_hat; float i_a_hat, i_b_hat, i_c_hat; FOCUtil::InvPark(i_d_hat, i_q_hat, &i_alpha_hat, &i_beta_hat, sin_val_v_dq, cos_val_v_dq); FOCUtil::InvClarke_abc(i_alpha_hat, i_beta_hat, &i_a_hat, &i_b_hat, &i_c_hat); // Dead Time Compensation float i_ripple_a, i_ripple_b, i_ripple_c; FOCUtil::CurrentRippleEstimate(duty_a, duty_b, duty_c, v_dc, F_PWM, (L_D+L_Q)/2, SV_sector, &i_ripple_a, &i_ripple_b, &i_ripple_c); // float i_dt = v_dc * 2 * C_OSS / T_DEAD; // duty_a = FOCUtil::DeadTimeCompensate_TTCM(duty_a, i_a+i_ripple_a, i_a-i_ripple_a, i_dt, F_PWM*T_DEAD); // duty_b = FOCUtil::DeadTimeCompensate_TTCM(duty_b, i_b+i_ripple_b, i_b-i_ripple_b, i_dt, F_PWM*T_DEAD); // duty_c = FOCUtil::DeadTimeCompensate_TTCM(duty_c, i_c+i_ripple_c, i_c-i_ripple_c, i_dt, F_PWM*T_DEAD); duty_a = FOCUtil::DeadTimeCompensate_3Level(duty_a, i_a_hat, i_ripple_a, F_PWM*T_DEAD); duty_b = FOCUtil::DeadTimeCompensate_3Level(duty_b, i_b_hat, i_ripple_b, F_PWM*T_DEAD); duty_c = FOCUtil::DeadTimeCompensate_3Level(duty_c, i_c_hat, i_ripple_c, F_PWM*T_DEAD); } void BLDCMotor::CalculatePosition(void) { static uint32_t pos_count = 0; switch (status) { case FOC_Status::STOP: case FOC_Status::IDENTIFICATION: alpha_e = 0; omega_e = 0; break; case FOC_Status::POSITIONING: alpha_e = 0; omega_e = 0; if (pos_count++ > 1000) { pos_count = 0; status = FOC_Status::OPERATION_FEEDFORWARD; } break; case FOC_Status::OPERATION_FEEDFORWARD: if (omega_e > OMEGA_TH_H || omega_e < -OMEGA_TH_H) { pid_theta_est.Clear(); status = FOC_Status::OPERATION_SENSORLESS; } else { alpha_e = alpha_ref; omega_e += alpha_e * T_S; } break; case FOC_Status::OPERATION_SENSORED_HALL: // alpha is externally calculated // omega and theta will be externally overwrited if (omega_e > OMEGA_TH_H || omega_e < -OMEGA_TH_H) { pid_theta_est.Clear(); status = FOC_Status::OPERATION_SENSORLESS; } break; case FOC_Status::OPERATION_SENSORED_ENC: // alpha is not used // omega is externally calculated // theta will be externally overwrited break; case FOC_Status::OPERATION_SENSORLESS: alpha_e = pid_theta_est(theta_err); omega_e += alpha_e * T_S; if (e_abs < E_TH_L) { status = FOC_Status::OPERATION_FEEDFORWARD; } break; default: status = FOC_Status::FAULT; break; } theta_e += omega_e * T_S; if (theta_e >= MyDSP::pi_f) { theta_e -= 2*MyDSP::pi_f; } else if (theta_e < -MyDSP::pi_f) { theta_e += 2*MyDSP::pi_f; } }
[ "48833768+MSiv15@users.noreply.github.com" ]
48833768+MSiv15@users.noreply.github.com
92ac97eee0f993faddb31b0b4ad83e55e7c82cf0
e51d009c6c6a1633c2c11ea4e89f289ea294ec7e
/xr2-dsgn/sources/xray/editor/base/sources/editor_creator.cpp
a8bba7087ad8331121f5d4d34321e1a57a3a99a9
[]
no_license
avmal0-Cor/xr2-dsgn
a0c726a4d54a2ac8147a36549bc79620fead0090
14e9203ee26be7a3cb5ca5da7056ecb53c558c72
refs/heads/master
2023-07-03T02:05:00.566892
2021-08-06T03:10:53
2021-08-06T03:10:53
389,939,196
3
2
null
null
null
null
UTF-8
C++
false
false
478
cpp
//////////////////////////////////////////////////////////////////////////// // Created : 05.08.2010 // Author : Sergey Pryshchepa // Copyright (C) GSC Game World - 2010 //////////////////////////////////////////////////////////////////////////// #include "pch.h" #include "editor_creator.h" using xray::editor_base::editor_creator; void editor_creator::set_memory_allocator(xray::editor_base::allocator_type* allocator) { ASSERT(!g_allocator); g_allocator = allocator; }
[ "youalexandrov@icloud.com" ]
youalexandrov@icloud.com
480e3ce309fba42985492505a8cd60a43bfab314
cf8ddfc720bf6451c4ef4fa01684327431db1919
/SDK/ARKSurvivalEvolved_FeedingTroughBaseBP_parameters.hpp
c28ebebb3b696f52702c24fa7a5fd28b0dd56a17
[ "MIT" ]
permissive
git-Charlie/ARK-SDK
75337684b11e7b9f668da1f15e8054052a3b600f
c38ca9925309516b2093ad8c3a70ed9489e1d573
refs/heads/master
2023-06-20T06:30:33.550123
2021-07-11T13:41:45
2021-07-11T13:41:45
null
0
0
null
null
null
null
UTF-8
C++
false
false
3,715
hpp
#pragma once // ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_FeedingTroughBaseBP_classes.hpp" namespace sdk { //--------------------------------------------------------------------------- //Parameters //--------------------------------------------------------------------------- // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.Check Team and Set Visual Visibility struct AFeedingTroughBaseBP_C_Check_Team_and_Set_Visual_Visibility_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPServerHandleNetExecCommand struct AFeedingTroughBaseBP_C_BPServerHandleNetExecCommand_Params { class APlayerController** FromPC; // (Parm, ZeroConstructor, IsPlainOldData) struct FName* CommandName; // (Parm, ZeroConstructor, IsPlainOldData) struct FBPNetExecParams ExecParams; // (Parm, OutParm, ReferenceParm) bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.OnRep_ShowArea struct AFeedingTroughBaseBP_C_OnRep_ShowArea_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPClientDoMultiUse struct AFeedingTroughBaseBP_C_BPClientDoMultiUse_Params { class APlayerController** ForPC; // (Parm, ZeroConstructor, IsPlainOldData) int* ClientUseIndex; // (Parm, ZeroConstructor, IsPlainOldData) }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.BPGetMultiUseEntries struct AFeedingTroughBaseBP_C_BPGetMultiUseEntries_Params { class APlayerController** ForPC; // (Parm, ZeroConstructor, IsPlainOldData) TArray<struct FMultiUseEntry> MultiUseEntries; // (Parm, OutParm, ZeroConstructor, ReferenceParm) TArray<struct FMultiUseEntry> ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm) }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ReceiveBeginPlay struct AFeedingTroughBaseBP_C_ReceiveBeginPlay_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ThrottledTick struct AFeedingTroughBaseBP_C_ThrottledTick_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.UserConstructionScript struct AFeedingTroughBaseBP_C_UserConstructionScript_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ServerRequest_ToggleShowarea struct AFeedingTroughBaseBP_C_ServerRequest_ToggleShowarea_Params { }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ServerRequest_TurnOffAllShowarea struct AFeedingTroughBaseBP_C_ServerRequest_TurnOffAllShowarea_Params { class APlayerController* PC; // (Parm, ZeroConstructor, IsPlainOldData) }; // Function FeedingTroughBaseBP.FeedingTroughBaseBP_C.ExecuteUbergraph_FeedingTroughBaseBP struct AFeedingTroughBaseBP_C_ExecuteUbergraph_FeedingTroughBaseBP_Params { int EntryPoint; // (Parm, ZeroConstructor, IsPlainOldData) }; } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "sergey.2bite@gmail.com" ]
sergey.2bite@gmail.com
0b5307fe53be749330c478281f8703c3455392de
51a0da6db94fbe7fb0d4e8c0d3713f25e24d52fd
/benchmarks/nearestNeighbors/octTreeConcurrent/flock/lf_types.h
d1e23a4463a9c90bba628e3d7771b1d2b7de2626
[ "MIT" ]
permissive
cmuparlay/pbbsbench
633d61448cc935bea00d3dadb68fc46efac95eeb
ecbd6ea5ebfaafc7af2082d8d821b78e28543bf9
refs/heads/master
2023-07-19T19:45:18.849181
2023-07-12T17:05:45
2023-07-12T17:05:45
167,005,662
64
19
MIT
2023-04-07T23:55:09
2019-01-22T14:12:47
C++
UTF-8
C++
false
false
9,440
h
#include <atomic> #include "tagged.h" #include "lf_log.h" #pragma once namespace flck { template <typename V> struct atomic { private: using IT = size_t; using TV = internal::tagged<V>; IT get_val(internal::Log &p) { return p.commit_value(v.load()).first; } public: std::atomic<IT> v; static_assert(sizeof(V) <= 4 || std::is_pointer<V>::value, "Type for mutable must be a pointer or at most 4 bytes"); // not much to it. heavy lifting done in TV atomic(V vv) : v(TV::init(vv)) {} atomic() : v(TV::init(0)) {} void init(V vv) {v = TV::init(vv);} V load() {return TV::value(get_val(internal::lg));} V load_ni() {return TV::value(v.load());} V read() {return TV::value(v.load());} V read_snapshot() {return TV::value(v.load());} void store(V vv) {TV::cas(v, get_val(internal::lg), vv);} bool cas(V old_v, V new_v) { // not safe inside locks assert(internal::lg.is_empty()); return cas_ni(old_v, new_v); } bool cas_ni(V old_v, V new_v) { IT old_t = v.load(); return (TV::value(old_t) == old_v && TV::cas(v, old_t, new_v, true));} void cam(V oldv, V newv) { IT old_t = get_val(internal::lg); if (TV::value(old_t) == oldv) TV::cas(v, old_t, newv);} V operator=(V b) {store(b); return b; } // compatibility with multiversioning void validate() {} // operator V() { return load(); } // implicit conversion }; template <typename V> struct atomic_double { private: struct alignas(16) TV {size_t count; V val; }; TV v; void cam(TV oldv, TV newv) { __int128 oldvi = *((__int128*) &oldv); __int128 newvi = *((__int128*) &newv); __sync_bool_compare_and_swap((__int128*) this, oldvi, newvi); } public: static_assert(sizeof(V) <= 8, "Type for mutable_double must be at most 8 bytes"); atomic_double(V vv) : v({1, vv}) {} atomic_double() : v({1, 0}) {} V load() {return internal::lg.commit_value_safe(v.val).first;} V read() {return v.val;} void init(V vv) {v.val = vv;} void store(V newv) { size_t cnt = internal::lg.commit_value(v.count).first; #ifdef NoSkip // used to test performance without optimization cam({cnt, v.val}, {cnt+1, newv}); #else // skip if done for efficiency skip_if_done_no_log([&] { cam({cnt, v.val}, {cnt+1, newv});}); #endif } V operator=(V b) { store(b); return b; } }; template <typename V> struct atomic_aba_free { private: constexpr static unsigned long set_bit= (1ul << 63); public: std::atomic<V> v; atomic_aba_free(V initial) : v(initial) {} atomic_aba_free() {} V load() { // set then mask high bit to ensure not zero size_t x = internal::lg.commit_value((size_t) v.load() | set_bit).first; return (V) (x & ~set_bit); } void init(V vv) { v = vv; } void store(V vv) { V old_v = load(); v.compare_exchange_strong(old_v, vv); } void cam(V expected, V new_v) { V old_v = load(); if (expected == old_v) v.compare_exchange_strong(old_v, new_v); } V operator=(V b) { store(b); return b; } }; template <typename V> struct atomic_write_once { private: constexpr static unsigned long set_bit= (1ul << 63); public: std::atomic<V> v; atomic_write_once(V initial) : v(initial) {} atomic_write_once() {} V load() { // set then mask high bit to ensure not zero size_t x = internal::lg.commit_value((size_t) v.load() | set_bit).first; return (V) (x & ~set_bit); } V load_ni() {return v.load();} void init(V vv) { v = vv; } void store(V vv) { v = vv; } bool cas_ni(V exp_v, V new_v) {return v.compare_exchange_strong(exp_v, new_v);} V operator=(V b) { store(b); return b; } // inline operator V() { return load(); } // implicit conversion }; // ***************************** // Memory pool using epoch based collection and safe (idempotent) // allocation and retire in a lock. // ***************************** namespace internal { struct lock; } template <typename T, typename Pool=internal::mem_pool<T>> struct memory_pool { Pool pool; void reserve(size_t n) { pool.reserve(n);} void clear() { pool.clear(); } void stats() { pool.stats();} void shuffle(size_t n) { pool.shuffle(n);} void acquire(T* p) { pool.acquire(p);} bool* retire(T* p) { assert(p != nullptr); if (!internal::helping) return internal::with_empty_log([&] {return pool.retire(p);}); else return nullptr; //auto x = internal::lg.commit_value_safe(p); //if (x.second) // only retire if first try // internal::with_empty_log([&] {pool.retire(p);}); } bool* retire_ni(T* p) { assert(p != nullptr); return internal::with_empty_log([&] {return pool.retire(p);}); } void destruct(T* p) { assert(p != nullptr); auto x = internal::lg.commit_value_safe(p); if (x.second) // only retire if first try internal::with_empty_log([&] {pool.destruct(p);}); } void destruct_ni(T* p) { assert(p != nullptr); internal::with_empty_log([&] {pool.destruct(p);}); } template <typename F, typename ... Args> // f is a function that initializes a new object before it is shared T* new_init(F f, Args... args) { //run f without logging (i.e. an empty log) T* newv = internal::with_log(internal::Log(), [&] { T* x = pool.new_obj(args...); f(x); return x;}); auto r = internal::lg.commit_value(newv); if (!r.second) // destruct if already initialized internal::with_empty_log([&] {pool.destruct(newv);}); return r.first; } // Idempotent allocation template <typename ... Args> T* new_obj(Args ...args) { return new_obj_fl(args...).first; } protected: friend class internal::lock; // The following protected routines are only used internally // in the lock code (not accessible to the user) // Returns a pointer to the new object and a possible pointer // to a location in the log containing the pointer. // The location is null if this was not the first among thunks // to allocate the object. // The returned pointer can be one of done_true or done_false // if the object is already retired using retire_acquired. template <typename ... Args> std::pair<T*,internal::log_entry*> new_obj_acquired(Args... args) { auto [ptr,fl] = new_obj_fl(args...); if (internal::lg.is_empty()) return std::pair(ptr, nullptr); internal::log_entry* l = internal::lg.current_entry(); if (!fl && !is_done(ptr)) { pool.acquire(ptr); return std::make_pair((T*) l->load(), nullptr); } else return std::make_pair(ptr, fl ? l : nullptr); } // le must be a value returned as the second return value of new_obj_acquired. // It will be either be null or a pointer to a log entry containing p. // If non-null then it clears p from the log by replacing it with // the result (true or false) so that p can be safely reclaimed. // It then retires p. // It is important that only one of the helping thunks is passed an le that // is not null, otherwise could be retired multiple times template<typename TT> void retire_acquired_result(T* p, internal::log_entry* le, std::optional<TT> result) { if (internal::lg.is_empty()) pool.retire(p); else if (le != nullptr) { *le = tag_result(result); internal::with_empty_log([&] { pool.retire(p);}); } } bool is_done(T* p) {return is_done_flag(p);} template <typename RT> std::optional<RT> done_val_result(T* p) { auto r = extract_result(p); if (r.has_value()) return (RT) r.value(); else return {}; } private: bool done_val(T* p) {return extract_bool(p);} // this version also returns a flag to specify whether actually allocated // vs., having been allocated by another instance of a thunk template <typename ... Args> std::pair<T*,bool> new_obj_fl(Args... args) { // TODO: helpers might do lots of allocates and frees, // can potentially optimize by checking if a log value has already been committed. T* newv = internal::with_log(internal::Log(), [&] {return pool.new_obj(args...);}); auto r = internal::lg.commit_value(newv); // if already allocated return back to pool if (!r.second) { internal::with_empty_log([&] {pool.destruct(newv);}); } return r; } // the following tags a long entry with the return value of a thunk // 1 at the 48th bit is true, 2 at the 48th bit is false bool is_done_flag(T* p) { return (((size_t) p) >> 48) > 0; } void* tag_bool(bool result) { return (void*) (result ? (1ul << 48) : (2ul << 48)); } bool extract_bool(T* p) { return (((size_t) p) >> 48) == 1ul; } // a poor mans "optional". The flag at the 48th bit indicates presence, // and the lower 48 bits are the value if present. template<typename TT> void* tag_result(std::optional<TT> result) { if(!result.has_value()) return (void*) (2ul << 48); else return (void*) ((1ul << 48) | (size_t) result.value()); } std::optional<size_t> extract_result(T* p) { if (extract_bool(p)) return ((size_t) p) & ((1ul << 48) - 1); return {}; } }; template<typename V> V commit(V v) {return internal::lg.commit_value(v).first;} template <typename F> bool skip_if_done(F f) { return internal::skip_if_done(f); } template <typename F> bool skip_if_done_no_log(F f) { return internal::skip_if_done_no_log(f); } template <typename F> void non_idempotent(F f) { internal::with_empty_log(f); } } // namespace flck
[ "magdalen@aware.aladdin.cs.cmu.edu" ]
magdalen@aware.aladdin.cs.cmu.edu
f264a6edc16b6c8897757c06e8e6cf670bd265ce
9120a9b17d00f41e5af26b66f5b667c02d870df0
/SOURCE/ocf/oledoc.cpp
3a10279840a8591499edca7917dd715b27e99577
[ "Zlib" ]
permissive
pierrebestwork/owl
dd77c095abb214a107f17686e6143907bf809930
807aa5ab4df9ee9faa35ba6df9a342a62b9bac76
refs/heads/master
2023-02-14T02:12:38.490348
2020-03-16T16:41:49
2020-03-16T16:41:49
326,663,704
0
0
null
null
null
null
UTF-8
C++
false
false
6,538
cpp
//---------------------------------------------------------------------------- // ObjectComponents // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved // //$Revision: 1.13 $ //$Author: jogybl $ //$Date: 2007-09-15 11:43:48 $ // // Implementation of TOleDocument. Doc/View document that supports OLE 2 // using OCF TOcDocument //---------------------------------------------------------------------------- #define INC_OLE2 #include <ocf/pch.h> #if !defined(OWL_DOCMANAG_H) # include <owl/docmanag.h> #endif #if !defined(OCF_OLEMDIFR_H) # include <ocf/olemdifr.h> #endif #if !defined(OCF_OCDOC_H) # include <ocf/ocdoc.h> #endif #if !defined(OCF_OCAPP_H) # include <ocf/ocapp.h> #endif #if !defined(OCF_OLEDOC_H) # include <ocf/oledoc.h> #endif #if !defined(OCF_OLEFRAME_H) # include <ocf/oleframe.h> #endif #if !defined(OCF_OLEVIEW_H) # include <ocf/oleview.h> #endif __OCF_BEGIN_NAMESPACE __OWL_USING_NAMESPACE OWL_DIAGINFO; // // // TOleDocument::TOleDocument(TDocument* parent) : TStorageDocument(parent), OcDoc(0), Closing(false) { } // // For an OLE container the compound file remains open // until the application shuts down // TOleDocument::~TOleDocument() { delete OcDoc; } // // Prepare document shutdown // bool TOleDocument::CanClose() { // // if it's an open edit dll stop the closing process TView* curView = GetViewList(); while (curView) { // get the ole view TOleView* oleView = TYPESAFE_DOWNCAST(curView, TOleView); if (oleView && oleView->IsOpenEditing() && !GetOcApp()->IsOptionSet(amExeMode)) { TOleFrame* olefr = TYPESAFE_DOWNCAST(oleView->GetApplication()->GetMainWindow(), TOleFrame); CHECK(olefr); olefr->ShowWindow(SW_HIDE); oleView->OleShutDown(); return false; // don't close } curView = curView->GetNextView(); } // Just say yes if we are already in the closing process, or are embedded, // or have multiple views open // if (Closing || IsEmbedded()) return true; return TDocument::CanClose(); } // // Shut down the TOleView's // void TOleDocument::OleViewClose() { TView* curView = GetViewList(); while (curView) { TOleView* oleView = TYPESAFE_DOWNCAST(curView, TOleView); if (oleView) oleView->OleShutDown(); curView = curView->GetNextView(); } } // // Close the compound file // bool TOleDocument::Close() { // Make sure that TOleView's are closed first // OleViewClose(); OcDoc->Close(); return TStorageDocument::Close(); } // // Close the OLE document when the server is done with the // given IStorage from its container // bool TOleDocument::ReleaseDoc() { PRECONDITION(OcDoc); TStorageDocument::ReleaseDoc(); OcDoc->SetStorage((IStorage*)0); return true; } // // Open the OLE document when the server is provided with an // IStorage from its container // bool TOleDocument::SetStorage(IStorage* stg, bool remember) { PRECONDITION(OcDoc); // If a storage is provided, then we are now using container's IStorage // if (stg) Embedded = true; OcDoc->SetStorage(stg, remember); TStorageDocument::SetStorage(stg, remember); return true; } // // Restores the original root IStorage before the save operation // bool TOleDocument::RestoreStorage() { PRECONDITION(OcDoc); OcDoc->RestoreStorage(); TStorageDocument::RestoreStorage(); return true; } // // Set the initial open mode // void TOleDocument::PreOpen() { SetOpenMode(ofReadWrite | ofTransacted); } // // Open the compound file so that we have an IStorage for use // with embedded objects. A document partner is created // to handle OLE related stuff. // bool TOleDocument::InitDoc() { if (IsOpen()) return true; // compound file already open // Give user a chance to set a different open mode // PreOpen(); if (GetDocPath()) SetOpenMode(GetOpenMode() | (ofNoCreate)); else SetOpenMode(GetOpenMode() | ofTemporary); if (TStorageDocument::Open(GetOpenMode(), GetDocPath())) { if (OcDoc) { // use the existing ocdoc OcDoc->SetStorage(StorageI); } else if (GetOcApp()) { OcDoc = new TOcDocument(*GetOcApp(), GetDocPath(), StorageI); } return true; } return false; } // // Save the embedded objects, if any // bool TOleDocument::Commit(bool force) { if (Write()) return TStorageDocument::Commit(force); else return false; } // // Load the embedded objects, if any // bool TOleDocument::Open(int, LPCTSTR path) { if (path) SetDocPath(path); return Read(); } // // Check if current document path is the same as the // OcDoc's. // bool TOleDocument::PathChanged() { return _tcsicmp(OcDoc->GetName().c_str(), GetDocPath()) != 0; } // // Save embed objects to the compound file // bool TOleDocument::Write() { // Switch to new storage if path has changed & it is permanent ("SaveAs") // IStorage* newStorageI; bool saveAs = PathChanged() && !OrgStorageI; // also is 'remember' bool sameAsLoad = !PathChanged() && !OrgStorageI; // use current storage if (saveAs) { // Update link monikers // owl_string newName(GetDocPath()); OcDoc->SetName(newName); if (IsEmbedded()) newStorageI = StorageI; // Use the one assigned by container else newStorageI = GetNewStorage(); } else newStorageI = StorageI; return newStorageI ? OcDoc->SaveParts(newStorageI, sameAsLoad, saveAs) : false; } // // Load embed objects from the compound file // bool TOleDocument::Read() { // Load the embedded objects, if any // return OcDoc->LoadParts(); } // // Revert to last saved compound file // bool TOleDocument::Revert(bool clear) { if (!StorageI) return true; // return OK if storage already released if (!TDocument::Revert(clear) || !ReleaseDoc()) return false; if (!clear) { InitDoc(); Open(0); } SetDirty(false); return true; } // // Get OWL application partner // TOcApp* TOleDocument::GetOcApp() { TOleFrame* olefr = TYPESAFE_DOWNCAST(GetDocManager().GetApplication()->GetMainWindow(), TOleFrame); return olefr->GetOcApp(); } __OCF_END_NAMESPACE //==============================================================================
[ "Chris.Driver@taxsystems.com" ]
Chris.Driver@taxsystems.com
111432182e861e9eb32c28e4bc858c46736ec8a4
44e52ef313820c9700aaf2267ecbec749c315227
/FarmacieC++/Pastile.h
27e1b2dce6b9c48b2154b25cf05d86147ef36c51
[]
no_license
Hornshade/ProiectPOO
cc60e8da4b742e21fb0a4033f0c368f8618f35cc
49bac14b1e183eebceefbcf26bc63d4e629fc9cb
refs/heads/master
2022-10-01T03:21:48.212773
2020-06-08T10:23:40
2020-06-08T10:23:40
270,623,914
0
0
null
null
null
null
UTF-8
C++
false
false
205
h
#pragma once #include "Medicament.h" class Pastile : public Medicament { public: Pastile(Medicament med,int numarpastile); string AfisareString(); int GetNrPastile(); protected: int numarPastile; };
[ "sabin.mihai@yahoo.com" ]
sabin.mihai@yahoo.com
cefa67cacc12fdc2d3f8351faa87397337c7cff7
fa21a16149fec2b2a04647d69674f5b8a228bf15
/RenderCore/Assets/ModelRunTime.cpp
515d2bc932fe66928ec76110574568216d955ba1
[ "MIT" ]
permissive
yorung/XLE
3581cbe3ed455b8a27e97ed615e1f6f96d42ae85
083ce4c9d3fe32002ff5168e571cada2715bece4
refs/heads/master
2020-03-29T10:07:35.485095
2015-08-29T07:51:02
2015-08-29T07:51:02
30,400,035
1
0
null
null
null
null
UTF-8
C++
false
false
80,163
cpp
// Copyright 2015 XLGAMES Inc. // // Distributed under the MIT License (See // accompanying file "LICENSE" or the website // http://www.opensource.org/licenses/mit-license.php) #include "ModelRunTime.h" #include "ModelRunTimeInternal.h" #include "DelayedDrawCall.h" #include "MaterialScaffold.h" #include "TransformationCommands.h" #include "AssetUtils.h" // maybe only needed for chunk ids #include "Material.h" #include "RawAnimationCurve.h" #include "SharedStateSet.h" #include "DeferredShaderResource.h" #include "../Techniques/Techniques.h" #include "../Techniques/ResourceBox.h" #include "../Techniques/ParsingContext.h" #include "../Techniques/CommonResources.h" #include "../Techniques/PredefinedCBLayout.h" #include "../Metal/Buffer.h" #include "../Metal/State.h" #include "../Metal/DeviceContext.h" #include "../Metal/DeviceContextImpl.h" #include "../Resource.h" #include "../RenderUtils.h" #include "../../Assets/AssetUtils.h" #include "../../Assets/BlockSerializer.h" #include "../../Assets/ChunkFile.h" #include "../../Assets/IntermediateAssets.h" #include "../../Core/Exceptions.h" #include "../../Utility/PtrUtils.h" #include "../../Utility/Streams/FileUtils.h" #include "../../Utility/IteratorUtils.h" #include "../../Utility/StringFormat.h" #include "../../Math/Transformations.h" #include "../../ConsoleRig/Console.h" #include <string> #pragma warning(disable:4189) namespace RenderCore { namespace Assets { using ::Assets::ResChar; /// <summary>Internal namespace with utilities for constructing models</summary> /// These functions are normally used within the constructor of ModelRenderer namespace ModelConstruction { static const std::string DefaultShader = "illum"; static size_t InsertOrCombine(std::vector<std::vector<uint8>>& dest, std::vector<uint8>&& compare) { assert(compare.size()); for (auto i = dest.cbegin(); i!=dest.cend(); ++i) { if (i->size() == compare.size() && (XlCompareMemory(AsPointer(i->begin()), AsPointer(compare.begin()), i->size()) == 0)) { return std::distance(dest.cbegin(), i); } } dest.push_back(std::forward<std::vector<uint8>>(compare)); return dest.size()-1; } struct SubMatResources { unsigned _shaderName; unsigned _matParams; unsigned _constantBuffer; unsigned _texturesIndex; unsigned _renderStateSet; DelayStep _delayStep; }; static const ModelCommandStream::GeoCall& GetGeoCall(const ModelScaffold& scaffold, unsigned geoCallIndex) { // get the "RawGeometry" object in the given scaffold for the give // geocall index. This will query both unskinned and skinned raw calls auto& cmdStream = scaffold.CommandStream(); auto geoCallCount = cmdStream.GetGeoCallCount(); return (geoCallIndex < geoCallCount) ? cmdStream.GetGeoCall(geoCallIndex) : cmdStream.GetSkinCall(geoCallIndex - geoCallCount); } static const RawGeometry& GetGeo(const ModelScaffold& scaffold, unsigned geoCallIndex) { // get the "RawGeometry" object in the given scaffold for the give // geocall index. This will query both unskinned and skinned raw calls auto& meshData = scaffold.ImmutableData(); auto geoCallCount = scaffold.CommandStream().GetGeoCallCount(); auto& geoCall = GetGeoCall(scaffold, geoCallIndex); return (geoCallIndex < geoCallCount) ? meshData._geos[geoCall._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoCall._geoId]; } static unsigned GetDrawCallCount(const ModelScaffold& scaffold, unsigned geoCallIndex) { return (unsigned)GetGeo(scaffold, geoCallIndex)._drawCallsCount; } static MaterialGuid ScaffoldMaterialIndex(const ModelScaffold& scaffold, unsigned geoCallIndex, unsigned drawCallIndex) { auto& meshData = scaffold.ImmutableData(); auto geoCallCount = scaffold.CommandStream().GetGeoCallCount(); auto& geoCall = GetGeoCall(scaffold, geoCallIndex); auto& geo = (geoCallIndex < geoCallCount) ? meshData._geos[geoCall._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoCall._geoId]; unsigned subMatI = geo._drawCalls[drawCallIndex]._subMaterialIndex; // the "sub material index" in the draw call is an index // into the array in the geo call if (subMatI < geoCall._materialCount) { return geoCall._materialGuids[subMatI]; } return ~unsigned(0x0); } template <typename T> static bool AtLeastOneValidDrawCall(const RawGeometry& geo, const ModelScaffold& scaffold, unsigned geoCallIndex, std::vector<std::pair<MaterialGuid, T>>& subMatResources) { // look for at least one valid draw call in this geo instance // a valid draw call should have got shader and material information bound bool atLeastOneValidDrawCall = false; for (unsigned di=0; di<geo._drawCallsCount; ++di) { auto& d = geo._drawCalls[di]; if (d._indexCount) { auto subMatIndex = ScaffoldMaterialIndex(scaffold, geoCallIndex, di); auto snm = LowerBound(subMatResources, subMatIndex); if (snm != subMatResources.cend() && snm->first == subMatIndex) { return true; } } } return false; // didn't find any draw calls with good material information. This whole geo object can be ignored. } static void LoadBlock(BasicFile& file, uint8 destination[], size_t fileOffset, size_t readSize) { file.Seek(fileOffset, SEEK_SET); file.Read(destination, 1, readSize); } static bool HasElement(const GeoInputAssembly& ia, const char name[]) { auto end = &ia._elements[ia._elementCount]; return std::find_if( ia._elements, end, [=](const VertexElement& ele) { return !XlCompareString(ele._semantic, name); }) != end; } #if defined(_DEBUG) static std::string MakeDescription(const ParameterBox& paramBox) { std::vector<std::pair<const utf8*, std::string>> defines; BuildStringTable(defines, paramBox); std::stringstream dst; for (auto i=defines.cbegin(); i!=defines.cend(); ++i) { if (i != defines.cbegin()) { dst << "; "; } dst << i->first << " = " << i->second; } return dst.str(); } class ParamBoxDescriptions { public: void Add(unsigned index, const ParameterBox& box) { auto existing = LowerBound(_descriptions, index); if (existing == _descriptions.end() || existing->first != index) { _descriptions.insert(existing, std::make_pair(index, MakeDescription(box))); } } std::vector<std::pair<unsigned,std::string>> _descriptions; }; #else class ParamBoxDescriptions { public: void Add(unsigned index, const ParameterBox& box) {} }; #endif static unsigned BuildGeoParamBox( const GeoInputAssembly& ia, SharedStateSet& sharedStateSet, ModelConstruction::ParamBoxDescriptions& paramBoxDesc, bool normalFromSkinning) { // Build a parameter box for this geometry configuration. The input assembly ParameterBox geoParameters; if (HasElement(ia, "TEXCOORD")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_TEXCOORD", 1); } if (HasElement(ia, "COLOR")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_COLOUR", 1); } if (HasElement(ia, "NORMAL") || normalFromSkinning) { geoParameters.SetParameter((const utf8*)"GEO_HAS_NORMAL", 1); } if (HasElement(ia, "TEXTANGENT")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_TANGENT_FRAME", 1); } if (HasElement(ia, "TEXBITANGENT")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_BITANGENT", 1); } if (HasElement(ia, "BONEINDICES") && HasElement(ia, "BONEWEIGHTS")) { geoParameters.SetParameter((const utf8*)"GEO_HAS_SKIN_WEIGHTS", 1); } auto result = sharedStateSet.InsertParameterBox(geoParameters); paramBoxDesc.Add(result, geoParameters); return result; } static const auto DefaultNormalsTextureBindingHash = ParameterBox::MakeParameterNameHash("NormalsTexture"); static std::vector<std::pair<MaterialGuid, SubMatResources>> BuildMaterialResources( const ModelScaffold& scaffold, const MaterialScaffold& matScaffold, SharedStateSet& sharedStateSet, unsigned levelOfDetail, std::vector<uint64>& textureBindPoints, std::vector<std::vector<uint8>>& prescientMaterialConstantBuffers, ParamBoxDescriptions& paramBoxDesc, const Techniques::PredefinedCBLayout& cbLayout, const ::Assets::DirectorySearchRules* searchRules) { std::vector<std::pair<MaterialGuid, SubMatResources>> materialResources; auto& cmdStream = scaffold.CommandStream(); auto& meshData = scaffold.ImmutableData(); auto geoCallCount = cmdStream.GetGeoCallCount(); auto skinCallCount = cmdStream.GetSkinCallCount(); for (unsigned gi=0; gi<geoCallCount + skinCallCount; ++gi) { auto& geoInst = (gi < geoCallCount) ? cmdStream.GetGeoCall(gi) : cmdStream.GetSkinCall(gi - geoCallCount); if (geoInst._levelOfDetail != levelOfDetail) { continue; } // Lookup the mesh geometry and material information from their respective inputs. auto& geo = (gi < geoCallCount) ? meshData._geos[geoInst._geoId] : (RawGeometry&)meshData._boundSkinnedControllers[geoInst._geoId]; for (unsigned di=0; di<geo._drawCallsCount; ++di) { auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, gi, di); auto existing = LowerBound(materialResources, scaffoldMatIndex); if (existing == materialResources.cend() || existing->first != scaffoldMatIndex) { materialResources.insert(existing, std::make_pair(scaffoldMatIndex, SubMatResources())); } } } // fill in the details for all of the material references we found for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) { std::string shaderName = DefaultShader; i->second._shaderName = sharedStateSet.InsertShaderName(shaderName); i->second._texturesIndex = (unsigned)std::distance(materialResources.begin(), i); } // build material constants for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) { auto* matData = matScaffold.GetMaterial(i->first); auto cbData = matData ? cbLayout.BuildCBDataAsVector(matData->_constants) : std::vector<uint8>(cbLayout._cbSize, uint8(0)); i->second._constantBuffer = (unsigned)InsertOrCombine( prescientMaterialConstantBuffers, std::move(cbData)); } // configure the texture bind points array & material parameters box for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) { ParameterBox materialParamBox; RenderStateSet stateSet; // we need to create a list of all of the texture bind points that are referenced // by all of the materials used here. They will end up in sorted order auto* matData = matScaffold.GetMaterial(i->first); if (matData) { const auto& materialScaffoldData = i->first; materialParamBox = matData->_matParams; stateSet = matData->_stateSet; for (auto param = matData->_bindings.Begin(); !param.IsEnd(); ++param) { materialParamBox.SetParameter( (const utf8*)(StringMeld<64, utf8>() << "RES_HAS_" << param.Name()), 1); auto bindNameHash = Hash64((const char*)param.Name()); auto q = std::lower_bound(textureBindPoints.begin(), textureBindPoints.end(), bindNameHash); if (q != textureBindPoints.end() && *q == bindNameHash) { continue; } textureBindPoints.insert(q, bindNameHash); } auto boundNormalMapName = matData->_bindings.GetString<::Assets::ResChar>(DefaultNormalsTextureBindingHash); if (!boundNormalMapName.empty()) { // We need to decide whether the normal map is "DXT" // format or not. This information isn't in the material // itself; we actually need to look at the texture file // to see what format it is. Unfortunately that means // opening the texture file to read it's header. However // we can accelerate it a bit by caching the result bool isDxtNormalMap = false; if (searchRules) { ::Assets::ResChar resolvedPath[MaxPath]; searchRules->ResolveFile(resolvedPath, dimof(resolvedPath), boundNormalMapName.c_str()); isDxtNormalMap = IsDXTNormalMap(resolvedPath); } else isDxtNormalMap = IsDXTNormalMap(boundNormalMapName); materialParamBox.SetParameter((const utf8*)"RES_HAS_NormalsTexture_DXT", isDxtNormalMap); } } i->second._matParams = sharedStateSet.InsertParameterBox(materialParamBox); i->second._renderStateSet = sharedStateSet.InsertRenderStateSet(stateSet); i->second._delayStep = (stateSet._forwardBlendOp == Metal::BlendOp::NoBlending) ? DelayStep::OpaqueRender : DelayStep::PostDeferred; paramBoxDesc.Add(i->second._matParams, materialParamBox); } return materialResources; } std::vector<const DeferredShaderResource*> BuildBoundTextures( const ModelScaffold& scaffold, const MaterialScaffold& matScaffold, const ::Assets::DirectorySearchRules* searchRules, const std::vector<std::pair<MaterialGuid, SubMatResources>>& materialResources, const std::vector<uint64>& textureBindPoints, unsigned textureSetCount, std::vector<::Assets::rstring>& boundTextureNames) { auto texturesPerMaterial = textureBindPoints.size(); std::vector<const DeferredShaderResource*> boundTextures; boundTextures.resize(textureSetCount * texturesPerMaterial, nullptr); DEBUG_ONLY(boundTextureNames.resize(textureSetCount * texturesPerMaterial)); for (auto i=materialResources.begin(); i!=materialResources.end(); ++i) { unsigned textureSetIndex = i->second._texturesIndex; auto* matData = matScaffold.GetMaterial(i->first); if (!matData) { continue; } for (auto param=matData->_bindings.Begin(); !param.IsEnd(); ++param) { auto bindNameHash = Hash64((const char*)param.Name()); auto i = std::find(textureBindPoints.cbegin(), textureBindPoints.cend(), bindNameHash); assert(i!=textureBindPoints.cend() && *i == bindNameHash); auto index = std::distance(textureBindPoints.cbegin(), i); auto resourceName = matData->_bindings.GetString<::Assets::ResChar>(param.HashName()); if (resourceName.empty()) continue; TRY { // note -- Ideally we want to do this filename resolve in a background thread // however, it doesn't work well with our resources system. Because we're // expecting to create the DeferredShaderResource from a definitive file // name, something that can be matched against other (already loaded) resources. // So we need something different here... Something that can resolve a filename // in the background, and then return a shareable resource afterwards auto dsti = textureSetIndex*texturesPerMaterial + index; if (searchRules) { ResChar resolvedPath[MaxPath]; searchRules->ResolveFile(resolvedPath, dimof(resolvedPath), resourceName.c_str()); boundTextures[dsti] = &::Assets::GetAssetDep<DeferredShaderResource>(resolvedPath); DEBUG_ONLY(boundTextureNames[dsti] = resolvedPath); } else { boundTextures[dsti] = &::Assets::GetAssetDep<DeferredShaderResource>(resourceName.c_str()); DEBUG_ONLY(boundTextureNames[dsti] = resourceName); } } CATCH (const ::Assets::Exceptions::InvalidAsset&) { LogWarning << "Warning -- shader resource (" << resourceName << ") couldn't be found"; } CATCH_END } } return std::move(boundTextures); } class BuffersUnderConstruction { public: unsigned _vbSize; unsigned _ibSize; unsigned AllocateIB(unsigned size, RenderCore::Metal::NativeFormat::Enum format) { unsigned allocation = _ibSize; // we have to align the index buffer offset correctly unsigned indexStride = (format == RenderCore::Metal::NativeFormat::R32_UINT)?4:2; unsigned rem = _ibSize % indexStride; if (rem != 0) { allocation += indexStride - rem; } _ibSize = allocation + size; return allocation; } unsigned AllocateVB(unsigned size) { unsigned result = _vbSize; _vbSize += size; return result; } BuffersUnderConstruction() : _vbSize(0), _ibSize(0) {} }; } unsigned BuildLowLevelInputAssembly( Metal::InputElementDesc dst[], unsigned dstMaxCount, const VertexElement* source, unsigned sourceCount, unsigned lowLevelSlot) { unsigned vertexElementCount = 0; for (unsigned i=0; i<sourceCount; ++i) { auto& sourceElement = source[i]; assert((vertexElementCount+1) <= dstMaxCount); if ((vertexElementCount+1) <= dstMaxCount) { // in some cases we need multiple "slots". When we have multiple slots, the vertex data // should be one after another in the vb (that is, not interleaved) dst[vertexElementCount++] = Metal::InputElementDesc( sourceElement._semantic, sourceElement._semanticIndex, Metal::NativeFormat::Enum(sourceElement._format), lowLevelSlot, sourceElement._startOffset); } } return vertexElementCount; } ModelRenderer::ModelRenderer( const ModelScaffold& scaffold, const MaterialScaffold& matScaffold, SharedStateSet& sharedStateSet, const ::Assets::DirectorySearchRules* searchRules, unsigned levelOfDetail) { using namespace ModelConstruction; const auto& cbLayout = ::Assets::GetAssetDep<Techniques::PredefinedCBLayout>("game/xleres/BasicMaterialConstants.txt"); // build the underlying objects required to render the given scaffold // (at the given level of detail) std::vector<uint64> textureBindPoints; std::vector<std::vector<uint8>> prescientMaterialConstantBuffers; ModelConstruction::ParamBoxDescriptions paramBoxDesc; auto materialResources = BuildMaterialResources( scaffold, matScaffold, sharedStateSet, levelOfDetail, textureBindPoints, prescientMaterialConstantBuffers, paramBoxDesc, cbLayout, searchRules); // one "textureset" for each sub material (though, in theory, we could // combine texture sets for materials that share the same textures unsigned textureSetCount = unsigned(materialResources.size()); auto& cmdStream = scaffold.CommandStream(); auto& meshData = scaffold.ImmutableData(); // First we need to bind each draw call to a material in our // material scaffold. Then we need to find the superset of all bound textures // This superset will be used to initialize all of the technique // input interfaces // The final resolved texture is defined by the "meshCall" object and by the // "drawCall" objects. MeshCall gives us the material id, and the draw call // gives us the sub material id. // Note that we can have cases where the same mesh is referenced multiple times by // a single "geo call". In these cases, we want the mesh data to be stored once // in the vertex buffer / index buffer but for there to be multiple sets of "draw calls" // So, we have to separate the mesh processing from the draw call processing here BuffersUnderConstruction workingBuffers; auto geoCallCount = cmdStream.GetGeoCallCount(); auto skinCallCount = cmdStream.GetSkinCallCount(); auto drawCallCount = 0; for (unsigned c=0; c<geoCallCount + skinCallCount; ++c) { drawCallCount += GetDrawCallCount(scaffold, c); } // We should calculate the size we'll need for nascentIB & nascentVB first, // so we don't have to do any reallocations //////////////////////////////////////////////////////////////////////// // u n s k i n n e d g e o // std::vector<Pimpl::Mesh> meshes; std::vector<Pimpl::MeshAndDrawCall> drawCalls; std::vector<Pimpl::DrawCallResources> drawCallRes; drawCalls.reserve(drawCallCount); drawCallRes.reserve(drawCallCount); for (unsigned gi=0; gi<geoCallCount; ++gi) { auto& geoInst = cmdStream.GetGeoCall(gi); if (geoInst._levelOfDetail != levelOfDetail) { continue; } // Check to see if this mesh has at least one valid draw call. If there // is none, we can skip it completely assert(geoInst._geoId < meshData._geoCount); auto& geo = meshData._geos[geoInst._geoId]; if (!AtLeastOneValidDrawCall(geo, scaffold, gi, materialResources)) { continue; } // if we encounter the same mesh multiple times, we don't need to store it every time auto mesh = FindIf(meshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoInst._geoId; }); if (mesh == meshes.end()) { meshes.push_back( Pimpl::BuildMesh( geoInst, geo, workingBuffers, sharedStateSet, AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size(), paramBoxDesc)); mesh = meshes.end()-1; } // setup the "Draw call" objects next for (unsigned di=0; di<geo._drawCallsCount; ++di) { auto& d = geo._drawCalls[di]; if (!d._indexCount) { continue; } auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, gi, di); auto matResI = LowerBound(materialResources, scaffoldMatIndex); if (matResI == materialResources.cend() || matResI->first != scaffoldMatIndex) { continue; // missing shader name means a "no-draw" shader } const auto& matRes = matResI->second; // "Draw call resources" are used when performing this draw call. // They help select the right shader, and are also required for // setting the graphics state (bound textures and shader constants, etc) // We can initialise them now using some information from the geometry // object and some information from the material. Pimpl::DrawCallResources res( matRes._shaderName, mesh->_geoParamBox, matRes._matParams, matRes._texturesIndex, matRes._constantBuffer, matRes._renderStateSet, matRes._delayStep, scaffoldMatIndex); drawCallRes.push_back(res); drawCalls.push_back(std::make_pair(gi, d)); } } //////////////////////////////////////////////////////////////////////// // s k i n n e d g e o // std::vector<Pimpl::SkinnedMesh> skinnedMeshes; std::vector<Pimpl::MeshAndDrawCall> skinnedDrawCalls; std::vector<Pimpl::SkinnedMeshAnimBinding> skinnedBindings; for (unsigned gi=0; gi<skinCallCount; ++gi) { auto& geoInst = cmdStream.GetSkinCall(gi); if (geoInst._levelOfDetail != levelOfDetail) { continue; } // Check to see if this mesh has at least one valid draw call. If there // is none, we can skip it completely assert(geoInst._geoId < meshData._boundSkinnedControllerCount); auto& geo = meshData._boundSkinnedControllers[geoInst._geoId]; if (!AtLeastOneValidDrawCall(geo, scaffold, unsigned(geoCallCount + gi), materialResources)) { continue; } // if we encounter the same mesh multiple times, we don't need to store it every time auto mesh = FindIf(skinnedMeshes, [=](const Pimpl::SkinnedMesh& mesh) { return mesh._id == geoInst._geoId; }); if (mesh == skinnedMeshes.end()) { skinnedMeshes.push_back( Pimpl::BuildMesh(geoInst, geo, workingBuffers, sharedStateSet, AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size(), paramBoxDesc)); skinnedBindings.push_back( Pimpl::BuildAnimBinding( geoInst, geo, sharedStateSet, AsPointer(textureBindPoints.cbegin()), (unsigned)textureBindPoints.size())); mesh = skinnedMeshes.end()-1; } for (unsigned di=0; di<geo._drawCallsCount; ++di) { auto& d = geo._drawCalls[di]; if (!d._indexCount) { continue; } auto scaffoldMatIndex = ScaffoldMaterialIndex(scaffold, unsigned(geoCallCount + gi), di); auto subMatResI = LowerBound(materialResources, scaffoldMatIndex); if (subMatResI == materialResources.cend() || subMatResI->first != scaffoldMatIndex) { continue; // missing shader name means a "no-draw" shader } auto& matRes = subMatResI->second; Pimpl::DrawCallResources res( matRes._shaderName, mesh->_geoParamBox, matRes._matParams, matRes._texturesIndex, matRes._constantBuffer, matRes._renderStateSet, matRes._delayStep, scaffoldMatIndex); drawCallRes.push_back(res); skinnedDrawCalls.push_back(std::make_pair(gi, d)); } } //////////////////////////////////////////////////////////////////////// // // We have to load the "large blocks" from the file here // -- todo -- this part can be pushed into the background // using the buffer uploads system // std::vector<uint8> nascentVB, nascentIB; nascentVB.resize(workingBuffers._vbSize); nascentIB.resize(workingBuffers._ibSize); BasicFile file(scaffold.Filename().c_str(), "rb"); auto largeBlocksOffset = scaffold.LargeBlocksOffset(); for (auto m=meshes.begin(); m!=meshes.end(); ++m) { LoadBlock(file, &nascentIB[m->_ibOffset], largeBlocksOffset + m->_sourceFileIBOffset, m->_sourceFileIBSize); LoadBlock(file, &nascentVB[m->_vbOffset], largeBlocksOffset + m->_sourceFileVBOffset, m->_sourceFileVBSize); } for (auto m=skinnedMeshes.begin(); m!=skinnedMeshes.end(); ++m) { LoadBlock(file, &nascentIB[m->_ibOffset], largeBlocksOffset + m->_sourceFileIBOffset, m->_sourceFileIBSize); LoadBlock(file, &nascentVB[m->_vbOffset], largeBlocksOffset + m->_sourceFileVBOffset, m->_sourceFileVBSize); for (unsigned s=0; s<Pimpl::SkinnedMesh::VertexStreams::Max; ++s) { LoadBlock(file, &nascentVB[m->_extraVbOffset[s]], largeBlocksOffset + m->_sourceFileExtraVBOffset[s], m->_sourceFileExtraVBSize[s]); } } //////////////////////////////////////////////////////////////////////// // now that we have a list of all of the sub materials used, and we know how large the resource // interface is, we build an array of deferred shader resources for shader inputs. std::vector<::Assets::rstring> boundTextureNames; auto boundTextures = BuildBoundTextures( scaffold, matScaffold, searchRules, materialResources, textureBindPoints, textureSetCount, boundTextureNames); //////////////////////////////////////////////////////////////////////// std::vector<Metal::ConstantBuffer> finalConstantBuffers; for (auto cb=prescientMaterialConstantBuffers.cbegin(); cb!=prescientMaterialConstantBuffers.end(); ++cb) { assert(cb->size()); Metal::ConstantBuffer newCB(AsPointer(cb->begin()), cb->size()); finalConstantBuffers.push_back(std::move(newCB)); } Metal::VertexBuffer vb(AsPointer(nascentVB.begin()), nascentVB.size()); Metal::IndexBuffer ib(AsPointer(nascentIB.begin()), nascentIB.size()); //////////////////////////////////////////////////////////////////////// _validationCallback = std::make_shared<::Assets::DependencyValidation>(); ::Assets::RegisterAssetDependency(_validationCallback, cbLayout.GetDependencyValidation()); for (const auto& t:boundTextures) if (t) ::Assets::RegisterAssetDependency(_validationCallback, t->GetDependencyValidation()); // rebuild the entire renderer if any texture changes auto pimpl = std::make_unique<Pimpl>(); pimpl->_vertexBuffer = std::move(vb); pimpl->_indexBuffer = std::move(ib); pimpl->_meshes = std::move(meshes); pimpl->_skinnedMeshes = std::move(skinnedMeshes); pimpl->_skinnedBindings = std::move(skinnedBindings); pimpl->_drawCalls = std::move(drawCalls); pimpl->_drawCallRes = std::move(drawCallRes); pimpl->_skinnedDrawCalls = std::move(skinnedDrawCalls); pimpl->_boundTextures = std::move(boundTextures); pimpl->_constantBuffers = std::move(finalConstantBuffers); pimpl->_texturesPerMaterial = textureBindPoints.size(); pimpl->_scaffold = &scaffold; pimpl->_levelOfDetail = levelOfDetail; #if defined(_DEBUG) pimpl->_vbSize = (unsigned)nascentVB.size(); pimpl->_ibSize = (unsigned)nascentIB.size(); pimpl->_boundTextureNames = std::move(boundTextureNames); pimpl->_paramBoxDesc = std::move(paramBoxDesc._descriptions); #endif _pimpl = std::move(pimpl); DEBUG_ONLY(LogReport()); } ModelRenderer::~ModelRenderer() {} class ModelRenderingBox { public: class Desc {}; Metal::ConstantBuffer _localTransformBuffer; ModelRenderingBox(const Desc&) { Metal::ConstantBuffer localTransformBuffer(nullptr, sizeof(Techniques::LocalTransformConstants)); _localTransformBuffer = std::move(localTransformBuffer); } ~ModelRenderingBox() {} }; Metal::BoundUniforms* ModelRenderer::Pimpl::BeginVariation( const ModelRendererContext& context, const SharedStateSet& sharedStateSet, unsigned drawCallIndex, TechniqueInterface techniqueInterface) const { static Utility::ParameterBox tempGlobalStatesBox; const auto& res = _drawCallRes[drawCallIndex]; sharedStateSet.BeginRenderState(context, tempGlobalStatesBox, res._renderStateSet); return sharedStateSet.BeginVariation( context, res._shaderName, techniqueInterface, res._geoParamBox, res._materialParamBox); } auto ModelRenderer::Pimpl::BeginGeoCall( const ModelRendererContext& context, Metal::ConstantBuffer& localTransformBuffer, const MeshToModel* transforms, const Float4x4& modelToWorld, unsigned geoCallIndex) const -> TechniqueInterface { auto& cmdStream = _scaffold->CommandStream(); auto& geoCall = cmdStream.GetGeoCall(geoCallIndex); if (transforms) { auto localToModel = transforms->GetMeshToModel(geoCall._transformMarker); Techniques::LocalTransformConstants trans; trans = Techniques::MakeLocalTransform(Combine(localToModel, modelToWorld), ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld)); localTransformBuffer.Update(*context._context, &trans, sizeof(trans)); } // todo -- should be possible to avoid this search auto mesh = FindIf(_meshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoCall._geoId; }); assert(mesh != _meshes.end()); auto& devContext = *context._context; devContext.Bind(_indexBuffer, Metal::NativeFormat::Enum(mesh->_indexFormat), mesh->_ibOffset); devContext.Bind(ResourceList<Metal::VertexBuffer, 1>(std::make_tuple(std::ref(_vertexBuffer))), mesh->_vertexStride, mesh->_vbOffset); return mesh->_techniqueInterface; } auto ModelRenderer::Pimpl::BeginSkinCall( const ModelRendererContext& context, Metal::ConstantBuffer& localTransformBuffer, const MeshToModel* transforms, const Float4x4& modelToWorld, unsigned geoCallIndex, PreparedAnimation* preparedAnimation) const -> TechniqueInterface { auto& cmdStream = _scaffold->CommandStream(); auto& geoCall = cmdStream.GetSkinCall(geoCallIndex); // We only need to use the "transforms" array when we don't // have prepared animation // (otherwise that information gets burned into the // prepared vertex positions) if (!preparedAnimation && transforms) { auto meshToWorld = Combine(transforms->GetMeshToModel(geoCall._transformMarker), modelToWorld); auto trans = Techniques::MakeLocalTransform(modelToWorld, ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld)); localTransformBuffer.Update(*context._context, &trans, sizeof(trans)); } auto cm = FindIf(_skinnedMeshes, [=](const Pimpl::SkinnedMesh& mesh) { return mesh._id == geoCall._geoId; }); assert(cm != _skinnedMeshes.end()); auto meshIndex = std::distance(_skinnedMeshes.cbegin(), cm); auto result = cm->_skinnedTechniqueInterface; auto& devContext = *context._context; devContext.Bind(_indexBuffer, Metal::NativeFormat::Enum(cm->_indexFormat), cm->_ibOffset); auto animGeo = SkinnedMesh::VertexStreams::AnimatedGeo; UINT strides[2], offsets[2]; ID3D::Buffer* underlyingVBs[2]; strides[0] = cm->_extraVbStride[animGeo]; offsets[0] = cm->_extraVbOffset[animGeo]; strides[1] = cm->_vertexStride; offsets[1] = cm->_vbOffset; underlyingVBs[0] = underlyingVBs[1] = _vertexBuffer.GetUnderlying(); // If we have a prepared animation, we have to replace the bindings // with the data from there. if (preparedAnimation) { underlyingVBs[0] = preparedAnimation->_skinningBuffer.GetUnderlying(); strides[0] = _skinnedBindings[meshIndex]._vertexStride; offsets[0] = preparedAnimation->_vbOffsets[meshIndex]; result = _skinnedBindings[meshIndex]._techniqueInterface; } context._context->GetUnderlying()->IASetVertexBuffers(0, 2, underlyingVBs, strides, offsets); return result; } void ModelRenderer::Pimpl::ApplyBoundUnforms( const ModelRendererContext& context, Metal::BoundUniforms& boundUniforms, unsigned resourcesIndex, unsigned constantsIndex, const Metal::ConstantBuffer* cbs[2]) { const Metal::ShaderResourceView* srvs[16]; assert(_texturesPerMaterial <= dimof(srvs)); for (unsigned c=0; c<_texturesPerMaterial; c++) { auto* t = _boundTextures[resourcesIndex * _texturesPerMaterial + c]; srvs[c] = t?(&t->GetShaderResource()):nullptr; } cbs[1] = &_constantBuffers[constantsIndex]; assert(cbs[1] && cbs[1]->GetUnderlying()); boundUniforms.Apply( *context._context, context._parserContext->GetGlobalUniformsStream(), RenderCore::Metal::UniformsStream(nullptr, cbs, 2, srvs, _texturesPerMaterial)); } auto ModelRenderer::Pimpl::BuildMesh( const ModelCommandStream::GeoCall& geoInst, const RawGeometry& geo, ModelConstruction::BuffersUnderConstruction& workingBuffers, SharedStateSet& sharedStateSet, const uint64 textureBindPoints[], unsigned textureBindPointsCnt, ModelConstruction::ParamBoxDescriptions& paramBoxDesc, bool normalFromSkinning) -> Mesh { Mesh result; result._id = geoInst._geoId; result._indexFormat = geo._ib._format; result._vertexStride = geo._vb._ia._vertexStride; result._geoParamBox = ModelConstruction::BuildGeoParamBox(geo._vb._ia, sharedStateSet, paramBoxDesc, normalFromSkinning); // (source file locators) result._sourceFileIBOffset = geo._ib._offset; result._sourceFileIBSize = geo._ib._size; result._sourceFileVBOffset = geo._vb._offset; result._sourceFileVBSize = geo._vb._size; // (vb, ib allocations) result._ibOffset = workingBuffers.AllocateIB(result._sourceFileIBSize, Metal::NativeFormat::Enum(result._indexFormat)); result._vbOffset = workingBuffers.AllocateVB(result._sourceFileVBSize); Metal::InputElementDesc inputDesc[12]; unsigned vertexElementCount = BuildLowLevelInputAssembly( inputDesc, dimof(inputDesc), geo._vb._ia._elements, geo._vb._ia._elementCount); result._techniqueInterface = sharedStateSet.InsertTechniqueInterface( inputDesc, vertexElementCount, textureBindPoints, textureBindPointsCnt); return result; } auto ModelRenderer::Pimpl::BuildMesh( const ModelCommandStream::GeoCall& geoInst, const BoundSkinnedGeometry& geo, ModelConstruction::BuffersUnderConstruction& workingBuffers, SharedStateSet& sharedStateSet, const uint64 textureBindPoints[], unsigned textureBindPointsCnt, ModelConstruction::ParamBoxDescriptions& paramBoxDesc) -> SkinnedMesh { // Build the mesh, starting with the same basic behaviour as // unskinned meshes. // (there a sort-of "slice" here... It's a bit of a hack) bool skinnedNormal = ModelConstruction::HasElement(geo._animatedVertexElements._ia, "NORMAL"); Pimpl::SkinnedMesh result; (Pimpl::Mesh&)result = BuildMesh( geoInst, (const RawGeometry&)geo, workingBuffers, sharedStateSet, textureBindPoints, textureBindPointsCnt, paramBoxDesc, skinnedNormal); auto animGeo = Pimpl::SkinnedMesh::VertexStreams::AnimatedGeo; auto skelBind = Pimpl::SkinnedMesh::VertexStreams::SkeletonBinding; const VertexData* vd[2]; vd[animGeo] = &geo._animatedVertexElements; vd[skelBind] = &geo._skeletonBinding; for (unsigned c=0; c<2; ++c) { result._sourceFileExtraVBOffset[c] = vd[c]->_offset; result._sourceFileExtraVBSize[c] = vd[c]->_size; result._extraVbOffset[c] = workingBuffers.AllocateVB(result._sourceFileExtraVBSize[c]); result._extraVbStride[c] = vd[c]->_ia._vertexStride; } //////////////////////////////////////////////////////////////////////////////// // Build the input assembly we will use while rendering. This should // contain the unskinned the vertex elements, and also the skinned vertex // elements. // // There are 3 possible paths for the skinned vertex elements: // 1) we do the skinning in the vertex shader, as we encounter them. // (In this case, we also need the skinning parameter vertex elements) // 2) we do the skinning in a geometry shader prepare step // 3) we do no skinning at all // // In path 2, the geometry shader prepare step may change the format of the // vertex elements. This typically occurs when using 16 bit floats (or maybe // even fixed point formats). That means we need another technique interface // for the prepared animation case! { Metal::InputElementDesc inputDescForRender[12]; unsigned eleCount = BuildLowLevelInputAssembly( inputDescForRender, dimof(inputDescForRender), geo._animatedVertexElements._ia._elements, geo._animatedVertexElements._ia._elementCount); // (add the unanimated part) eleCount += BuildLowLevelInputAssembly( &inputDescForRender[eleCount], dimof(inputDescForRender) - eleCount, geo._vb._ia._elements, geo._vb._ia._elementCount, 1); result._skinnedTechniqueInterface = sharedStateSet.InsertTechniqueInterface( inputDescForRender, eleCount, textureBindPoints, textureBindPointsCnt); } return result; } ModelRenderer::Pimpl::DrawCallResources::DrawCallResources() { _shaderName = _geoParamBox = _materialParamBox = 0; _textureSet = _constantBuffer = _renderStateSet = 0; _delayStep = DelayStep::OpaqueRender; _materialBindingGuid = 0; } ModelRenderer::Pimpl::DrawCallResources::DrawCallResources( unsigned shaderName, unsigned geoParamBox, unsigned matParamBox, unsigned textureSet, unsigned constantBuffer, unsigned renderStateSet, DelayStep delayStep, MaterialGuid materialBindingGuid) { _shaderName = shaderName; _geoParamBox = geoParamBox; _materialParamBox = matParamBox; _textureSet = textureSet; _constantBuffer = constantBuffer; _renderStateSet = renderStateSet; _delayStep = delayStep; _materialBindingGuid = materialBindingGuid; } void ModelRenderer::Render( const ModelRendererContext& context, const SharedStateSet& sharedStateSet, const Float4x4& modelToWorld, const MeshToModel* transforms, PreparedAnimation* preparedAnimation) const { auto& box = Techniques::FindCachedBox<ModelRenderingBox>(ModelRenderingBox::Desc()); const Metal::ConstantBuffer* pkts[] = { &box._localTransformBuffer, nullptr }; unsigned currTextureSet = ~unsigned(0x0), currCB = ~unsigned(0x0), currGeoCall = ~unsigned(0x0); Pimpl::TechniqueInterface currTechniqueInterface = ~Pimpl::TechniqueInterface(0x0); Metal::BoundUniforms* currUniforms = nullptr; auto& devContext = *context._context; auto& scaffold = *_pimpl->_scaffold; auto& cmdStream = scaffold.CommandStream(); if (!transforms) { Techniques::LocalTransformConstants trans; trans = Techniques::MakeLocalTransform(modelToWorld, ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld)); box._localTransformBuffer.Update(*context._context, &trans, sizeof(trans)); } if (Tweakable("SkinnedAsStatic", false)) { preparedAnimation = nullptr; } TRY { // skinned and unskinned geometry are almost the same, except for // "BeginGeoCall" / "BeginSkinCall". Never the less, we need to split // them into separate loops //////////// Render un-skinned geometry //////////// Metal::ConstantBuffer drawCallIndexBuffer(nullptr, sizeof(unsigned)*4); devContext.BindGS(MakeResourceList(drawCallIndexBuffer)); unsigned drawCallIndex = 0; for (auto md=_pimpl->_drawCalls.cbegin(); md!=_pimpl->_drawCalls.cend(); ++md, ++drawCallIndex) { if (md->first != currGeoCall) { currTechniqueInterface = _pimpl->BeginGeoCall( context, box._localTransformBuffer, transforms, modelToWorld, md->first); currGeoCall = md->first; } auto* boundUniforms = _pimpl->BeginVariation(context, sharedStateSet, drawCallIndex, currTechniqueInterface); const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex]; if ( boundUniforms != currUniforms || drawCallRes._textureSet != currTextureSet || drawCallRes._constantBuffer != currCB) { if (boundUniforms) { _pimpl->ApplyBoundUnforms( context, *boundUniforms, drawCallRes._textureSet, drawCallRes._constantBuffer, pkts); } currTextureSet = drawCallRes._textureSet; currCB = drawCallRes._constantBuffer; currUniforms = boundUniforms; } const auto& d = md->second; devContext.Bind(Metal::Topology::Enum(d._topology)); // do we really need to set the topology every time? // -- this draw call index stuff is only required in some cases -- // we need some way to customise the model rendering method for different purposes devContext.Bind(Techniques::CommonResources()._dssReadWriteWriteStencil, 1+drawCallIndex); // write stencil buffer with draw index unsigned drawCallIndexB[4] = { drawCallIndex, 0, 0, 0 }; drawCallIndexBuffer.Update(devContext, drawCallIndexB, sizeof(drawCallIndexB)); // ------------- devContext.DrawIndexed(d._indexCount, d._firstIndex, d._firstVertex); } //////////// Render skinned geometry //////////// currGeoCall = ~unsigned(0x0); for (auto md=_pimpl->_skinnedDrawCalls.cbegin(); md!=_pimpl->_skinnedDrawCalls.cend(); ++md, ++drawCallIndex) { if (md->first != currGeoCall) { currTechniqueInterface = _pimpl->BeginSkinCall( context, box._localTransformBuffer, transforms, modelToWorld, md->first, preparedAnimation); currGeoCall = md->first; } auto* boundUniforms = _pimpl->BeginVariation(context, sharedStateSet, drawCallIndex, currTechniqueInterface); const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex]; if ( boundUniforms != currUniforms || drawCallRes._textureSet != currTextureSet || drawCallRes._constantBuffer != currCB) { if (boundUniforms) { _pimpl->ApplyBoundUnforms( context, *boundUniforms, drawCallRes._textureSet, drawCallRes._constantBuffer, pkts); } currTextureSet = drawCallRes._textureSet; currCB = drawCallRes._constantBuffer; currUniforms = boundUniforms; } const auto& d = md->second; devContext.Bind(Metal::Topology::Enum(d._topology)); // do we really need to set the topology every time? devContext.DrawIndexed(d._indexCount, d._firstIndex, d._firstVertex); } } CATCH(::Assets::Exceptions::InvalidAsset& e) { context._parserContext->Process(e); } CATCH(::Assets::Exceptions::PendingAsset& e) { context._parserContext->Process(e); } CATCH_END } //////////////////////////////////////////////////////////////////////////////// bool CompareDrawCall(const DelayedDrawCall& lhs, const DelayedDrawCall& rhs) { if (lhs._shaderVariationHash == rhs._shaderVariationHash) { if (lhs._renderer == rhs._renderer) { if (lhs._subMesh == rhs._subMesh) { return lhs._drawCallIndex < rhs._drawCallIndex; } return lhs._subMesh < rhs._subMesh; } return lhs._renderer < rhs._renderer; } return lhs._shaderVariationHash < rhs._shaderVariationHash; } void ModelRenderer::Prepare( DelayedDrawCallSet& dest, const SharedStateSet& sharedStateSet, const Float4x4& modelToWorld, const MeshToModel* transforms) { unsigned mainTransformIndex = ~unsigned(0x0); if (!transforms) { mainTransformIndex = (unsigned)dest._transforms.size(); dest._transforms.push_back(modelToWorld); } // After culling; submit all of the draw-calls in this mesh to a list to be sorted // Note -- only unskinned geometry supported currently. In theory, we might be able // to do the same with skinned geometry (at least, when not using the "prepare" step unsigned drawCallIndex = 0; for (auto md=_pimpl->_drawCalls.cbegin(); md!=_pimpl->_drawCalls.cend(); ++md, ++drawCallIndex) { const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex]; const auto& d = md->second; auto geoParamIndex = drawCallRes._geoParamBox; auto matParamIndex = drawCallRes._materialParamBox; auto shaderNameIndex = drawCallRes._shaderName; auto& cmdStream = _pimpl->_scaffold->CommandStream(); auto& geoCall = cmdStream.GetGeoCall(md->first); auto mesh = FindIf( _pimpl->_meshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoCall._geoId; }); assert(mesh != _pimpl->_meshes.end()); auto step = unsigned(drawCallRes._delayStep); DelayedDrawCall entry; entry._drawCallIndex = drawCallIndex; entry._renderer = this; if (transforms) { auto trans = Combine( transforms->GetMeshToModel(geoCall._transformMarker), modelToWorld); entry._meshToWorld = (unsigned)dest._transforms.size(); dest._transforms.push_back(trans); } else { entry._meshToWorld = mainTransformIndex; } unsigned techniqueInterface = mesh->_techniqueInterface; entry._shaderVariationHash = techniqueInterface ^ (geoParamIndex << 12) ^ (matParamIndex << 15) ^ (shaderNameIndex << 24); // simple hash of these indices. Note that collisions might be possible entry._indexCount = d._indexCount; entry._firstIndex = d._firstIndex; entry._firstVertex = d._firstVertex; entry._topology = Metal::Topology::Enum(d._topology); entry._subMesh = AsPointer(mesh); dest._entries[step].push_back(entry); } // Also try to render skinned geometry... But we want to render this with skinning disabled // (this path is intended for rendering many static objects) for (auto md=_pimpl->_skinnedDrawCalls.cbegin(); md!=_pimpl->_skinnedDrawCalls.cend(); ++md, ++drawCallIndex) { const auto& drawCallRes = _pimpl->_drawCallRes[drawCallIndex]; const auto& d = md->second; auto geoParamIndex = drawCallRes._geoParamBox; auto matParamIndex = drawCallRes._materialParamBox; auto shaderNameIndex = drawCallRes._shaderName; auto& cmdStream = _pimpl->_scaffold->CommandStream(); auto& geoCall = cmdStream.GetSkinCall(md->first); auto mesh = FindIf( _pimpl->_skinnedMeshes, [=](const Pimpl::Mesh& mesh) { return mesh._id == geoCall._geoId; }); assert(mesh != _pimpl->_skinnedMeshes.end()); auto step = unsigned(drawCallRes._delayStep); DelayedDrawCall entry; entry._drawCallIndex = drawCallIndex; entry._renderer = this; if (transforms) { auto trans = Combine( transforms->GetMeshToModel(geoCall._transformMarker), modelToWorld); entry._meshToWorld = (unsigned)dest._transforms.size(); dest._transforms.push_back(trans); } else { entry._meshToWorld = mainTransformIndex; } unsigned techniqueInterface = mesh->_skinnedTechniqueInterface; entry._shaderVariationHash = techniqueInterface ^ (geoParamIndex << 12) ^ (matParamIndex << 15) ^ (shaderNameIndex << 24); // simple hash of these indices. Note that collisions might be possible entry._indexCount = d._indexCount; entry._firstIndex = d._firstIndex; entry._firstVertex = d._firstVertex; entry._topology = Metal::Topology::Enum(d._topology) | 0x100; entry._subMesh = AsPointer(mesh); dest._entries[step].push_back(entry); } } namespace WLTFlags { enum Enum { LocalToWorld = 1<<0, LocalSpaceView = 1<<1, MaterialGuid = 1<<2 }; } template<int Flags> void WriteLocalTransform( void* dest, const ModelRendererContext& context, const Float4x4& t, uint64 materialGuid) { auto* dst = (Techniques::LocalTransformConstants*)dest; // Write some system constants that are supposed // to be provided by the model renderer if (constant_expression<!!(Flags&WLTFlags::LocalToWorld)>::result()) { CopyTransform(dst->_localToWorld, t); } if (constant_expression<!!(Flags&WLTFlags::LocalSpaceView)>::result()) { auto worldSpaceView = ExtractTranslation(context._parserContext->GetProjectionDesc()._cameraToWorld); TransformPointByOrthonormalInverse(t, worldSpaceView); dst->_localSpaceView = worldSpaceView; } if (constant_expression<!!(Flags&WLTFlags::MaterialGuid)>::result()) { dst->_materialGuid = materialGuid; } } template<bool HasCallback> void ModelRenderer::RenderPreparedInternal( const ModelRendererContext& context, const SharedStateSet& sharedStateSet, DelayedDrawCallSet& drawCalls, DelayStep delayStep, const std::function<void(unsigned, unsigned, unsigned)>* callback) { if (drawCalls.GetRendererGUID() != typeid(ModelRenderer).hash_code()) Throw(::Exceptions::BasicLabel("Delayed draw call set matched with wrong renderer type")); auto& entries = drawCalls._entries[(unsigned)delayStep]; if (entries.empty()) return; Techniques::LocalTransformConstants localTrans; localTrans._localSpaceView = Float3(0.f, 0.f, 0.f); Metal::ConstantBuffer& localTransformBuffer = Techniques::CommonResources()._localTransformBuffer; const Metal::ConstantBuffer* pkts[] = { &localTransformBuffer, nullptr }; std::sort(entries.begin(), entries.end(), CompareDrawCall); const ModelRenderer::Pimpl::Mesh* currentMesh = nullptr; RenderCore::Metal::BoundUniforms* boundUniforms = nullptr; unsigned currentVariationHash = ~unsigned(0x0); unsigned currentTextureSet = ~unsigned(0x0); unsigned currentConstantBufferIndex = ~unsigned(0x0); unsigned currentTechniqueInterface = ~unsigned(0x0); for (auto d=entries.cbegin(); d!=entries.cend(); ++d) { auto& renderer = *(const ModelRenderer*)d->_renderer; const auto& drawCallRes = renderer._pimpl->_drawCallRes[d->_drawCallIndex]; if (currentMesh != d->_subMesh) { if (d->_topology > 0xff) { auto& mesh = *(const Pimpl::SkinnedMesh*)d->_subMesh; context._context->Bind(renderer._pimpl->_indexBuffer, Metal::NativeFormat::Enum(mesh._indexFormat), mesh._ibOffset); const Metal::VertexBuffer* vbs[] = { &renderer._pimpl->_vertexBuffer, &renderer._pimpl->_vertexBuffer }; unsigned strides[] = { mesh._extraVbStride[0], mesh._vertexStride }; unsigned offsets[] = { mesh._extraVbOffset[0], mesh._vbOffset }; context._context->Bind(0, 2, vbs, strides, offsets); currentMesh = &mesh; currentTechniqueInterface = mesh._skinnedTechniqueInterface; } else { auto& mesh = *(const Pimpl::Mesh*)d->_subMesh; context._context->Bind(renderer._pimpl->_indexBuffer, Metal::NativeFormat::Enum(mesh._indexFormat), mesh._ibOffset); context._context->Bind(MakeResourceList(renderer._pimpl->_vertexBuffer), mesh._vertexStride, mesh._vbOffset); currentMesh = &mesh; currentTechniqueInterface = mesh._techniqueInterface; } currentTextureSet = ~unsigned(0x0); } // Note -- at the moment, shader variation hash is the sorting priority. // This reduces the shader changes to a minimum. It also means we // do the work in "BeginVariation" to resolve the variation // as rarely as possible. However, we could pre-resolve all of the // variations that we're going to need and use another value as the // sorting priority instead... That might reduce the API thrashing // in some cases. if (currentVariationHash != d->_shaderVariationHash) { auto& mesh = *(const Pimpl::Mesh*)d->_subMesh; boundUniforms = sharedStateSet.BeginVariation( context, drawCallRes._shaderName, currentTechniqueInterface, drawCallRes._geoParamBox, drawCallRes._materialParamBox); currentVariationHash = d->_shaderVariationHash; currentTextureSet = ~unsigned(0x0); } if (!boundUniforms) continue; static Utility::ParameterBox tempGlobalStatesBox; sharedStateSet.BeginRenderState(context, tempGlobalStatesBox, drawCallRes._renderStateSet); // We have to do this transform update very frequently! isn't there a better way? { D3D11_MAPPED_SUBRESOURCE result; HRESULT hresult = context._context->GetUnderlying()->Map( localTransformBuffer.GetUnderlying(), 0, D3D11_MAP_WRITE_DISCARD, 0, &result); assert(SUCCEEDED(hresult) && result.pData); (void)hresult; WriteLocalTransform<WLTFlags::LocalToWorld|WLTFlags::MaterialGuid>( result.pData, context, drawCalls._transforms[d->_meshToWorld], drawCallRes._materialBindingGuid); context._context->GetUnderlying()->Unmap(localTransformBuffer.GetUnderlying(), 0); } auto textureSet = drawCallRes._textureSet; auto constantBufferIndex = drawCallRes._constantBuffer; // sometimes the same render call may be rendered in several different locations. In these cases, // we can reduce the API thrashing to the minimum by avoiding re-setting resources and constants if (boundUniforms && (textureSet != currentTextureSet || constantBufferIndex != currentConstantBufferIndex)) { renderer._pimpl->ApplyBoundUnforms( context, *boundUniforms, textureSet, constantBufferIndex, pkts); currentTextureSet = textureSet; currentConstantBufferIndex = constantBufferIndex; } context._context->Bind((Metal::Topology::Enum)(d->_topology & 0xff)); if (constant_expression<HasCallback>::result()) { (*callback)(d->_indexCount, d->_firstIndex, d->_firstVertex); } else context._context->DrawIndexed(d->_indexCount, d->_firstIndex, d->_firstVertex); } } void ModelRenderer::RenderPrepared( const ModelRendererContext& context, const SharedStateSet& sharedStateSet, DelayedDrawCallSet& drawCalls, DelayStep delayStep) { RenderPreparedInternal<false>(context, sharedStateSet, drawCalls, delayStep, nullptr); } void ModelRenderer::RenderPrepared( const ModelRendererContext& context, const SharedStateSet& sharedStateSet, DelayedDrawCallSet& drawCalls, DelayStep delayStep, const std::function<void(unsigned, unsigned, unsigned)>& callback) { assert(callback); RenderPreparedInternal<true>(context, sharedStateSet, drawCalls, delayStep, &callback); } //////////////////////////////////////////////////////////////////////////////// /// \todo -- this DestroyArray stuff is too awkward. Instead, let's create /// some "SerializeableArray" or "SerializeableBlock" or something -- /// and have it deal with the internals (even if it means increasing memory size slightly) ModelCommandStream::~ModelCommandStream() { DestroyArray(_geometryInstances, &_geometryInstances[_geometryInstanceCount]); DestroyArray(_skinControllerInstances, &_skinControllerInstances[_skinControllerInstanceCount]); } GeoInputAssembly::~GeoInputAssembly() { DestroyArray(_elements, &_elements[_elementCount]); } RawGeometry::~RawGeometry() {} BoundSkinnedGeometry::~BoundSkinnedGeometry() {} ModelImmutableData::~ModelImmutableData() { DestroyArray(_geos, &_geos[_geoCount]); DestroyArray(_boundSkinnedControllers, &_boundSkinnedControllers[_boundSkinnedControllerCount]); } //////////////////////////////////////////////////////////// uint64 GeoInputAssembly::BuildHash() const { // Build a hash for this object. // Note that we should be careful that we don't get an // noise from characters in the left-over space in the // semantic names. Do to this right, we should make sure // that left over space has no effect. auto elementsHash = Hash64(_elements, PtrAdd(_elements, _elementCount * sizeof(VertexElement))); elementsHash ^= uint64(_vertexStride); return elementsHash; } //////////////////////////////////////////////////////////// Float4x4 ModelRenderer::MeshToModel::GetMeshToModel(unsigned transformMarker) const { // The "skeleton binding" tells us how to map from the matrices that // are output from the transformation machine to the input matrices // expected by the "transformMarker" index scheme if (_skeletonBinding) { assert(transformMarker < _skeletonBinding->_modelJointIndexToMachineOutput.size()); auto machineOutputIndex = _skeletonBinding->_modelJointIndexToMachineOutput[transformMarker]; if (machineOutputIndex == ~unsigned(0x0)) { // no mapping... we just have to assume identity mesh-to-model return Identity<Float4x4>(); } else if (machineOutputIndex >= _skeletonOutputCount) { assert(0); return Identity<Float4x4>(); } return _skeletonOutput[machineOutputIndex]; } else { if (transformMarker >= _skeletonOutputCount) { assert(0); return Identity<Float4x4>(); } return _skeletonOutput[transformMarker]; } } ModelRenderer::MeshToModel::MeshToModel() { _skeletonOutput = nullptr; _skeletonOutputCount = 0; _skeletonBinding = nullptr; } ModelRenderer::MeshToModel::MeshToModel( const Float4x4 skeletonOutput[], unsigned skeletonOutputCount, const SkeletonBinding* binding) { _skeletonOutput = skeletonOutput; _skeletonOutputCount = skeletonOutputCount; _skeletonBinding = binding; } template<unsigned Size> static std::string Width(unsigned input) { static char buffer[Size+1]; auto err = _itoa_s(input, buffer, 10); if (!err) { auto length = XlStringLen(buffer); if (length < Size) { auto movement = Size-length; XlMoveMemory(&buffer[movement], buffer, length); XlSetMemory(buffer, ' ', movement); buffer[Size] = '\0'; } return std::string(buffer); } else { return std::string("<<err>>"); } } std::vector<MaterialGuid> ModelRenderer::DrawCallToMaterialBinding() const { std::vector<MaterialGuid> result; result.reserve(_pimpl->_drawCallRes.size()); for (auto i=_pimpl->_drawCallRes.begin(); i!=_pimpl->_drawCallRes.end(); ++i) { result.push_back(i->_materialBindingGuid); } return std::move(result); } MaterialGuid ModelRenderer::GetMaterialBindingForDrawCall(unsigned drawCallIndex) const { if (drawCallIndex < _pimpl->_drawCallRes.size()) return _pimpl->_drawCallRes[drawCallIndex]._materialBindingGuid; return ~0ull; } void ModelRenderer::LogReport() const { LogInfo << "---<< Model Renderer: " << _pimpl->_scaffold->Filename() << " (LOD: " << _pimpl->_levelOfDetail << ") >>---"; LogInfo << " [" << _pimpl->_meshes.size() << "] meshes"; LogInfo << " [" << _pimpl->_skinnedMeshes.size() << "] skinned meshes"; LogInfo << " [" << _pimpl->_constantBuffers.size() << "] constant buffers"; LogInfo << " [" << _pimpl->_drawCalls.size() << "] draw calls"; LogInfo << " [" << _pimpl->_skinnedDrawCalls.size() << "] skinned draw calls"; LogInfo << " [" << _pimpl->_boundTextures.size() << "] bound textures"; LogInfo << " [" << _pimpl->_texturesPerMaterial << "] textures per material"; DEBUG_ONLY(LogInfo << " [" << _pimpl->_vbSize / 1024.f << "k] VB size"); DEBUG_ONLY(LogInfo << " [" << _pimpl->_ibSize / 1024.f << "k] IB size"); LogInfo << " Draw calls | Indxs | GeoC | Shr | GeoP | MatP | Tex | CB | RS "; for (unsigned c=0; c<_pimpl->_drawCalls.size(); ++c) { const auto&m = _pimpl->_drawCalls[c].first; const auto&d = _pimpl->_drawCalls[c].second; const auto&r = _pimpl->_drawCallRes[c]; LogInfo << " [" << Width<3>(c) << "] (M) |" << Width<7>(d._indexCount) << " |" << Width<5>(m) << " |" << Width<5>(r._shaderName) << " |" << Width<5>(r._geoParamBox) << " |" << Width<5>(r._materialParamBox) << " |" << Width<5>(r._textureSet) << " |" << Width<5>(r._constantBuffer) << " |" << Width<5>(r._renderStateSet); } for (unsigned c=0; c<_pimpl->_skinnedDrawCalls.size(); ++c) { const auto&m = _pimpl->_skinnedDrawCalls[c].first; const auto&d = _pimpl->_skinnedDrawCalls[c].second; const auto&r = _pimpl->_drawCallRes[c + _pimpl->_drawCalls.size()]; LogInfo << " [" << Width<3>(c) << "] (S) |" << Width<7>(d._indexCount) << " |" << Width<5>(m) << " |" << Width<5>(r._shaderName) << " |" << Width<5>(r._geoParamBox) << " |" << Width<5>(r._materialParamBox) << " |" << Width<5>(r._textureSet) << " |" << Width<5>(r._constantBuffer) << " |" << Width<5>(r._renderStateSet); } LogInfo << " Meshes | GeoC | SrcVB | SrcIB | VtxS | TchI | GeoP | IdxF"; for (unsigned c=0; c<_pimpl->_meshes.size(); ++c) { const auto&m = _pimpl->_meshes[c]; LogInfo << " [" << Width<3>(c) << "] (M) |" << Width<5>(m._id) << " |" << Width<6>(m._sourceFileVBSize/1024) << "k |" << Width<6>(m._sourceFileIBSize/1024) << "k |" << Width<5>(m._vertexStride) << " |" << Width<5>(m._techniqueInterface) << " |" << Width<5>(m._geoParamBox) << " |" << Width<5>(m._indexFormat); } for (unsigned c=0; c<_pimpl->_skinnedMeshes.size(); ++c) { const auto&m = _pimpl->_skinnedMeshes[c]; LogInfo << " [" << Width<3>(c) << "] (S) |" << Width<5>(m._id) << " |" << Width<6>(m._sourceFileVBSize/1024) << "k |" << Width<6>(m._sourceFileIBSize/1024) << "k |" << Width<5>(m._vertexStride) << " |" << Width<5>(m._techniqueInterface) << " |" << Width<5>(m._geoParamBox) << " |" << Width<5>(m._indexFormat); } #if defined(_DEBUG) if (_pimpl->_texturesPerMaterial) { LogInfo << " Bound Textures"; for (unsigned c=0; c<_pimpl->_boundTextureNames.size() / _pimpl->_texturesPerMaterial; ++c) { StringMeld<512> temp; for (unsigned q=0; q<_pimpl->_texturesPerMaterial; ++q) { if (q) { temp << ", "; } temp << _pimpl->_boundTextureNames[c*_pimpl->_texturesPerMaterial+q]; } LogInfo << " [" << Width<3>(c) << "] " << temp; } } LogInfo << " Parameter Boxes"; for (unsigned c=0; c<_pimpl->_paramBoxDesc.size(); ++c) { auto& i = _pimpl->_paramBoxDesc[c]; LogInfo << " [" << Width<3>(i.first) << "] " << i.second; } #endif } //////////////////////////////////////////////////////////// static std::pair<std::unique_ptr<uint8[]>, unsigned> LoadRawData(const char filename[]) { BasicFile file(filename, "rb"); auto chunks = Serialization::ChunkFile::LoadChunkTable(file); // look for the first model scaffold chunk Serialization::ChunkFile::ChunkHeader largeBlocksChunk; Serialization::ChunkFile::ChunkHeader scaffoldChunk; for (auto i=chunks.begin(); i!=chunks.end(); ++i) { if (i->_type == ChunkType_ModelScaffold && !scaffoldChunk._fileOffset) { scaffoldChunk = *i; } if (i->_type == ChunkType_ModelScaffoldLargeBlocks && !largeBlocksChunk._fileOffset) { largeBlocksChunk = *i; } } if ( !scaffoldChunk._fileOffset || !largeBlocksChunk._fileOffset) { throw ::Assets::Exceptions::FormatError("Missing model scaffold chunks: %s", filename); } if (scaffoldChunk._chunkVersion != 0) { throw ::Assets::Exceptions::FormatError("Incorrect file version: %s", filename); } auto rawMemoryBlock = std::make_unique<uint8[]>(scaffoldChunk._size); file.Seek(scaffoldChunk._fileOffset, SEEK_SET); file.Read(rawMemoryBlock.get(), 1, scaffoldChunk._size); return std::make_pair(std::move(rawMemoryBlock), largeBlocksChunk._fileOffset); } ModelScaffold::ModelScaffold(const ResChar filename[]) { std::unique_ptr<uint8[]> rawMemoryBlock; unsigned largeBlocksOffset = 0; std::tie(rawMemoryBlock, largeBlocksOffset) = LoadRawData(filename); Serialization::Block_Initialize(rawMemoryBlock.get()); _data = (const ModelImmutableData*)Serialization::Block_GetFirstObject(rawMemoryBlock.get()); _validationCallback = std::make_shared<::Assets::DependencyValidation>(); RegisterFileDependency(_validationCallback, filename); _filename = filename; _rawMemoryBlock = std::move(rawMemoryBlock); _largeBlocksOffset = largeBlocksOffset; } ModelScaffold::ModelScaffold(std::shared_ptr<::Assets::PendingCompileMarker>&& marker) { _data = nullptr; _largeBlocksOffset = 0; if (marker->GetState() == ::Assets::AssetState::Ready) { CompleteFromMarker(*marker); } else { _marker = std::forward<std::shared_ptr<::Assets::PendingCompileMarker>>(marker); _validationCallback = std::make_shared<::Assets::DependencyValidation>(); } } ModelScaffold::ModelScaffold(ModelScaffold&& moveFrom) : _rawMemoryBlock(std::move(moveFrom._rawMemoryBlock)) , _filename(std::move(moveFrom._filename)) , _marker(std::move(moveFrom._marker)) , _validationCallback(std::move(moveFrom._validationCallback)) { _data = moveFrom._data; moveFrom._data = nullptr; _largeBlocksOffset = moveFrom._largeBlocksOffset; } ModelScaffold& ModelScaffold::operator=(ModelScaffold&& moveFrom) { _rawMemoryBlock = std::move(moveFrom._rawMemoryBlock); _data = moveFrom._data; moveFrom._data = nullptr; _largeBlocksOffset = moveFrom._largeBlocksOffset; _filename = std::move(moveFrom._filename); _marker = std::move(moveFrom._marker); _validationCallback = std::move(moveFrom._validationCallback); return *this; } ModelScaffold::~ModelScaffold() { if (_data) _data->~ModelImmutableData(); } void ModelScaffold::Resolve() const { if (_marker) { if (_marker->GetState() == ::Assets::AssetState::Invalid) { Throw(::Assets::Exceptions::InvalidAsset(_marker->Initializer(), "")); } else if (_marker->GetState() == ::Assets::AssetState::Pending) { // we need to throw immediately on pending resource // this object is useless while it's pending. Throw(::Assets::Exceptions::PendingAsset(_marker->Initializer(), "")); } // hack -- Resolve needs to be called by const methods (like "GetStaticBoundingBox") // but Resolve() must change all the internal pointers... It's an awkward // case for const-correctness const_cast<ModelScaffold*>(this)->CompleteFromMarker(*_marker); _marker.reset(); } } ::Assets::AssetState ModelScaffold::TryResolve() { if (_marker) { auto markerState = _marker->GetState(); if (markerState != ::Assets::AssetState::Ready) return markerState; CompleteFromMarker(*_marker); _marker.reset(); } return ::Assets::AssetState::Ready; } ::Assets::AssetState ModelScaffold::StallAndResolve() { if (_marker) { auto markerState = _marker->StallWhilePending(); if (markerState != ::Assets::AssetState::Ready) return markerState; CompleteFromMarker(*_marker); _marker.reset(); } return ::Assets::AssetState::Ready; } void ModelScaffold::CompleteFromMarker(::Assets::PendingCompileMarker& marker) { std::unique_ptr<uint8[]> rawMemoryBlock; unsigned largeBlocksOffset = 0; std::tie(rawMemoryBlock, largeBlocksOffset) = LoadRawData(marker._sourceID0); Serialization::Block_Initialize(rawMemoryBlock.get()); _data = (const ModelImmutableData*)Serialization::Block_GetFirstObject(rawMemoryBlock.get()); _filename = marker._sourceID0; if (!_validationCallback) { _validationCallback = marker._dependencyValidation; } else ::Assets::RegisterAssetDependency(_validationCallback, marker._dependencyValidation); _rawMemoryBlock = std::move(rawMemoryBlock); _largeBlocksOffset = largeBlocksOffset; } unsigned ModelScaffold::LargeBlocksOffset() const { Resolve(); return _largeBlocksOffset; } const ModelImmutableData& ModelScaffold::ImmutableData() const { Resolve(); return *_data; }; const ModelCommandStream& ModelScaffold::CommandStream() const { Resolve(); return _data->_visualScene; } const TransformationMachine& ModelScaffold::EmbeddedSkeleton() const { Resolve(); return _data->_embeddedSkeleton; } std::pair<Float3, Float3> ModelScaffold::GetStaticBoundingBox(unsigned) const { Resolve(); return _data->_boundingBox; } }}
[ "djewsbury@xlgames.com" ]
djewsbury@xlgames.com
15461411fa6e46d508616b392b170cadcd6971a5
2067d54dfd05c07e4ebd8f36a6c3a0a9c32eda59
/ThreadPool/headers/Synchronization/AtomicInteger.h
5857a64f77ff5c15ce49cdc9e0ff3966c822bb01
[]
no_license
maybe2009/learning_muduo
0912d7612592ca043c5894d36c4c7a6b4c643da3
c7a4b676e7307eff635340943d8f1dc6b99c5d55
refs/heads/master
2021-01-21T13:43:50.099554
2016-04-28T07:29:40
2016-04-28T07:29:40
55,676,236
0
0
null
null
null
null
UTF-8
C++
false
false
1,604
h
/* * This Code is edited by sun wukong @ 2015.12.16 15:44:08 CST * * Just feel free to use this code as you wish. * Any bug and ugly code, please notify me, thanks! * * Github https://githuc.com/maybe2009 * Gmail qtdssunwukong@gmail.com * -Auto Generated By UltiSnips */ #ifndef __OK_ATOMICINTEGER_INCLUDED__ #define __OK_ATOMICINTEGER_INCLUDED__ #include <stdint.h> namespace ok{ /*********************************************************************** Atomic Integer Template using gcc build-in __sync function set ************************************************************************/ template <typename T> class AtomicInteger { public: AtomicInteger (T val) : data_(val){}; T increment() { return __sync_add_and_fetch(&data_, 1); } T decrement() { return __sync_sub_and_fetch(&data_, 1); } T get() const { return __sync_val_compare_and_swap( const_cast<volatile T*>(&data_), 0, 0); } T addAndGet(T n) { return __sync_add_and_fetch(&data_, n); } T subAndGet(T n) { return __sync_sub_and_fetch(&data_, n); } T getAndAdd(T n) { return __sync_fetch_and_add(&data_, n); } T getAndSub(T n) { return __sync_fetch_and_sub(&data_, n); } private: volatile T data_; }; typedef AtomicInteger<int64_t> AtomicInt64; typedef AtomicInteger<int32_t> AtomicInt32; typedef AtomicInteger<int16_t> AtomicInt16; typedef AtomicInteger<int8_t> AtomicInt8; };//namespace ok #endif /* ifndef __OK_ATOMICINTEGER_INCLUDED__ */
[ "ox07c00@163.com" ]
ox07c00@163.com
eb2deb296ba6e32c2313d68e9059b59670fa99f7
94e5a9e157d3520374d95c43fe6fec97f1fc3c9b
/vjudge/181014 - Matrix Chain Multiplication/G.cpp
1f663817f6f43ec9af85307b5ae1c16107782cb4
[ "MIT" ]
permissive
dipta007/Competitive-Programming
0127c550ad523884a84eb3ea333d08de8b4ba528
998d47f08984703c5b415b98365ddbc84ad289c4
refs/heads/master
2021-01-21T14:06:40.082553
2020-07-06T17:40:46
2020-07-06T17:40:46
54,851,014
8
4
null
2020-05-02T13:14:41
2016-03-27T22:30:02
C++
UTF-8
C++
false
false
3,876
cpp
#pragma comment(linker, "/stack:640000000") #include <algorithm> #include <bitset> #include <cassert> #include <cctype> #include <climits> #include <cmath> #include <cstdio> #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> #include <iomanip> #include <iterator> #include <list> #include <map> #include <numeric> #include <queue> #include <set> #include <sstream> #include <stack> #include <string> #include <utility> #include <vector> using namespace std; const double EPS = 1e-9; const int INF = 0x7f7f7f7f; const double PI=acos(-1.0); #define READ(f) freopen(f, "r", stdin) #define WRITE(f) freopen(f, "w", stdout) #define MP(x, y) make_pair(x, y) #define PB(x) push_back(x) #define rep(i,n) for(int i = 1 ; i<=(n) ; i++) #define repI(i,n) for(int i = 0 ; i<(n) ; i++) #define FOR(i,L,R) for (int i = (int)(L); i <= (int)(R); i++) #define ROF(i,L,R) for (int i = (int)(L); i >= (int)(R); i--) #define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++) #define ALL(p) p.begin(),p.end() #define ALLR(p) p.rbegin(),p.rend() #define SET(p) memset(p, -1, sizeof(p)) #define CLR(p) memset(p, 0, sizeof(p)) #define MEM(p, v) memset(p, v, sizeof(p)) #define getI(a) scanf("%d", &a) #define getII(a,b) scanf("%d%d", &a, &b) #define getIII(a,b,c) scanf("%d%d%d", &a, &b, &c) #define getL(a) scanf("%lld",&a) #define getLL(a,b) scanf("%lld%lld",&a,&b) #define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c) #define getC(n) scanf("%c",&n) #define getF(n) scanf("%lf",&n) #define getS(n) scanf("%s",n) #define bitCheck(N,in) ((bool)(N&(1<<(in)))) #define bitOff(N,in) (N&(~(1<<(in)))) #define bitOn(N,in) (N|(1<<(in))) #define bitCount(a) __builtin_popcount(a) #define iseq(a,b) (fabs(a-b)<EPS) #define UNIQUE(V) (V).erase(unique((V).begin(),(V).end()),(V).end()) #define vi vector < int > #define vii vector < vector < int > > #define pii pair< int, int > #define ff first #define ss second #define ll long long #define ull unsigned long long template< class T > inline T _abs(T n) { return ((n) < 0 ? -(n) : (n)); } template< class T > inline T _max(T a, T b) { return (!((a)<(b))?(a):(b)); } template< class T > inline T _min(T a, T b) { return (((a)<(b))?(a):(b)); } template< class T > inline T _swap(T &a, T &b) { a=a^b;b=a^b;a=a^b;} template< class T > inline T gcd(T a, T b) { return (b) == 0 ? (a) : gcd((b), ((a) % (b))); } template< class T > inline T lcm(T a, T b) { return ((a) / gcd((a), (b)) * (b)); } template <typename T> string NumberToString ( T Number ) { ostringstream ss; ss << Number; return ss.str(); } #ifdef dipta007 #define debug(args...) {cerr<<"Debug: "; dbg,args; cerr<<endl;} #else #define debug(args...) // Just strip off all debug tokens #endif struct debugger{ template<typename T> debugger& operator , (const T& v){ cerr<<v<<" "; return *this; } }dbg; int n,a[500]; int dp[504][504][2]; int call(int beg, int end, int flg) { if(beg > end) return 0; int &ret = dp[beg][end][flg]; if(ret!=-1) return ret; ret = flg + call(beg+1, end, 1); FOR(i, beg+1, end) { if(a[i] == a[beg]) { ret = min(ret, flg + call(beg+1, i-1, 0) + call(i+1, end, 1)); } } return ret; } int main() { #ifdef dipta007 //READ("in.txt"); // WRITE("out.txt"); #endif // dipta007 // ios_base::sync_with_stdio(0);cin.tie(0); while(~getI(n)) { FOR(i,0,n-1) getI(a[i]); SET(dp); printf("%d\n",call(0, n-1, 1)); } return 0; }
[ "shubhashis.roy@selise.ch" ]
shubhashis.roy@selise.ch
41145ede334ab9ba6a5968af8219c7351ce17589
3fc856fb394f76bb1b58401abde83d13b8ac8df1
/applications/ArrayCam/testing/autoFocus/source/ArrayCamUtils.cpp
a8cf84b58a5ef0160864cfca0b1a4849a679323d
[ "LicenseRef-scancode-unknown-license-reference", "Apache-2.0", "BSL-1.0" ]
permissive
TotteKarlsson/ArrayBot
69d9ad26f7614ce36eb0aee919fd4868daef953c
d0e11186abd5b380ebba6e432f642d04a947e5aa
refs/heads/master
2022-11-18T17:33:35.411944
2018-12-18T17:41:08
2018-12-18T17:41:08
57,317,749
2
1
null
null
null
null
UTF-8
C++
false
false
1,330
cpp
#pragma hdrstop #include "ArrayCamUtils.h" #include "dslUtils.h" #include "dslIPCMessageEnums.h" #include "dslLogger.h" //--------------------------------------------------------------------------- #pragma package(smart_init) using namespace dsl; //--------------------------------------------------------------------------- int getArrayCamIPCMessageID(const string& cs) { if(compareStrings(cs, "START_RECORDING_VIDEO", csCaseInsensitive)) return cStartRecordingVideo; if(compareStrings(cs, "STOP_RECORDING_VIDEO", csCaseInsensitive)) return cStopRecordingVideo; return getIPCMessageID(cs); } //--------------------------------------------------------------------------- string getArrayCamIPCMessageName(int cs) { switch (cs) { case cStartRecordingVideo: return "START_RECORDING_VIDEO"; case cStopRecordingVideo: return "STOP_RECORDING_VIDEO"; default: return getIPCMessageName(cs); } } //int extractCoverSlipID(const string& bc) //{ // string temp(bc); // //Make sure first char is a 'C' // if(!bc.size() || bc[0] != 'C') // { // Log(lError) << bc << " is not a valid barcode!"; // return -1; // } // // temp.erase(0,1); // int id = toInt(temp); // Log(lDebug3) << "Extracted id "<<id<<" from "<<bc; // return id; //}
[ "tottek@gmail.com" ]
tottek@gmail.com
637e4bd19074dd69c526a36662c3b4e88ac2e7e1
519de3b9fca2d6f905e7f3498884094546432c30
/kk-4.x/frameworks/av/media/libmediaplayerservice/nuplayer/StreamingSource.h
ce7be8bae9de93892cc9cec762ac2a00da2a3280
[ "Apache-2.0", "LicenseRef-scancode-unicode" ]
permissive
hongshui3000/mt5507_android_4.4
2324e078190b97afbc7ceca22ec1b87b9367f52a
880d4424989cf91f690ca187d6f0343df047da4f
refs/heads/master
2020-03-24T10:34:21.213134
2016-02-24T05:57:53
2016-02-24T05:57:53
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,571
h
/* * Copyright (C) 2010 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef STREAMING_SOURCE_H_ #define STREAMING_SOURCE_H_ #include "NuPlayer.h" #include "NuPlayerSource.h" namespace android { struct ABuffer; struct ATSParser; struct NuPlayer::StreamingSource : public NuPlayer::Source { StreamingSource( const sp<AMessage> &notify, const sp<IStreamSource> &source); virtual void prepareAsync(); virtual void setUrlBeforeSeek(const char *url); virtual void start(); virtual status_t feedMoreTSData(); virtual status_t dequeueAccessUnit(bool audio, sp<ABuffer> *accessUnit); virtual bool isRealTime() const; protected: virtual ~StreamingSource(); virtual sp<MetaData> getFormatMeta(bool audio); private: sp<IStreamSource> mSource; status_t mFinalResult; sp<NuPlayerStreamListener> mStreamListener; sp<ATSParser> mTSParser; DISALLOW_EVIL_CONSTRUCTORS(StreamingSource); }; } // namespace android #endif // STREAMING_SOURCE_H_
[ "342981011@qq.com" ]
342981011@qq.com
8672190c2e1e6f4425bd2880e9454852b63934ac
f5dc059a4311bc542af480aa8e8784965d78c6e7
/scimath/Functionals/CompoundFunction.h
6170f4cb988441b93e2f66ba1f2d07455bc1e2b5
[]
no_license
astro-informatics/casacore-1.7.0_patched
ec166dc4a13a34ed433dd799393e407d077a8599
8a7cbf4aa79937fba132cf36fea98f448cc230ea
refs/heads/master
2021-01-17T05:26:35.733411
2015-03-24T11:08:55
2015-03-24T11:08:55
32,793,738
2
0
null
null
null
null
UTF-8
C++
false
false
10,851
h
//# CompoundFunction.h: Sum of a collection of Functions //# Copyright (C) 2001,2002,2005 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# //# $Id: CompoundFunction.h 21024 2011-03-01 11:46:18Z gervandiepen $ #ifndef SCIMATH_COMPOUNDFUNCTION_H #define SCIMATH_COMPOUNDFUNCTION_H //# Includes #include <casa/aips.h> #include <scimath/Functionals/CompoundParam.h> #include <scimath/Functionals/Function.h> #include <scimath/Mathematics/AutoDiff.h> #include <scimath/Mathematics/AutoDiffMath.h> namespace casa { //# NAMESPACE CASA - BEGIN //# Forward declarations // <summary> // Sum of a collection of Functions which behaves as one Function object. // </summary> // <use visibility=export> // <reviewed reviewer="tcornwel" date="1996/02/22" tests="tCompoundFunction" // demos=""> // </reviewed> // <prerequisite> // <li> <linkto class="Function">Function</linkto> class // </prerequisite> // // <synopsis> // This class takes an arbitrary number of Function objects, and generates // a new, single function object. The parameters of the compound object // are the union of all the parameters in the input objects. // // When CompoundFunction is evaluated, the result is the sum of // all the individual function values. // // Member functions are added with the <src>addFunction()</src> method. // // In general the interaction with the function parameters should be through // the overall function parameters (i.e. through the parameters of the // <src>CompoundFunction</src>). If for any reason you want to set the // parameters of an individual function (see e.g. the example in the // <linkto class=Fit2D>Fit2D</linkto>), call <src>consolidate()</src> before // abd after the actual setting. // // <note role=tip> // Check <linkto class=CompoundFunction>CombiFunction</linkto> class // for a simple linear combination of function objects </note> // </synopsis> // // <example> // Suppose for some reason we wanted the sum of <src>x^2</src> plus a gaussian. // We could form it as follows: // <srcblock> // Polynomial<Float> x2(2); // x[2] = 1.0; // x^2 // Gaussian1D<Float> gauss(1.0, 0.0, 1.0); // e^{-x^2} // CompoundParam<Float> sum; // sum == 0.0 // sum.addFunction(x2); // sum == x^2 // sum.addFunction(gauss); // sum == x^2+e^{-x^2} // sum(2.0); // == 4 + e^-4 // CompoundParam[0] = 2.0; // sum ==2x^2+e^{-x^2} // sum(2.0); // == 8 + e^-4 // </srcblock> // </example> // <templating arg=T> // <li> T should have standard numerical operators and exp() function. Current // implementation only tested for real types. // <li> To obtain derivatives, the derivatives should be defined. // </templating> // <thrown> // <li> AipsError if dimensions of functions added different // </thrown> // <motivation> // This class was created to allow a non-linear least squares fitter to fit a // (potentially) arbitrary number of functions (typically Gaussians). // </motivation> // // <todo asof="2001/10/22"> // <li> Nothing I know of // </todo> template <class T> class CompoundFunction : public CompoundParam<T> { public: //# Constructors // The default constructor -- no functions, no parameters, nothing, the // function operator returns a 0. CompoundFunction() : CompoundParam<T>() {} // Make this object a (deep) copy of other. If parameters have been set // without an intervening calculation, a <src>consolidate()</src> could // be necessary on <em>other</em> first. // <group> CompoundFunction(const CompoundFunction<T> &other) : CompoundParam<T>(other) {} CompoundFunction(const CompoundFunction<T> &other, Bool) : CompoundParam<T>(other, True) {} template <class W> CompoundFunction(const CompoundFunction<W> &other) : CompoundParam<T>(other) {} template <class W> CompoundFunction(const CompoundFunction<W> &other, Bool) : CompoundParam<T>(other, True) {} // </group> // Make this object a (deep) copy of other. CompoundFunction<T> &operator=(const CompoundFunction<T> &other) { other.fromParam_p(); CompoundParam<T>::operator=(other); return *this; } // Destructor virtual ~CompoundFunction() {} //# Operators // Evaluate the function at <src>x</src>. virtual T eval(typename Function<T>::FunctionArg x) const; //# Member functions // Consolidate the parameter settings. This could be necessary if // parameters have been set, and a copy constructor called. This is // necessary before and after the setting of <em>local</em> parameters; i.e. // the parameters of the individual functions. CompoundFunction<T> &consolidate() { fromParam_p(); toParam_p(); return *this; } // Return a copy of this object from the heap. The caller is responsible for // deleting the pointer. // <group> virtual Function<T> *clone() const { fromParam_p(); return new CompoundFunction<T>(*this); } virtual Function<typename FunctionTraits<T>::DiffType> *cloneAD() const { return new CompoundFunction<typename FunctionTraits<T>::DiffType>(*this); } virtual Function<typename FunctionTraits<T>::BaseType> *cloneNonAD() const { return new CompoundFunction<typename FunctionTraits<T>::BaseType> (*this, True); } // </group> private: //# Member functions // Copy the local parameters from general block void fromParam_p() const; // Make the general block from local parameters void toParam_p(); //# Make members of parent classes known. protected: using CompoundParam<T>::parset_p; using CompoundParam<T>::param_p; using CompoundParam<T>::funpar_p; using CompoundParam<T>::locpar_p; using CompoundParam<T>::paroff_p; using CompoundParam<T>::functionPtr_p; public: using CompoundParam<T>::nparameters; using CompoundParam<T>::nFunctions; using CompoundParam<T>::function; }; #define CompoundFunction_PS CompoundFunction // <summary> Partial <src>AutoDiff</src> specialization of CompoundFunction // </summary> // <synopsis> // <note role=warning> The name <src>CompoundFunction_PS</src> is only // for cxx2html documentation problems. Use // <src>CompoundFunction</src> in your code.</note> // </synopsis> template <class T> class CompoundFunction_PS<AutoDiff<T> > : public CompoundParam<AutoDiff<T> > { public: //# Constructors // The default constructor -- no functions, no parameters, nothing, the // function operator returns a 0. CompoundFunction_PS() : CompoundParam<AutoDiff<T> >() {} // Make this object a (deep) copy of other. If parameters have been set // without an intervening calculation, a <src>consolidate()</src> could // be necessary on <em>other</em> first. // <group> CompoundFunction_PS(const CompoundFunction_PS<AutoDiff<T> > &other) : CompoundParam<AutoDiff<T> >(other) {} template <class W> CompoundFunction_PS(const CompoundFunction_PS<W> &other) : CompoundParam<AutoDiff<T> >(other) {} // </group> // Make this object a (deep) copy of other. CompoundFunction_PS<AutoDiff<T> > & operator=(const CompoundFunction_PS<AutoDiff<T> > &other) { fromParam_p(); CompoundParam<AutoDiff<T> >::operator=(other); return *this; } // Destructor virtual ~CompoundFunction_PS() {} //# Operators // Evaluate the function and its derivatives at <src>x</src> <em>wrt</em> // to the coefficients. virtual AutoDiff<T> eval(typename Function<AutoDiff<T> >::FunctionArg x) const; //# Member functions // Add a function to the sum. All functions must have the same // <src>ndim()</src> as the first one. Returns the (zero relative) number // of the function just added. uInt addFunction(const Function<AutoDiff<T> > &newFunction); // Consolidate the parameter settings. This could be necessary if // parameters have been set, and a copy constructor called. This is // necessary before and after the setting of <em>local</em> parameters; i.e. // the parameters of the individual functions. CompoundFunction_PS<AutoDiff<T> > &consolidate() { fromParam_p(); toParam_p(); return *this; } // Return a copy of this object from the heap. The caller is responsible for // deleting the pointer. // <group> virtual Function<AutoDiff<T> > *clone() const { fromParam_p(); return new CompoundFunction<AutoDiff<T> >(*this); } virtual Function<typename FunctionTraits<AutoDiff<T> >::DiffType> *cloneAD() const { return new CompoundFunction<typename FunctionTraits<AutoDiff<T> >::DiffType> (*this); } virtual Function<typename FunctionTraits<AutoDiff<T> >::BaseType> *cloneNonAD() const { return new CompoundFunction<typename FunctionTraits<AutoDiff<T> >::BaseType> (*this, True); } // </group> private: //# Member functions // Copy the local parameters to/from general block void fromParam_p() const; // Make the general block from local parameters void toParam_p(); //# Make members of parent classes known. protected: using CompoundParam<AutoDiff<T> >::parset_p; using CompoundParam<AutoDiff<T> >::param_p; using CompoundParam<AutoDiff<T> >::funpar_p; using CompoundParam<AutoDiff<T> >::locpar_p; using CompoundParam<AutoDiff<T> >::paroff_p; using CompoundParam<AutoDiff<T> >::functionPtr_p; public: using CompoundParam<AutoDiff<T> >::nparameters; using CompoundParam<AutoDiff<T> >::nFunctions; using CompoundParam<AutoDiff<T> >::function; }; #undef CompoundFunction_PS } //# NAMESPACE CASA - END #ifndef CASACORE_NO_AUTO_TEMPLATES #include <scimath/Functionals/CompoundFunction.tcc> #include <scimath/Functionals/Compound2Function.tcc> #endif //# CASACORE_NO_AUTO_TEMPLATES #endif
[ "jason.mcewen@ucl.ac.uk" ]
jason.mcewen@ucl.ac.uk
860d2e10ddad3daf9bec59dadc28a8bf28f46ca3
bb62c6e70b7b536e658f2c045e224735fb2e9532
/src/tools/tools/src/assets/importers/audio_importer.cpp
4fec96d74565deeee3b7250e9f2d647bb1754fba
[ "Apache-2.0" ]
permissive
kariem2k/halley
b66173ef200e9b3479c433f6fd89f2e0a54f585f
6f2d09b06e49ec22ffc1457b7eda6bcd888b796d
refs/heads/master
2020-09-20T14:32:06.167665
2019-11-28T12:13:37
2019-11-28T12:15:19
224,511,194
1
0
Apache-2.0
2019-11-27T20:23:35
2019-11-27T20:23:35
null
UTF-8
C++
false
false
7,098
cpp
#include "audio_importer.h" #include "halley/tools/assets/import_assets_database.h" #include "halley/bytes/byte_serializer.h" #include "halley/resources/metadata.h" #include "halley/audio/vorbis_dec.h" #include "halley/audio/resampler.h" #include "ogg/ogg.h" #include "vorbis/codec.h" #include "vorbis/vorbisenc.h" #include "halley/concurrency/concurrent.h" #include "halley/tools/file/filesystem.h" #include "halley/text/string_converter.h" #include "halley/resources/resource_data.h" #include "halley/support/logger.h" using namespace Halley; void AudioImporter::import(const ImportingAsset& asset, IAssetCollector& collector) { Path mainFile = asset.inputFiles.at(0).name; auto& rawData = asset.inputFiles[0].data; auto resData = std::make_shared<ResourceDataStatic>(rawData.data(), rawData.size(), mainFile.string(), false); Bytes encodedData; const Bytes* fileData = &rawData; std::vector<std::vector<float>> samples; int numChannels = 0; int sampleRate = 0; bool needsEncoding = false; bool needsResampling = false; if (mainFile.getExtension() == ".ogg") { // assuming Ogg Vorbis // Load vorbis data VorbisData vorbis(resData); numChannels = vorbis.getNumChannels(); size_t numSamples = vorbis.getNumSamples(); sampleRate = vorbis.getSampleRate(); samples.resize(numChannels); for (size_t i = 0; i < numChannels; ++i) { samples[i].resize(numSamples); } // Decode if (sampleRate != 48000) { vorbis.read(samples); needsResampling = true; } } else { throw Exception("Unsupported audio format: " + mainFile.getExtension(), HalleyExceptions::Tools); } // Resample if (needsResampling) { // Resample Logger::logWarning(asset.assetId + " requires resampling from " + toString(sampleRate) + " to 48000 Hz."); Concurrent::foreach(std::begin(samples), std::end(samples), [&] (std::vector<float>& s) { s = resampleChannel(sampleRate, 48000, s); }); sampleRate = 48000; needsEncoding = true; } // Encode to vorbis if (needsEncoding) { encodedData = encodeVorbis(numChannels, sampleRate, samples); fileData = &encodedData; samples.clear(); } // Write metadata Metadata meta = asset.inputFiles.at(0).metadata; meta.set("channels", numChannels); meta.set("sampleRate", sampleRate); // Output collector.output(asset.assetId, AssetType::AudioClip, *fileData, meta); } static void onVorbisError(int error) { String str; switch (error) { case OV_EREAD: str = "A read from media returned an error."; break; case OV_ENOTVORBIS: str = "Bitstream does not contain any Vorbis data."; break; case OV_EVERSION: str = "Vorbis version mismatch."; break; case OV_EBADHEADER: str = "Invalid Vorbis bitstream header."; break; case OV_EFAULT: str = "Internal logic fault; indicates a bug or heap/stack corruption."; break; case OV_HOLE: str = "Indicates there was an interruption in the data."; break; case OV_EBADLINK: str = "Indicates that an invalid stream section was supplied to libvorbisfile, or the requested link is corrupt."; break; case OV_EINVAL: str = "Indicates the initial file headers couldn't be read or are corrupt, or that the initial open call for vf failed."; break; case OV_ENOSEEK: str = "Stream is not seekable."; break; default: str = "Unknown error."; } throw Exception("Error opening Ogg Vorbis: "+str, HalleyExceptions::Tools); } static void writeBytes(Bytes& dst, gsl::span<const gsl::byte> src) { size_t start = dst.size(); size_t size = src.size(); dst.resize(start + size); memcpy(dst.data() + start, src.data(), size); } static void outputPacket(Bytes& dst, ogg_packet& packet, ogg_stream_state& os, bool& eos) { ogg_page og; ogg_stream_packetin(&os, &packet); while (!eos) { int result = ogg_stream_pageout(&os, &og); if (result == 0) { break; } writeBytes(dst, gsl::as_bytes(gsl::span<char>(reinterpret_cast<char*>(og.header), og.header_len))); writeBytes(dst, gsl::as_bytes(gsl::span<char>(reinterpret_cast<char*>(og.body), og.body_len))); if (ogg_page_eos(&og)) { eos = true; } } } Bytes AudioImporter::encodeVorbis(int nChannels, int sampleRate, gsl::span<const std::vector<float>> src) { Bytes result; int ret = 0; bool eos = false; ogg_stream_state os; ogg_stream_init(&os, 0); // Based on steps from https://xiph.org/vorbis/doc/libvorbis/overview.html // 1. vorbis_info vi; vorbis_info_init(&vi); ret = vorbis_encode_init_vbr(&vi, long(nChannels), long(sampleRate), 0.5f); if (ret) { onVorbisError(ret); } // 2. vorbis_dsp_state v; vorbis_analysis_init(&v, &vi); // 3. vorbis_comment vc; { ogg_packet header; ogg_packet header_comm; ogg_packet header_code; vorbis_comment_init(&vc); vorbis_comment_add_tag(&vc, "ENCODER", "Halley"); ret = vorbis_analysis_headerout(&v, &vc, &header, &header_comm, &header_code); if (ret) { onVorbisError(ret); } ogg_stream_packetin(&os, &header); ogg_stream_packetin(&os, &header_comm); ogg_stream_packetin(&os, &header_code); ogg_page og; while (!eos) { ret = ogg_stream_flush(&os, &og); if (ret == 0) { break; } writeBytes(result, gsl::as_bytes(gsl::span<char>(reinterpret_cast<char*>(og.header), og.header_len))); writeBytes(result, gsl::as_bytes(gsl::span<char>(reinterpret_cast<char*>(og.body), og.body_len))); } } // 4. vorbis_block vb; ogg_packet op; ret = vorbis_block_init(&v, &vb); if (ret) { onVorbisError(ret); } // 5. / 6. constexpr int bufferSize = 1024; size_t pos = 0; size_t len = src[0].size(); while (!eos) { // 5.1. Expects(pos <= len); size_t samplesToWrite = std::min(len - pos, size_t(bufferSize)); float** buffers = vorbis_analysis_buffer(&v, bufferSize); for (size_t i = 0; i < nChannels; ++i) { for (int j = 0; j < samplesToWrite; ++j) { buffers[i][j] = src[i][j + pos]; } } pos += samplesToWrite; ret = vorbis_analysis_wrote(&v, int(samplesToWrite)); if (ret) { onVorbisError(ret); } // 5.2. while (vorbis_analysis_blockout(&v, &vb) == 1) { // 5.2.1. ret = vorbis_analysis(&vb, nullptr); if (ret) { onVorbisError(ret); } // 5.2.2. ret = vorbis_bitrate_addblock(&vb); if (ret) { onVorbisError(ret); } while (vorbis_bitrate_flushpacket(&v, &op)) { // 5.2.3. outputPacket(result, op, os, eos); } } if (samplesToWrite == 0) { eos = true; } } // 7. vorbis_comment_clear(&vc); vorbis_block_clear(&vb); vorbis_dsp_clear(&v); vorbis_info_clear(&vi); ogg_stream_clear(&os); return result; } std::vector<float> AudioImporter::resampleChannel(int from, int to, gsl::span<const float> src) { AudioResampler resampler(from, to, 1, 1.0f); std::vector<float> dst(resampler.numOutputSamples(src.size()) + 1024); auto result = resampler.resampleInterleaved(src, dst); if (result.nRead != src.size()) { throw Exception("Only read " + toString(result.nRead) + " samples, expected " + toString(src.size()), HalleyExceptions::Tools); } if (result.nWritten == dst.size()) { throw Exception("Resample dst buffer overflow.", HalleyExceptions::Tools); } dst.resize(result.nWritten); return dst; }
[ "archmagezeratul@gmail.com" ]
archmagezeratul@gmail.com
8e3297fa8bc04d6f6e9f52c04a072bd4e9b86a58
8f512f6c3f3ec78d5e3e8721b373b2410c7285b2
/hw5110/hw5110.ino
600b2de225404e800fad25b499706d5a621c70db
[]
no_license
khawajamechatronics/Arduino-1
d9882fd96b89c273d1a7eb68e717c7c127b2580a
ef31fc3443c36e3fa20f7c2c91d49f2579ee05c6
refs/heads/master
2020-03-28T05:54:17.246651
2017-12-26T08:56:12
2017-12-26T08:56:12
null
0
0
null
null
null
null
UTF-8
C++
false
false
17,722
ino
/* 7-17-2011 Spark Fun Electronics 2011 Nathan Seidle This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license). This code writes a series of images and text to the Nokia 5110 84x48 graphic LCD: http://www.sparkfun.com/products/10168 Do not drive the backlight with 5V. It will smoke. However, the backlight on the LCD seems to be happy with direct drive from the 3.3V regulator. Although the PCD8544 controller datasheet recommends 3.3V, the graphic Nokia 5110 LCD can run at 3.3V or 5V. No resistors needed on the signal lines. You will need 5 signal lines to connect to the LCD, 3.3 or 5V for power, 3.3V for LED backlight, and 1 for ground. */ #define PIN_SCE 7 //Pin 3 on LCD #define PIN_RESET 6 //Pin 4 on LCD #define PIN_DC 5 //Pin 5 on LCD #define PIN_SDIN 4 //Pin 6 on LCD #define PIN_SCLK 3 //Pin 7 on LCD //The DC pin tells the LCD if we are sending a command or data #define LCD_COMMAND 0 #define LCD_DATA 1 //You may find a different size screen, but this one is 84 by 48 pixels #define LCD_X 84 #define LCD_Y 48 //This table contains the hex values that represent pixels //for a font that is 5 pixels wide and 8 pixels high static const byte ASCII[][5] = { {0x00, 0x00, 0x00, 0x00, 0x00} // 20 ,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 ! ,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 " ,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 # ,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $ ,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 % ,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 & ,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 ' ,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 ( ,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 ) ,{0x14, 0x08, 0x3e, 0x08, 0x14} // 2a * ,{0x08, 0x08, 0x3e, 0x08, 0x08} // 2b + ,{0x00, 0x50, 0x30, 0x00, 0x00} // 2c , ,{0x08, 0x08, 0x08, 0x08, 0x08} // 2d - ,{0x00, 0x60, 0x60, 0x00, 0x00} // 2e . ,{0x20, 0x10, 0x08, 0x04, 0x02} // 2f / ,{0x3e, 0x51, 0x49, 0x45, 0x3e} // 30 0 ,{0x00, 0x42, 0x7f, 0x40, 0x00} // 31 1 ,{0x42, 0x61, 0x51, 0x49, 0x46} // 32 2 ,{0x21, 0x41, 0x45, 0x4b, 0x31} // 33 3 ,{0x18, 0x14, 0x12, 0x7f, 0x10} // 34 4 ,{0x27, 0x45, 0x45, 0x45, 0x39} // 35 5 ,{0x3c, 0x4a, 0x49, 0x49, 0x30} // 36 6 ,{0x01, 0x71, 0x09, 0x05, 0x03} // 37 7 ,{0x36, 0x49, 0x49, 0x49, 0x36} // 38 8 ,{0x06, 0x49, 0x49, 0x29, 0x1e} // 39 9 ,{0x00, 0x36, 0x36, 0x00, 0x00} // 3a : ,{0x00, 0x56, 0x36, 0x00, 0x00} // 3b ; ,{0x08, 0x14, 0x22, 0x41, 0x00} // 3c < ,{0x14, 0x14, 0x14, 0x14, 0x14} // 3d = ,{0x00, 0x41, 0x22, 0x14, 0x08} // 3e > ,{0x02, 0x01, 0x51, 0x09, 0x06} // 3f ? ,{0x32, 0x49, 0x79, 0x41, 0x3e} // 40 @ ,{0x7e, 0x11, 0x11, 0x11, 0x7e} // 41 A ,{0x7f, 0x49, 0x49, 0x49, 0x36} // 42 B ,{0x3e, 0x41, 0x41, 0x41, 0x22} // 43 C ,{0x7f, 0x41, 0x41, 0x22, 0x1c} // 44 D ,{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E ,{0x7f, 0x09, 0x09, 0x09, 0x01} // 46 F ,{0x3e, 0x41, 0x49, 0x49, 0x7a} // 47 G ,{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H ,{0x00, 0x41, 0x7f, 0x41, 0x00} // 49 I ,{0x20, 0x40, 0x41, 0x3f, 0x01} // 4a J ,{0x7f, 0x08, 0x14, 0x22, 0x41} // 4b K ,{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L ,{0x7f, 0x02, 0x0c, 0x02, 0x7f} // 4d M ,{0x7f, 0x04, 0x08, 0x10, 0x7f} // 4e N ,{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O ,{0x7f, 0x09, 0x09, 0x09, 0x06} // 50 P ,{0x3e, 0x41, 0x51, 0x21, 0x5e} // 51 Q ,{0x7f, 0x09, 0x19, 0x29, 0x46} // 52 R ,{0x46, 0x49, 0x49, 0x49, 0x31} // 53 S ,{0x01, 0x01, 0x7f, 0x01, 0x01} // 54 T ,{0x3f, 0x40, 0x40, 0x40, 0x3f} // 55 U ,{0x1f, 0x20, 0x40, 0x20, 0x1f} // 56 V ,{0x3f, 0x40, 0x38, 0x40, 0x3f} // 57 W ,{0x63, 0x14, 0x08, 0x14, 0x63} // 58 X ,{0x07, 0x08, 0x70, 0x08, 0x07} // 59 Y ,{0x61, 0x51, 0x49, 0x45, 0x43} // 5a Z ,{0x00, 0x7f, 0x41, 0x41, 0x00} // 5b [ ,{0x02, 0x04, 0x08, 0x10, 0x20} // 5c \ ,{0x00, 0x41, 0x41, 0x7f, 0x00} // 5d ] ,{0x04, 0x02, 0x01, 0x02, 0x04} // 5e ^ ,{0x40, 0x40, 0x40, 0x40, 0x40} // 5f _ ,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 ,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 // without this we get offset by 1 ,{0x20, 0x54, 0x54, 0x54, 0x78} // 61 a ,{0x7f, 0x48, 0x44, 0x44, 0x38} // 62 b ,{0x38, 0x44, 0x44, 0x44, 0x20} // 63 c ,{0x38, 0x44, 0x44, 0x48, 0x7f} // 64 d ,{0x38, 0x54, 0x54, 0x54, 0x18} // 65 e ,{0x08, 0x7e, 0x09, 0x01, 0x02} // 66 f ,{0x0c, 0x52, 0x52, 0x52, 0x3e} // 67 g ,{0x7f, 0x08, 0x04, 0x04, 0x78} // 68 h ,{0x00, 0x44, 0x7d, 0x40, 0x00} // 69 i ,{0x20, 0x40, 0x44, 0x3d, 0x00} // 6a j ,{0x7f, 0x10, 0x28, 0x44, 0x00} // 6b k ,{0x00, 0x41, 0x7f, 0x40, 0x00} // 6c l ,{0x7c, 0x04, 0x18, 0x04, 0x78} // 6d m ,{0x7c, 0x08, 0x04, 0x04, 0x78} // 6e n ,{0x38, 0x44, 0x44, 0x44, 0x38} // 6f o ,{0x7c, 0x14, 0x14, 0x14, 0x08} // 70 p ,{0x08, 0x14, 0x14, 0x18, 0x7c} // 71 q ,{0x7c, 0x08, 0x04, 0x04, 0x08} // 72 r ,{0x48, 0x54, 0x54, 0x54, 0x20} // 73 s ,{0x04, 0x3f, 0x44, 0x40, 0x20} // 74 t ,{0x3c, 0x40, 0x40, 0x20, 0x7c} // 75 u ,{0x1c, 0x20, 0x40, 0x20, 0x1c} // 76 v ,{0x3c, 0x40, 0x30, 0x40, 0x3c} // 77 w ,{0x44, 0x28, 0x10, 0x28, 0x44} // 78 x ,{0x0c, 0x50, 0x50, 0x50, 0x3c} // 79 y ,{0x44, 0x64, 0x54, 0x4c, 0x44} // 7a z ,{0x00, 0x08, 0x36, 0x41, 0x00} // 7b { ,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c | ,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d } ,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ~ ,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f DEL }; //This is the SFE flame in bit form char SFEFlame[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0xF8, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0x1E, 0x0E, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x0F, 0x1F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0xF8, 0xF0, 0xF8, 0xFE, 0xFE, 0xFC, 0xF8, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF8, 0xFC, 0xFE, 0xFE, 0xFF, 0xFF, 0xF3, 0xE0, 0xE0, 0xC0, 0xC0, 0xC0, 0xE0, 0xE0, 0xF1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x1F, 0x0F, 0x0F, 0x0F, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x03, 0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x1F, 0x0F, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; //Another SparkFun logo char SFEFlameBubble [] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xC0, 0xE0, 0xE0, 0xF0, 0xF8, 0xF8, 0xFC, 0xFC, 0xFC, 0xFC, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFE, 0xFC, 0xFC, 0xFC, 0xFC, 0xFC, 0xF8, 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xE0, 0xF8, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x7F, 0x3F, 0x3F, 0x3F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xFC, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x1F, 0x0F, 0x3F, 0x7F, 0x7F, 0x3F, 0x1E, 0x0E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0F, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x3F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFC, 0xF0, 0xE0, 0xE0, 0xC0, 0xC0, 0xE0, 0xE0, 0xE0, 0xF0, 0xF8, 0x7C, 0x7C, 0x7E, 0x7C, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x1F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x3F, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8, 0xF0, 0xF0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE0, 0xE1, 0xE3, 0xE3, 0xE7, 0xEF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE, 0xFC, 0xF8, 0xF0, 0xE0, 0xC0, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x07, 0x0F, 0x1F, 0x1F, 0x1F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7F, 0x7E, 0x7C, 0x78, 0x70, 0x60, 0x40, 0x40, 0x00, 0x00, }; //This is awesome in bitmap form char awesome[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xC0, 0xE0, 0x70, 0x30, 0x18, 0x1C, 0x0C, 0x0C, 0x06, 0x06, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x07, 0x07, 0x07, 0x0E, 0x06, 0x1C, 0x1C, 0x38, 0x70, 0x70, 0xE0, 0xE0, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xF0, 0x3C, 0xCE, 0x67, 0x33, 0x18, 0x08, 0x08, 0xC8, 0xF8, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x70, 0x38, 0x18, 0x18, 0x08, 0x08, 0x08, 0xF8, 0xF0, 0xF0, 0xE0, 0xC0, 0x00, 0x00, 0x01, 0x07, 0x0F, 0x3C, 0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFC, 0xFF, 0x0F, 0x00, 0x0C, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x61, 0x61, 0x7F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7F, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x60, 0x61, 0x61, 0x61, 0x61, 0x63, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xFF, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x08, 0x08, 0xFC, 0x8C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0x0C, 0xF8, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xFF, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x0F, 0x3C, 0x70, 0xE0, 0x80, 0x00, 0x07, 0x0C, 0x38, 0x60, 0xC0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xE0, 0xF0, 0xF0, 0xF0, 0xF8, 0xF8, 0xF8, 0xF8, 0xF0, 0xF0, 0xE0, 0xC0, 0x80, 0xC0, 0x30, 0x18, 0x0F, 0x00, 0x00, 0x80, 0xC0, 0x70, 0x3C, 0x1F, 0x07, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x06, 0x0E, 0x1C, 0x18, 0x38, 0x31, 0x73, 0x62, 0x66, 0x64, 0xC7, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xCF, 0xC7, 0xC7, 0xC7, 0x67, 0x63, 0x63, 0x71, 0x30, 0x38, 0x18, 0x1C, 0x0C, 0x06, 0x03, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, }; void setup(void) { LCDInit(); //Init the LCD } void loop(void) { LCDClear(); LCDBitmap(SFEFlame); delay(1000); LCDClear(); LCDBitmap(SFEFlameBubble); delay(1000); LCDClear(); LCDBitmap(awesome); delay(1000); LCDClear(); LCDString("Hello World!"); // LCDString("ABCDEFGHIJKLMNOPQRSTUVWXYZ"); // LCDString("abcdefghijklmnopqrstuvwxyz"); delay(1000); } void gotoXY(int x, int y) { LCDWrite(0, 0x80 | x); // Column. LCDWrite(0, 0x40 | y); // Row. ? } //This takes a large array of bits and sends them to the LCD void LCDBitmap(char my_array[]){ for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++) LCDWrite(LCD_DATA, my_array[index]); } //This function takes in a character, looks it up in the font table/array //And writes it to the screen //Each character is 8 bits tall and 5 bits wide. We pad one blank column of //pixels on each side of the character for readability. void LCDCharacter(char character) { LCDWrite(LCD_DATA, 0x00); //Blank vertical line padding for (int index = 0 ; index < 5 ; index++) LCDWrite(LCD_DATA, ASCII[character - 0x20][index]); //0x20 is the ASCII character for Space (' '). The font table starts with this character LCDWrite(LCD_DATA, 0x00); //Blank vertical line padding } //Given a string of characters, one by one is passed to the LCD void LCDString(char *characters) { while (*characters) LCDCharacter(*characters++); } //Clears the LCD by writing zeros to the entire screen void LCDClear(void) { for (int index = 0 ; index < (LCD_X * LCD_Y / 8) ; index++) LCDWrite(LCD_DATA, 0x00); gotoXY(0, 0); //After we clear the display, return to the home position } //This sends the magical commands to the PCD8544 void LCDInit(void) { //Configure control pins pinMode(PIN_SCE, OUTPUT); pinMode(PIN_RESET, OUTPUT); pinMode(PIN_DC, OUTPUT); pinMode(PIN_SDIN, OUTPUT); pinMode(PIN_SCLK, OUTPUT); //Reset the LCD to a known state digitalWrite(PIN_RESET, LOW); digitalWrite(PIN_RESET, HIGH); LCDWrite(LCD_COMMAND, 0x21); //Tell LCD that extended commands follow LCDWrite(LCD_COMMAND, 0xB0); //Set LCD Vop (Contrast): Try 0xB1(good @ 3.3V) or 0xBF if your display is too dark LCDWrite(LCD_COMMAND, 0x04); //Set Temp coefficent LCDWrite(LCD_COMMAND, 0x14); //LCD bias mode 1:48: Try 0x13 or 0x14 LCDWrite(LCD_COMMAND, 0x20); //We must send 0x20 before modifying the display control mode LCDWrite(LCD_COMMAND, 0x0C); //Set display control, normal mode. 0x0D for inverse } //There are two memory banks in the LCD, data/RAM and commands. This //function sets the DC pin high or low depending, and then sends //the data byte void LCDWrite(byte data_or_command, byte data) { digitalWrite(PIN_DC, data_or_command); //Tell the LCD that we are writing either to data or a command //Send the data digitalWrite(PIN_SCE, LOW); shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data); digitalWrite(PIN_SCE, HIGH); }
[ "davidh@zickel.net" ]
davidh@zickel.net
933685e4725eef79f5ea7ce43065dee6e7e7a521
f0535b751d55637ea5c3711e9dcda5938bea3ea4
/trunk/NUIFrameworks/src/modules/moSmoothModule.cpp
015af847b6a5a870a14c3476fa6d4d91114d8631
[]
no_license
nuigroup/ccv-wxwidgets
f5ebb2d1e8817a7ad1216065e70ae98faf0f2c42
b9b7fbb315ba3a622440dd5eb6c82223eb8c8cb3
refs/heads/master
2021-01-15T23:11:56.564887
2014-10-18T03:09:43
2014-10-18T03:09:43
8,324,881
2
1
null
null
null
null
UTF-8
C++
false
false
1,867
cpp
/*********************************************************************** ** Copyright (C) 2010 Movid Authors. All rights reserved. ** ** This file is part of the Movid Software. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file ** LICENSE included in the packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** Contact info@movid.org if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include <assert.h> #include "moSmoothModule.h" #include "../moLog.h" #include "cv.h" MODULE_DECLARE(Smooth, "native", "Smooth an image with one of several filters"); moSmoothModule::moSmoothModule() : moImageFilterModule8() { MODULE_INIT(); // declare properties this->properties["size"] = new moProperty(1); this->properties["size"]->setMin(1); this->properties["size"]->setMax(6); this->properties["filter"] = new moProperty("median"); this->properties["filter"]->setChoices("median;gaussian;blur;blur_no_scale"); } moSmoothModule::~moSmoothModule() { } int moSmoothModule::toCvType(const std::string &filter) { if ( filter == "median" ) return CV_MEDIAN; if ( filter == "gaussian" ) return CV_GAUSSIAN; if ( filter == "blur" ) return CV_BLUR; if ( filter == "blur_no_scale" ) return CV_BLUR_NO_SCALE; LOGM(MO_ERROR, "Unsupported filter type: " << filter); this->setError("Unsupported filter type"); return 0; } void moSmoothModule::applyFilter(IplImage *src) { cvSmooth( src, this->output_buffer, this->toCvType(this->property("filter").asString()), this->property("size").asInteger()*2+1 //make sure its odd ); }
[ "jimbo@6390893d-aae8-4ee2-985d-008520e8b1b1" ]
jimbo@6390893d-aae8-4ee2-985d-008520e8b1b1
18c645645574044c9714734b02dbf57afb595eff
205184ba19f51b010e0dcd4a1d95be928a4b5fa4
/variadic_template.cpp
2c2da5ebc34309ecb93e7c671bd7a07626298a41
[]
no_license
sqzhr/DemoC-11
fa77aed420da210be26d3cd7f08a9378b8223fcd
492df0d0feafe8c46f1af5d331772321d55e99f9
refs/heads/master
2020-03-21T16:18:40.254683
2018-08-31T11:23:00
2018-08-31T11:23:00
138,763,010
0
0
null
null
null
null
UTF-8
C++
false
false
232
cpp
template<class ... Types> void f(Types ... args) {} int main() { f(); // OK: args contains no arguments f(1); // OK: args contains one argument: int f(2, 1.0); // OK: args contains two arguments: int and double }
[ "kostenko.yulia@apriorit.com" ]
kostenko.yulia@apriorit.com
f55be71ae38cca8e9ab4904734245c7a9d9e7eb7
4df08a71e73fb06debae296caf126f6f2e8291ad
/lab05/UserInput.cpp
043595afdbac7ea54afbad9c1db792ff946d5ba7
[]
no_license
EvanBrown96/560labs
60f985ea7ac32a59debe03a34eee630da4c069e1
9b2d9950c328580a226ea6468a7f2fbbc874a901
refs/heads/master
2020-04-18T21:55:19.074220
2019-05-07T03:55:11
2019-05-07T03:55:11
167,779,203
0
0
null
null
null
null
UTF-8
C++
false
false
3,403
cpp
/** * @author: Evan Brown * @file: UserInput.cpp * @date: 2/28/19 * @brief: implementation of UserInput functions * adapted from 560 lab04 */ #include "UserInput.hpp" #include "EmptyStructure.hpp" #include <iostream> #include <limits> int myhash(const int& val){ return val; } UserInput::UserInput(const BinarySearchTree<int> startoff): test_bst(startoff){} void UserInput::clearCin(){ std::cin.clear(); std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n'); } bool UserInput::queryNumber(const char* query_str, int& num){ std::cout << query_str; if(std::cin >> num){ return true; } clearCin(); std::cout << "Invalid number entered.\n"; return false; } void UserInput::start(){ int choice = 0; while(true){ std::cout << "Choose one operation from the options below:\n\n"; std::cout << "\t1. Insert\n"; std::cout << "\t2. Delete\n"; std::cout << "\t3. Find\n"; std::cout << "\t4. FindMin\n"; std::cout << "\t5. FindMax\n"; std::cout << "\t6. Preorder\n"; std::cout << "\t7. Inorder\n"; std::cout << "\t8. Postorder\n"; std::cout << "\t9. Levelorder\n"; std::cout << "\t10. Exit\n"; while(!(std::cin >> choice && choice > -1 && choice < 11)){ clearCin(); std::cout << "Invalid choice, try again: "; } if(choice == 10){ break; } switch(choice){ case 0: { test_bst.printVisual(); break; } case 1: { userInsert(); break; } case 2: { userDelete(); break; } case 3: { userFind(); break; } case 4: { try{ std::cout << "Minimum number: " << test_bst.findMin() << "\n"; }catch(EmptyStructure& err){ std::cout << "Tree is empty and has no minimum.\n"; } break; } case 5: { try{ std::cout << "Maximum number: " << test_bst.findMax() << "\n"; }catch(EmptyStructure& err){ std::cout << "Tree is empty and has no maximum.\n"; } break; } case 6: { std::cout << "Preorder traversal: " << test_bst.preorder() << "\n"; break; } case 7: { std::cout << "Inorder traversal: " << test_bst.inorder() << "\n"; break; } case 8: { std::cout << "Postorder traversal: " << test_bst.postorder() << "\n"; break; } default: { std::cout << "Levelorder traversal: " << test_bst.levelorder() << "\n"; break; } } std::cout << "\n"; } std::cout << "Done!\n"; } void UserInput::userInsert(){ int insert; if(!queryNumber("Enter number to insert into BST: ", insert)) return; test_bst.insert(insert); std::cout << "Insert was successful.\n"; } void UserInput::userDelete(){ int del; if(!queryNumber("Enter number to delete from BST: ", del)) return; try{ test_bst.deleteVal(del); std::cout << "Delete was successful.\n"; } catch(ValueNotFound<int>& err){ std::cout << "Delete failed; number was not found in tree.\n"; } } void UserInput::userFind(){ int find; if(!queryNumber("Enter number to be found: ", find)) return; if(test_bst.find(find)){ std::cout << "Number is present in the tree.\n"; } else{ std::cout << "Number is not present in the tree.\n"; } }
[ "evan.br96@yahoo.com" ]
evan.br96@yahoo.com
73276e406ce47c2ba4993f61c7b44a85903d276f
9f8a069f7d337a022cae89e3e5b75d161c832e2d
/Final_Case/Refined_Grid/Turbulent/constant/polyMesh/boundary
701e9a6587c23d9e75087aeb17f458fe250e8fca
[]
no_license
Logan-Price/CFD
453f6df21f90fd91a834ce98bc0b3970406f148d
16e510ec882e65d5f7101e0aac91dbe8a035f65d
refs/heads/master
2023-04-06T04:17:49.899812
2021-04-19T01:22:14
2021-04-19T01:22:14
359,291,399
0
0
null
null
null
null
UTF-8
C++
false
false
1,842
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v1912 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class polyBoundaryMesh; location "constant/polyMesh"; object boundary; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 7 ( inlet { type patch; nFaces 173; startFace 24588; } outlet { type patch; nFaces 173; startFace 24761; } lowerSymmetry { type symmetryPlane; inGroups 1(symmetryPlane); nFaces 57; startFace 24934; } obstical { type wall; inGroups 1(wall); nFaces 88; startFace 24991; } obsticalTop { type wall; inGroups 1(wall); nFaces 20; startFace 25079; } top { type patch; nFaces 77; startFace 25099; } defaultFaces { type empty; inGroups 1(empty); nFaces 24882; startFace 25176; } ) // ************************************************************************* //
[ "loganprice2369@gmail.com" ]
loganprice2369@gmail.com
b4464b4e56e60a924ea17d4cd35a0f3574eedbff
1c800ad4905593750503096eacc895d962cb12bd
/FinalYearProject/FinalYearProject/Unit.cpp
83a9c3a85a80cb5648e0b830fb358a2963e78afe
[]
no_license
C00192781/FYP
e337a3b1b72b8a3917376369cc1a9f75b6579f1e
75f0be38910f1978c49f7b3af4a3a0556bc86ef7
refs/heads/master
2020-08-23T05:07:46.523207
2018-04-23T20:43:37
2018-04-23T20:43:37
216,548,000
1
0
null
null
null
null
UTF-8
C++
false
false
5,156
cpp
#include "Unit.h" Unit::Unit(float x, float y, int radius, sf::Color col) { // spawns off screen m_xPos = -100; m_yPos = -100; m_radius = radius; colour = col; move = false; moving = false; reached = true; shape.setRadius(radius); shape.setFillColor(sf::Color::Red); //shape.setOutlineColor(sf::Color::Blue); //shape.setOutlineThickness(4); shape.setPosition(m_xPos, m_yPos); } Unit::~Unit() { } void Unit::Move() { //std::cout << shape.getGlobalBounds().left << " " << shape.getGlobalBounds().top << std::endl if (move == true) { if (m_xPos < m_targetX) { m_xPos += 0.5; } if (m_xPos > m_targetX) { m_xPos -= 0.5; } if (m_yPos < m_targetY) { m_yPos += 0.5; } if (m_yPos > m_targetY) { m_yPos -= 0.5; } shape.setPosition(m_xPos, m_yPos); if (m_xPos == m_targetX && m_yPos == m_targetY) { if (m_path.size() > 0) { std::cout << m_path.size() << std::endl; SetTarget(m_path.front()->getWaypoint().x, m_path.front()->getWaypoint().y); std::cout << m_path.front()->getWaypoint().x << " " << m_path.front()->getWaypoint().y; m_path.erase(m_path.begin()); //std::cout << m_path.front()->data().first << " " << m_path.size() << std::endl; clock.restart(); //std::cout << "Path Size: " << m_path.size() << std::endl; } if (m_path.size() <= 0) { if (clock.getElapsedTime().asSeconds() >= 1) { m_xPos = m_startX; m_yPos = m_startY; SetTarget(m_startX, m_startY); } } //std::cout << "test" << std::endl; /*if (pathWaypoints.size() > 0) { std::reverse(pathWaypoints.begin(), pathWaypoints.end()); pathWaypoints.pop_back(); if (pathWaypoints.size() > 0) { std::reverse(pathWaypoints.begin(), pathWaypoints.end()); SetTarget(pathWaypoints.front()); } }*/ } } //else if (m_searchType == "AD*") //{ // if (move == true) // { // if (m_xPos < m_targetX) // { // m_xPos += 0.5; // } // if (m_xPos > m_targetX) // { // m_xPos -= 0.5; // } // if (m_yPos < m_targetY) // { // m_yPos += 0.5; // } // if (m_yPos > m_targetY) // { // m_yPos -= 0.5; // } // shape.setPosition(m_xPos, m_yPos); // if (m_xPos == m_targetX && m_yPos == m_targetY) // { // reached = true; // if (m_path.size() > 0) // { // std::cout << m_path.size() << std::endl; // SetTarget(m_path.front()->getWaypoint().x, m_path.front()->getWaypoint().y); // std::cout << m_path.front()->getWaypoint().x << " " << m_path.front()->getWaypoint().y; // m_path.erase(m_path.begin()); // //std::cout << m_path.front()->data().first << " " << m_path.size() << std::endl; // clock.restart(); // //std::cout << "Path Size: " << m_path.size() << std::endl; // } // if (m_path.size() <= 0) // { // if (clock.getElapsedTime().asSeconds() >= 1) // { // m_xPos = m_startX; // m_yPos = m_startY; // SetTarget(m_startX, m_startY); // } // } // //std::cout << "test" << std::endl; // /*if (pathWaypoints.size() > 0) // { // std::reverse(pathWaypoints.begin(), pathWaypoints.end()); // pathWaypoints.pop_back(); // if (pathWaypoints.size() > 0) // { // std::reverse(pathWaypoints.begin(), pathWaypoints.end()); // SetTarget(pathWaypoints.front()); // } // }*/ // } // } //} } void Unit::SetTarget(float tarX, float tarY) { m_targetX = tarX; m_targetY = tarY; } void Unit::SetPath(std::vector<GraphNode*>& path, int startX, int startY) { //std::cout << "path " << path.size() << std::endl; m_startX = startX; m_startY = startY; // NOTE: MAY REMOVE THESE 2 LINES m_xPos = startX; m_yPos = startY; bool extraNode = false; int index = 0; GraphNode *node; if (path.size() > 0) { move = true; m_path = path; std::cout << path.size() << std::endl; index = searchNearestWaypoint(m_xPos, m_yPos); //std::cout << "dfsffdfggfgfgfgffgfgffdff" << index << std::endl; //std::cout << path.front()->getWaypoint().x << " " << path.front()->getWaypoint().y; //***********************************IMPORTANT LINE COMMENTED OUT m_path.erase(m_path.begin(), m_path.begin() + index); std::cout << m_path.size() << std::endl; SetTarget(m_path.front()->getWaypoint().x, m_path.front()->getWaypoint().y); } } void Unit::Draw(sf::RenderWindow * window) { window->draw(shape); } int Unit::searchNearestWaypoint(float xPos, float yPos) { float differenceValue = std::numeric_limits<int>::max() - 10000; int differenceIndex; for (int i = 0; i < m_path.size(); i++) { sf::Vector2f difference; difference.x = xPos - m_path.at(i)->getWaypoint().x; difference.y = yPos - m_path.at(i)->getWaypoint().y; float diff = sqrtf((difference.x*difference.x) + (difference.y*difference.y)); if (diff < differenceValue) { differenceValue = diff; differenceIndex = i; } } //return everyWaypoint.at(differenceIndex); return differenceIndex; } void Unit::Reset() { m_xPos = m_startX; m_yPos = m_startY; } bool Unit::getReached() { return reached; } void Unit::setSearchType(std::string searchType) { m_searchType = searchType; }
[ "idakev2396@gmail.com" ]
idakev2396@gmail.com
c7038ed65cc142d2553ea8cc30a40df19f624e69
3459ad2afff7ad28c99c0e6837755aedda7f5ff1
/WarehouseControlSystem/ControlClass/externcommuincation/tcommmcmelsectcpclient.cpp
4f9c11a21f75c95c013b63dd883dcdccf65127f9
[]
no_license
KorolWu/WCSFinal
7fbe534114d8dae3f83f0e80897e7b3fc2683097
ea0b8cd71f8ffc9da5d43ab9c511130039a9d32a
refs/heads/master
2023-04-03T01:32:45.274632
2021-04-22T01:00:17
2021-04-22T01:00:17
360,348,654
1
1
null
null
null
null
UTF-8
C++
false
false
11,146
cpp
#include "tcommmcmelsectcpclient.h" #include <QDateTime> TCommMCMelsecTCPclient::TCommMCMelsecTCPclient() { socket = nullptr; m_connectStatus = false; m_enbled = true; m_senddatatype = UnknownSendDatatype; m_opsofttype = UnknownSofttype; m_requestaddress = -1; m_requestcount = 0; // memset(m_RevData,0,128); qRegisterMetaType<QMap<int,int>>("QMap<int,int>"); qRegisterMetaType<QVector<int>>("QVector<int>"); connect(this,&TCommMCMelsecTCPclient::signalReadData,this,&TCommMCMelsecTCPclient::readDataRequest); connect(this,&TCommMCMelsecTCPclient::signalWriteData,this,&TCommMCMelsecTCPclient::on_writeData_request); connect(this,&TCommMCMelsecTCPclient::signalcreateclient,this,&TCommMCMelsecTCPclient::creadTcpClient); } /// /// \brief TCommMCMelsecTCPclient::SetCommParam /// \param paramstru /// void TCommMCMelsecTCPclient::SetCommParam(ComConfigStru paramstru) { m_config = paramstru.hwTcpstru; //creadTcpClient(); } /// /// \brief TCommMCMelsecTCPclient::GetNameID /// \return ///得到名字ID int TCommMCMelsecTCPclient::GetNameID() { return m_config.ID; } /// /// \brief TCommMCMelsecTCPclient::GetHWtype /// \return /// int TCommMCMelsecTCPclient::GetHWtype() { return m_config.hwtype; } /// /// \brief TCommMCMelsecTCPclient::GetHWprotype /// \return /// int TCommMCMelsecTCPclient::GetHWprotype() { return kMCMelsecTCPClient; } /// /// \brief TCommMCMelsecTCPclient::CloseComm /// void TCommMCMelsecTCPclient::CloseComm() { if(socket == nullptr) return; socket->disconnectFromHost(); socket->close(); m_connectStatus = false; socket = nullptr; } /// /// \brief TCommMCMelsecTCPclient::creadTcpClient /// \return /// bool TCommMCMelsecTCPclient::creadTcpClient() { socket = new QTcpSocket(this); // connect(socket,&QTcpSocket::disconnected,this,&TCommMCMelsecTCPclient::onDisconnected); // connect(socket,&QTcpSocket::connected, // [=]() // { // m_connectStatus = true; // m_connectstate = 1; // } ); connect(socket, &QTcpSocket::stateChanged, this, &TCommMCMelsecTCPclient::onStateChanged); connect(socket,&QTcpSocket::readyRead, [=]() { QMutexLocker locker(&m_Mutex); QByteArray array = socket->readAll(); //if(array.length() <= 128) { // memcpy(m_RevData,array.data(),array.length()); // emit signalReadHWdeviceData(m_config.ID,m_config.hwtype,array); /* if(*/CheckReceData(array,array.length());/* == 1)*/ // { // qDebug()<<"数据读写成功:"<<m_config.ID; // } m_enbled = true; } }); bool connect = connectServer(m_config.name,m_config.port); // emit signalHWDisconnect(m_config.ID,m_config.hwtype,m_connectStatus); return connect; } bool TCommMCMelsecTCPclient::connectServer(QString ip, qint16 port) { if(socket == nullptr) return false; socket->connectToHost(QHostAddress(ip),port); if(socket->waitForConnected(1000)) { return true; } else { return false; } } bool TCommMCMelsecTCPclient::reConnection() { m_connectStatus = connectServer(m_config.name,m_config.port); // if(m_connectStatus)//连接成功发出成功状态 // { // emit signalHWDisconnect(m_config.ID,m_config.hwtype,m_connectStatus); // m_connectstate = 1; // } // else{ // m_connectstate = 0; // } return m_connectStatus; } /// /// \brief TCommMCMelsecTCPclient::write /// \param array /// \return /// qint64 TCommMCMelsecTCPclient::write(QByteArray array) { if(!m_connectStatus)//连接成功发出成功状态 return 1; if(socket == nullptr) return 0; return socket->write(array); } /// /// \brief TCommMCMelsecTCPclient::GetWaitreplyresult /// \return ///等待回复的过程数据 int TCommMCMelsecTCPclient::GetWaitreplyresult() { int result= -1; struct timeval tpStart,tpEnd; float timeUse = 0; gettimeofday(&tpStart,NULL);//设置500ms while (timeUse < 1000) { if(m_enbled) { result = 1; break ; } gettimeofday(&tpEnd,NULL); timeUse = 1000 *(tpEnd.tv_sec - tpStart.tv_sec) + 0.001*(tpEnd.tv_usec - tpStart.tv_usec); if(timeUse >= 1000) break; QEventLoop loop;//定义一个新的事件循环 QTimer::singleShot(10, &loop, SLOT(quit()));//创建单次定时器,槽函数为事件循环的退出函数 loop.exec();//事件循环开始执行,程序会卡在这里,直到定时时间到,本循环被退出 } if(result == 1) { qDebug()<<"1s之内请求回复成功"; } return result; } /// /// \brief TCommMCMelsecTCPclient::CheckReceData /// \param array /// \return ///分析收到的数据可靠性 int TCommMCMelsecTCPclient::CheckReceData(QByteArray array,int length) { int iresult = -1; QByteArray dataTemp; dataTemp.append(array); int size = sizeof(MCFrameHeadstru); //解析收到数据帧 MCFrameHeadstru headstru; if(size >= length) return iresult; memcpy((char*)&headstru,dataTemp.data(),size); if(!(headstru.header == 208&&headstru.netindex == 0\ &&headstru.plcindex == 255 &&headstru.targetIOindex == 1023)) { //qDebug()<<"接收的数据帧头格式错误: 索引号。。。"; } switch (m_senddatatype) { case BatchRead: { // qDebug()<<"接收到读请求的结果:"<<dataTemp.toHex(); int count = m_requestcount; if(count < 1) return -2; if(headstru.length == (count*2+2)) { //校正读数据字节长度 if(length == (headstru.length +size)) { QMap<int,int> Datamap; // dataTemp.data()+i*count+2+size; for(int i = 0; i < count;++i) { // qDebug()<<"pos:"<<i*count+2+size; atoi16 a16; a16.x = 0; memcpy(a16.a,&dataTemp.data()[i*2+2+size],2); int value = a16.x; Datamap.insert(m_requestaddress+i,value); // qDebug()<<"address:"<<m_requestaddress+i <<"value:"<<value; } if(Datamap.size() > 0) { emit signalReceModbusHWdeviceData(m_config.ID,m_config.hwtype,SoftCodeD,Datamap); iresult =1; } } } //校验返回批量读的报文格式 break; } case BatchWrite: { //校验返回批量写的报文格式 // ComframeReceWriteStru recstru; if(headstru.length == 2 &&(length == (size+2))&&((int)dataTemp[length-1] == 0) ) { //数据写成功 // qDebug()<<"数据写成功:"<<m_requestaddress << m_requestcount; iresult =1; } break; } default: break; } return iresult; } /// /// \brief TCommMCMelsecTCPclient::readDataRequest /// \param type /// \param startAddress /// \param numberOfEntries /// 发送读数据的请求 void TCommMCMelsecTCPclient::readDataRequest(int type, int startAddress, int numberOfEntries) { if(m_connectstate <= 0) return; //检查是否可以执行发送请求 if(!m_enbled) { qDebug()<<"进入请求读数据函数:发现还没有回应:时间,"<<QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:zzz")<<"上一个发送类型是->"<<m_senddatatype; if(GetWaitreplyresult() != 1) { m_connectstate = -2; qDebug()<<"上一个请求未回复超时1s"; return; } } QMutexLocker locker(&m_Mutex); ComFrameSendReadMCStru stru; stru.headstru.length = 12; stru.defineData.cmdtype = 1025; stru.defineData.softcount = numberOfEntries; stru.defineData.softcode = type; union strtovalue{ int8_t valueby[3]; int value; }; strtovalue a; a.value = startAddress; memcpy(stru.defineData.startaddress,a.valueby,3); //得到的16进制的字节数组 QByteArray tempData; tempData.append(reinterpret_cast<char*>(&stru),sizeof(ComFrameSendReadMCStru)); //qDebug()<<"readDataRequest:"<<tempData.toHex() << sizeof(ComFrameSendReadMCStru); if(write(tempData) > 0) { m_senddatatype = BatchRead; m_requestaddress = startAddress; m_requestcount = numberOfEntries; m_enbled = false; } } /// /// \brief TCommMCMelsecTCPclient::on_writeData_request /// \param type /// \param startAddress /// \param values /// void TCommMCMelsecTCPclient::on_writeData_request(int type, int startAddress, QVector<int> values) { if(m_connectstate <= 0) return; //检查是否可以执行发送请求 if(!m_enbled) { if(GetWaitreplyresult() != 1) { m_connectstate = -2; qDebug()<<"上一个请求未回复超时1s"; return; } } QMutexLocker locker(&m_Mutex); ComFrameSendWriteMCstru writestru; writestru.headstru.length = 12 + values.size()*2; writestru.defineData.softcount = values.size(); writestru.defineData.cmdtype = 5121; writestru.defineData.softcode = type; union strtovalue{ int8_t valueby[3]; int value; }; strtovalue a; a.value = startAddress; memcpy(writestru.defineData.startaddress,a.valueby,3); QByteArray tempData; tempData.append(reinterpret_cast<char*>(&writestru),sizeof(ComFrameSendWriteMCstru)); for(int i = 0; i < values.size();++i) { int16_t datavalue = 0; datavalue = values[i]; tempData.append(reinterpret_cast<char*>(&datavalue),sizeof(int16_t)); } qDebug()<<"on_writeData_request:"<<tempData.toHex()<<endl<<"startAddress:"<<startAddress<<"value: "<<values; if(write(tempData) > 0) { m_senddatatype = BatchWrite; m_requestaddress = startAddress; m_requestcount = values.size(); m_enbled = false; } } /// /// \brief TCommMCMelsecTCPclient::onStateChanged /// \param state ///当连接状态发生改变 void TCommMCMelsecTCPclient::onStateChanged(int state) { //连接状态发生了改变 //emit signalconnectstate(state); bool connected = (state != QTcpSocket::UnconnectedState); Q_UNUSED(connected); if (state == QTcpSocket::UnconnectedState) { m_connectStatus = false; m_connectstate = -1; } else if (state == QTcpSocket::ConnectedState) { m_connectStatus = true; m_connectstate = 1; m_senddatatype = UnknownSendDatatype; } emit signalHWDisconnect(m_config.ID,m_config.hwtype,m_connectStatus); qDebug()<<"设备ID:"<<m_config.ID <<",设备类型:"<<m_config.hwtype<< ",TCommMCMelsecTCPclient连接状态发生:"<<"值:"<<state; }
[ "1050476035@qq.com" ]
1050476035@qq.com
a40351cb23afb5a418fb8dfeab23c44b6dbef4e2
647d7b666e450446b8a596da3e5e3b0d424c14c3
/Programming-code2/code/Chapter18/chapter.18.3.cpp
0636faf20eb60e3b9d00ea5c0526dd51ca9283c7
[]
no_license
JamesBryant24/C-_exp
a1f6bc297cbe3dcbb313658ebfe645d773697c68
924ba6da434029785ecde14c805541e203446c7c
refs/heads/master
2020-04-07T07:09:59.199120
2018-11-20T09:53:26
2018-11-20T09:53:26
158,166,273
0
1
null
null
null
null
UTF-8
C++
false
false
776
cpp
// // This is example code from Chapter 18.3 "Essential operations" of // "Programming -- Principles and Practice Using C++" by Bjarne Stroustrup // #include "../std_lib_facilities.h" //------------------------------------------------------------------------------ int main() { string s("Triumph"); // initialize s to the character string "Triumph" vector<double> v(10); // make v a vector of 10 doubles vector<double> vi(10); // vector of 10 doubles, each initialized to 0.0 vector<string> vs(10); // vector of 10 strings, each initialized to "" vector<vector< int> > vvi(10); // vector of 10 vectors, each initialized to vector() } //------------------------------------------------------------------------------
[ "zkx48@mail.ustc.edu.cn" ]
zkx48@mail.ustc.edu.cn
82d66046230f8bad66698793fd97b3bfee7b1f32
fee10e5c4ab189dd4aeea70761c80ae273e3098a
/src/ai/dnnf_engine__.hpp
e595035db98ae53dac2d1f128b6753c386cff74f
[]
no_license
frederic-koriche/ccpg
9970a2456b2d3b1cc0679a4161c911799713440f
178122d4ad3a72bf49b3373e4fc4ffd377d667aa
refs/heads/master
2020-03-23T12:41:53.580866
2018-08-26T15:51:45
2018-08-26T15:51:45
141,575,514
0
0
null
null
null
null
UTF-8
C++
false
false
10,233
hpp
// ----------------------------------------------------------------------------- // Online Combinatorial Optimization // dnnf_engine__.hpp // ----------------------------------------------------------------------------- #ifndef DNNF_ENGINE__HPP #define DNNF_ENGINE__HPP #include "dnnf_circuit__.hpp" // ----------------------------------------------------------------------------- // Abstract class Engine__<DNNF,Q> // Inference engine for dDNNF using the push-weights dynamic programming scheme // ----------------------------------------------------------------------------- template<query_t Q> class Engine__<DNNF,Q> { protected: // Attributes const Circuit<DNNF>& circuit__; const uword n_literals__; const uword n_nodes__; const uword n_variables__; public: // Constructors & Destructor Engine__(const Circuit<DNNF>& circuit) : circuit__(circuit), n_literals__(circuit.n_literals()), n_nodes__(circuit.n_nodes()), n_variables__(circuit.n_variables()) { } ~Engine__() { } protected: // Push false node inline void push_false_node(dvec& node_weights, const uword index, traits::ct) { node_weights[index] = 0.0; } inline void push_false_node(dvec& node_weights, const uword index, traits::min) { node_weights[index] = std::numeric_limits<double>::infinity(); } inline void push_false_node(dvec& node_weights, const uword index, traits::max) { node_weights[index] = -std::numeric_limits<double>::infinity(); } inline void push_false_node(dvec& node_weights, const uword index) { push_false_node(node_weights, index, traits::to_query<Q>()); } protected: // Push true node inline void push_true_node(dvec& node_weights, const uword index, traits::ct) { node_weights[index] = 1.0; } inline void push_true_node(dvec& node_weights, const uword index, traits::min) { node_weights[index] = 0.0; } inline void push_true_node(dvec& node_weights, const uword index, traits::max) { push_true_node(node_weights, index, traits::to_query<MIN>()); } inline void push_true_node(dvec& node_weights, const uword index) { push_true_node(node_weights, index, traits::to_query<Q>()); } protected: // Push literal node inline void push_literal_node(dvec& node_weights, const uword index, const dvec& literal_weights) { uword x = circuit__.node_label(index).vars[0]; if(circuit__.node_label(index).sgn) node_weights[index] = literal_weights[2 * x]; else node_weights[index] = literal_weights[(2 * x) + 1]; } protected: // Push and node inline void push_and_node(dvec& node_weights, const uword index, traits::ct) { auto children = circuit__.out_edges(index); node_weights[index] = 1.0; for(auto c = children.begin(); c != children.end(); ++c) node_weights[index] *= node_weights[c.col()]; } inline void push_and_node(dvec& node_weights, const uword index, traits::min) { auto children = circuit__.out_edges(index); node_weights[index] = 0.0; for(auto c = children.begin(); c != children.end(); ++c) node_weights[index] += node_weights[c.col()]; } inline void push_and_node(dvec& node_weights, const uword index, traits::max) { push_and_node(node_weights, index, traits::to_query<MIN>()); } inline void push_and_node(dvec& node_weights, const uword index) { push_and_node(node_weights, index, traits::to_query<Q>()); } protected: // Push or node inline void push_or_node(dvec& node_weights, const uword index, const dvec& literal_weights, traits::ct) { auto children = circuit__.out_edges(index); node_weights[index] = 0.0; for(auto c = children.begin(); c != children.end(); ++c) { uword child = c.col(); const uvec& vars = circuit__.edge_label(index, child); double edge_weight = 1; for(uword i = 0; i < vars.size(); ++i) { uword x = vars[i]; double w = literal_weights[2 * x] + literal_weights[(2 * x) + 1]; edge_weight *= w; } node_weights[index] += (edge_weight * node_weights[child]); } } inline void push_or_node(sp_dmat& edge_weights, dvec& node_weights, const uword index, const dvec& literal_weights, traits::ct) { auto children = circuit__.out_edges(index); node_weights[index] = 0.0; for(auto c = children.begin(); c != children.end(); ++c) { uword child = c.col(); const uvec& vars = circuit__.edge_label(index, child); double edge_weight = 1; for(uword i = 0; i < vars.size(); ++i) { uword x = vars[i]; double w = literal_weights[2 * x] + literal_weights[(2 * x) + 1]; edge_weight *= w; } edge_weights(index, child) = (edge_weight * node_weights[child]); node_weights[index] += (edge_weight * node_weights[child]); } } inline void push_or_node(sp_dmat& edge_weights, dvec& node_weights, const uword index, const dvec& literal_weights, traits::min) { auto children = circuit__.out_edges(index); node_weights[index] = std::numeric_limits<double>::infinity(); for(auto c = children.begin(); c != children.end(); ++c) { uword child = c.col(); const uvec& vars = circuit__.edge_label(index, child); double edge_weight = 0; for(uword i = 0; i < vars.size(); ++i) { uword x = vars[i]; double w = std::min(literal_weights[2 * x], literal_weights[(2 * x) + 1]); edge_weight += w; } edge_weights(index, child) = edge_weight + node_weights[child]; node_weights[index] = std::min(node_weights[index], edge_weight + node_weights[child]); } } inline void push_or_node(sp_dmat& edge_weights, dvec& node_weights, const uword index, const dvec& literal_weights, traits::max) { auto children = circuit__.out_edges(index); node_weights[index] = -std::numeric_limits<double>::infinity(); for(auto c = children.begin(); c != children.end(); ++c) { uword child = c.col(); const uvec& vars = circuit__.edge_label(index, child); double edge_weight = 0; for(uword i = 0; i < vars.size(); ++i) { uword x = vars[i]; double w = std::max(literal_weights[2 * x], literal_weights[(2 * x) + 1]); edge_weight += w; } edge_weights(index, child) = edge_weight + node_weights[child]; node_weights[index] = std::max(node_weights[index], edge_weight + node_weights[child]); } } inline void push_or_node(dvec& node_weights, const uword index, const dvec& literal_weights) { push_or_node(node_weights, index, literal_weights, traits::to_query<Q>()); } inline void push_or_node(sp_dmat& edge_weights, dvec& node_weights, const uword index, const dvec& literal_weights) { push_or_node(edge_weights, node_weights, index, literal_weights, traits::to_query<Q>()); } protected: // get_weight inline static double get_weight(const dvec& assignment, const dvec& objective, traits::min) { assert(objective.n_elem == assignment.n_elem); return arma::dot(assignment,objective); } inline static double get_weight(const dvec& assignment, const dvec& objective, traits::max) { return get_weight(assignment,objective,traits::to_query<MIN>()); } inline static double get_weight(const dvec& assignment, const dvec& objective, traits::ct) { assert(objective.n_elem == assignment.n_elem); double w = 1; for(uword x = 0; x < assignment.n_elem; ++x) if(assignment[x] == 1.0) w *= objective[x]; return w; } public: // public inference operations inline static double get_weight(const dvec& assignment, const dvec& objective) { return get_weight(assignment,objective,traits::to_query<Q>()); } inline void push_weights(dvec& node_weights, const dvec& literal_weights) { for(uword index = 0; index < n_nodes__; ++index) switch(circuit__.node_label(index).type) { case 'a': push_and_node(node_weights, index); break; case 'f': push_false_node(node_weights, index); break; case 'l': push_literal_node(node_weights, index, literal_weights); break; case 'o': push_or_node(node_weights, index, literal_weights); break; case 't': push_true_node(node_weights, index); break; } } inline void push_weights(sp_dmat& edge_weights, dvec& node_weights, const dvec& literal_weights) { for(uword index = 0; index < n_nodes__; ++index) switch(circuit__.node_label(index).type) { case 'a': push_and_node(node_weights, index); break; case 'f': push_false_node(node_weights, index); break; case 'l': push_literal_node(node_weights, index, literal_weights); break; case 'o': push_or_node(edge_weights, node_weights, index, literal_weights); break; case 't': push_true_node(node_weights, index); break; } } }; #endif
[ "frederic.koriche@cril.univ-artois.fr" ]
frederic.koriche@cril.univ-artois.fr
bb9dc4bd1ade9b26eef39fc7c0bc636d5eee3d63
1d928c3f90d4a0a9a3919a804597aa0a4aab19a3
/c++/ClickHouse/2016/12/WriteBufferAIO.cpp
4c7fc6d417eb68f23d1564263e090fdda204e543
[ "BSL-1.0" ]
permissive
rosoareslv/SED99
d8b2ff5811e7f0ffc59be066a5a0349a92cbb845
a062c118f12b93172e31e8ca115ce3f871b64461
refs/heads/main
2023-02-22T21:59:02.703005
2021-01-28T19:40:51
2021-01-28T19:40:51
306,497,459
1
1
null
2020-11-24T20:56:18
2020-10-23T01:18:07
null
UTF-8
C++
false
false
14,986
cpp
#include <DB/IO/WriteBufferAIO.h> #include <DB/Common/ProfileEvents.h> #include <limits> #include <sys/types.h> #include <sys/stat.h> namespace ProfileEvents { extern const Event FileOpen; extern const Event FileOpenFailed; extern const Event WriteBufferAIOWrite; extern const Event WriteBufferAIOWriteBytes; } namespace CurrentMetrics { extern const Metric Write; } namespace DB { namespace ErrorCodes { extern const int FILE_DOESNT_EXIST; extern const int CANNOT_OPEN_FILE; extern const int LOGICAL_ERROR; extern const int ARGUMENT_OUT_OF_BOUND; extern const int AIO_READ_ERROR; extern const int AIO_SUBMIT_ERROR; extern const int AIO_WRITE_ERROR; extern const int AIO_COMPLETION_ERROR; extern const int CANNOT_TRUNCATE_FILE; extern const int CANNOT_FSYNC; } /// Примечание: выделяется дополнительная страница, которая содежрит те данные, которые /// не влезают в основной буфер. WriteBufferAIO::WriteBufferAIO(const std::string & filename_, size_t buffer_size_, int flags_, mode_t mode_, char * existing_memory_) : WriteBufferFromFileBase(buffer_size_ + DEFAULT_AIO_FILE_BLOCK_SIZE, existing_memory_, DEFAULT_AIO_FILE_BLOCK_SIZE), flush_buffer(BufferWithOwnMemory<WriteBuffer>(this->memory.size(), nullptr, DEFAULT_AIO_FILE_BLOCK_SIZE)), filename(filename_) { /// Исправить информацию о размере буферов, чтобы дополнительные страницы не касались базового класса BufferBase. this->buffer().resize(this->buffer().size() - DEFAULT_AIO_FILE_BLOCK_SIZE); this->internalBuffer().resize(this->internalBuffer().size() - DEFAULT_AIO_FILE_BLOCK_SIZE); flush_buffer.buffer().resize(this->buffer().size() - DEFAULT_AIO_FILE_BLOCK_SIZE); flush_buffer.internalBuffer().resize(this->internalBuffer().size() - DEFAULT_AIO_FILE_BLOCK_SIZE); ProfileEvents::increment(ProfileEvents::FileOpen); int open_flags = (flags_ == -1) ? (O_RDWR | O_TRUNC | O_CREAT) : flags_; open_flags |= O_DIRECT; fd = ::open(filename.c_str(), open_flags, mode_); if (fd == -1) { ProfileEvents::increment(ProfileEvents::FileOpenFailed); auto error_code = (errno == ENOENT) ? ErrorCodes::FILE_DOESNT_EXIST : ErrorCodes::CANNOT_OPEN_FILE; throwFromErrno("Cannot open file " + filename, error_code); } } WriteBufferAIO::~WriteBufferAIO() { if (!aio_failed) { try { flush(); } catch (...) { tryLogCurrentException(__PRETTY_FUNCTION__); } } if (fd != -1) ::close(fd); } off_t WriteBufferAIO::getPositionInFile() { return seek(0, SEEK_CUR); } void WriteBufferAIO::sync() { flush(); /// Попросим ОС сбросить данные на диск. int res = ::fsync(fd); if (res == -1) throwFromErrno("Cannot fsync " + getFileName(), ErrorCodes::CANNOT_FSYNC); } void WriteBufferAIO::nextImpl() { if (!offset()) return; if (waitForAIOCompletion()) finalize(); /// Создать запрос на асинхронную запись. prepare(); request.aio_lio_opcode = IOCB_CMD_PWRITE; request.aio_fildes = fd; request.aio_buf = reinterpret_cast<UInt64>(buffer_begin); request.aio_nbytes = region_aligned_size; request.aio_offset = region_aligned_begin; /// Отправить запрос. while (io_submit(aio_context.ctx, request_ptrs.size(), &request_ptrs[0]) < 0) { if (errno != EINTR) { aio_failed = true; throw Exception("Cannot submit request for asynchronous IO on file " + filename, ErrorCodes::AIO_SUBMIT_ERROR); } } is_pending_write = true; } off_t WriteBufferAIO::doSeek(off_t off, int whence) { flush(); if (whence == SEEK_SET) { if (off < 0) throw Exception("SEEK_SET underflow", ErrorCodes::ARGUMENT_OUT_OF_BOUND); pos_in_file = off; } else if (whence == SEEK_CUR) { if (off >= 0) { if (off > (std::numeric_limits<off_t>::max() - pos_in_file)) throw Exception("SEEK_CUR overflow", ErrorCodes::ARGUMENT_OUT_OF_BOUND); } else if (off < -pos_in_file) throw Exception("SEEK_CUR underflow", ErrorCodes::ARGUMENT_OUT_OF_BOUND); pos_in_file += off; } else throw Exception("WriteBufferAIO::seek expects SEEK_SET or SEEK_CUR as whence", ErrorCodes::ARGUMENT_OUT_OF_BOUND); if (pos_in_file > max_pos_in_file) max_pos_in_file = pos_in_file; return pos_in_file; } void WriteBufferAIO::doTruncate(off_t length) { flush(); int res = ::ftruncate(fd, length); if (res == -1) throwFromErrno("Cannot truncate file " + filename, ErrorCodes::CANNOT_TRUNCATE_FILE); } void WriteBufferAIO::flush() { next(); if (waitForAIOCompletion()) finalize(); } bool WriteBufferAIO::waitForAIOCompletion() { if (!is_pending_write) return false; CurrentMetrics::Increment metric_increment{CurrentMetrics::Write}; while (io_getevents(aio_context.ctx, events.size(), events.size(), &events[0], nullptr) < 0) { if (errno != EINTR) { aio_failed = true; throw Exception("Failed to wait for asynchronous IO completion on file " + filename, ErrorCodes::AIO_COMPLETION_ERROR); } } is_pending_write = false; bytes_written = events[0].res; ProfileEvents::increment(ProfileEvents::WriteBufferAIOWrite); ProfileEvents::increment(ProfileEvents::WriteBufferAIOWriteBytes, bytes_written); return true; } void WriteBufferAIO::prepare() { /// Менять местами основной и дублирующий буферы. buffer().swap(flush_buffer.buffer()); std::swap(position(), flush_buffer.position()); truncation_count = 0; /* Страница на диске или в памяти начальный адрес (начальная позиция в случае диска) кратен DEFAULT_AIO_FILE_BLOCK_SIZE : : +---------------+ | | | | | | | | | | | | +---------------+ <---------------> : : DEFAULT_AIO_FILE_BLOCK_SIZE */ /* Представление данных на диске XXX : данные, которые хотим записать ZZZ : данные, которые уже на диске или нули, если отсутствуют данные region_aligned_begin region_aligned_end : region_begin region_end : : : : : : : : : +---:-----------+---------------+---------------+---------------+--:------------+ | : | | | | : | | +-----------+---------------+---------------+---------------+--+ | |ZZZ|XXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XX|ZZZZZZZZZZZZ| |ZZZ|XXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XX|ZZZZZZZZZZZZ| | +-----------+---------------+---------------+---------------+--+ | | | | | | | +---------------+---------------+---------------+---------------+---------------+ <--><--------------------------------------------------------------><-----------> : : : : : : region_left_padding region_size region_right_padding <-------------------------------------------------------------------------------> : : region_aligned_size */ /// Регион диска, в который хотим записать данные. const off_t region_begin = pos_in_file; if ((flush_buffer.offset() > std::numeric_limits<off_t>::max()) || (pos_in_file > (std::numeric_limits<off_t>::max() - static_cast<off_t>(flush_buffer.offset())))) throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR); const off_t region_end = pos_in_file + flush_buffer.offset(); const size_t region_size = region_end - region_begin; /// Выровненный регион диска, в который хотим записать данные. const size_t region_left_padding = region_begin % DEFAULT_AIO_FILE_BLOCK_SIZE; const size_t region_right_padding = (DEFAULT_AIO_FILE_BLOCK_SIZE - (region_end % DEFAULT_AIO_FILE_BLOCK_SIZE)) % DEFAULT_AIO_FILE_BLOCK_SIZE; region_aligned_begin = region_begin - region_left_padding; if (region_end > (std::numeric_limits<off_t>::max() - static_cast<off_t>(region_right_padding))) throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR); const off_t region_aligned_end = region_end + region_right_padding; region_aligned_size = region_aligned_end - region_aligned_begin; bytes_to_write = region_aligned_size; /* Представление данных в буфере до обработки XXX : данные, которые хотим записать buffer_begin buffer_end : : : : +---------------+---------------+---------------+-------------:-+ | | | | : | +---------------+---------------+---------------+-------------+ | |XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXX| | |XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXX| | +---------------+---------------+---------------+-------------+ | | | | | | +---------------+---------------+---------------+---------------+ <-------------------------------------------------------------> : : buffer_size */ /// Буфер данных, которые хотим записать на диск. buffer_begin = flush_buffer.buffer().begin(); Position buffer_end = buffer_begin + region_size; size_t buffer_size = buffer_end - buffer_begin; /// Обработать буфер, чтобы он отражал структуру региона диска. /* Представление данных в буфере после обработки XXX : данные, которые хотим записать ZZZ : данные из диска или нули, если отсутствуют данные buffer_begin buffer_end дополнительная страница : : : : : : +---:-----------+---------------+---------------+---------------+--:------------+ | | | | | : | | +-----------+---------------+---------------+---------------+--+ | |ZZZ|XXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XX|ZZZZZZZZZZZZ| |ZZZ|XXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XXXXXXXXXXXXXXX|XX|ZZZZZZZZZZZZ| | +-----------+---------------+---------------+---------------+--+ | | | | | | | +---------------+---------------+---------------+---------------+---------------+ <--><--------------------------------------------------------------><-----------> : : : : : : region_left_padding region_size region_right_padding <-------------------------------------------------------------------------------> : : region_aligned_size */ if ((region_left_padding > 0) || (region_right_padding > 0)) { char memory_page[DEFAULT_AIO_FILE_BLOCK_SIZE] __attribute__ ((aligned (DEFAULT_AIO_FILE_BLOCK_SIZE))); if (region_left_padding > 0) { /// Сдвинуть данные буфера вправо. Дополнить начало буфера данными из диска. buffer_size += region_left_padding; buffer_end = buffer_begin + buffer_size; ::memmove(buffer_begin + region_left_padding, buffer_begin, (buffer_size - region_left_padding) * sizeof(*buffer_begin)); ssize_t read_count = ::pread(fd, memory_page, DEFAULT_AIO_FILE_BLOCK_SIZE, region_aligned_begin); if (read_count < 0) throw Exception("Read error", ErrorCodes::AIO_READ_ERROR); size_t to_copy = std::min(static_cast<size_t>(read_count), region_left_padding); ::memcpy(buffer_begin, memory_page, to_copy * sizeof(*buffer_begin)); ::memset(buffer_begin + to_copy, 0, (region_left_padding - to_copy) * sizeof(*buffer_begin)); } if (region_right_padding > 0) { /// Дополнить конец буфера данными из диска. ssize_t read_count = ::pread(fd, memory_page, DEFAULT_AIO_FILE_BLOCK_SIZE, region_aligned_end - DEFAULT_AIO_FILE_BLOCK_SIZE); if (read_count < 0) throw Exception("Read error", ErrorCodes::AIO_READ_ERROR); Position truncation_begin; off_t offset = DEFAULT_AIO_FILE_BLOCK_SIZE - region_right_padding; if (read_count > offset) { ::memcpy(buffer_end, memory_page + offset, (read_count - offset) * sizeof(*buffer_end)); truncation_begin = buffer_end + (read_count - offset); truncation_count = DEFAULT_AIO_FILE_BLOCK_SIZE - read_count; } else { truncation_begin = buffer_end; truncation_count = region_right_padding; } ::memset(truncation_begin, 0, truncation_count * sizeof(*truncation_begin)); } } } void WriteBufferAIO::finalize() { if (bytes_written < bytes_to_write) throw Exception("Asynchronous write error on file " + filename, ErrorCodes::AIO_WRITE_ERROR); bytes_written -= truncation_count; off_t pos_offset = bytes_written - (pos_in_file - request.aio_offset); if (pos_in_file > (std::numeric_limits<off_t>::max() - pos_offset)) throw Exception("An overflow occurred during file operation", ErrorCodes::LOGICAL_ERROR); pos_in_file += pos_offset; if (pos_in_file > max_pos_in_file) max_pos_in_file = pos_in_file; if (truncation_count > 0) { /// Укоротить файл, чтобы удалить из него излишние нули. int res = ::ftruncate(fd, max_pos_in_file); if (res == -1) throwFromErrno("Cannot truncate file " + filename, ErrorCodes::CANNOT_TRUNCATE_FILE); } } }
[ "rodrigosoaresilva@gmail.com" ]
rodrigosoaresilva@gmail.com
921e1d0dbf72b934b9e8ef76eae69221bb01f9c3
0266e454d5b3d15ae819a7f95dc76a403f207b96
/roswrap/src/rossimu/kinetic/include/geometry_msgs/PoseStamped.h
f29cdc3e62cad1482b055c07bdd352c084c528d8
[ "Apache-2.0" ]
permissive
SICKAG/sick_scan_base
af7ae85279c03f2bc9685c49872ff4787a210b64
73d37605e1914fd1da8d45050ba37f449a660fd7
refs/heads/master
2022-10-13T11:51:02.203508
2022-09-05T10:27:11
2022-09-05T10:27:11
196,956,176
22
20
Apache-2.0
2021-02-08T23:26:44
2019-07-15T08:22:39
C++
UTF-8
C++
false
false
7,110
h
// Generated by gencpp from file geometry_msgs/PoseStamped.msg // DO NOT EDIT! #ifndef GEOMETRY_MSGS_MESSAGE_POSESTAMPED_H #define GEOMETRY_MSGS_MESSAGE_POSESTAMPED_H #include <string> #include <vector> #include <map> #include <ros/types.h> #include <ros/serialization.h> #include <ros/builtin_message_traits.h> #include <ros/message_operations.h> #include <std_msgs/Header.h> #include <geometry_msgs/Pose.h> namespace geometry_msgs { template <class ContainerAllocator> struct PoseStamped_ { typedef PoseStamped_<ContainerAllocator> Type; PoseStamped_() : header() , pose() { } PoseStamped_(const ContainerAllocator& _alloc) : header(_alloc) , pose(_alloc) { (void)_alloc; } typedef ::std_msgs::Header_<ContainerAllocator> _header_type; _header_type header; typedef ::geometry_msgs::Pose_<ContainerAllocator> _pose_type; _pose_type pose; typedef boost::shared_ptr< ::geometry_msgs::PoseStamped_<ContainerAllocator> > Ptr; typedef boost::shared_ptr< ::geometry_msgs::PoseStamped_<ContainerAllocator> const> ConstPtr; }; // struct PoseStamped_ typedef ::geometry_msgs::PoseStamped_<std::allocator<void> > PoseStamped; typedef boost::shared_ptr< ::geometry_msgs::PoseStamped > PoseStampedPtr; typedef boost::shared_ptr< ::geometry_msgs::PoseStamped const> PoseStampedConstPtr; // constants requiring out of line definition template<typename ContainerAllocator> std::ostream& operator<<(std::ostream& s, const ::geometry_msgs::PoseStamped_<ContainerAllocator> & v) { ros::message_operations::Printer< ::geometry_msgs::PoseStamped_<ContainerAllocator> >::stream(s, "", v); return s; } } // namespace geometry_msgs namespace ros { namespace message_traits { // BOOLTRAITS {'IsFixedSize': False, 'IsMessage': True, 'HasHeader': True} // {'std_msgs': ['/opt/ros/kinetic/share/std_msgs/cmake/../msg'], 'geometry_msgs': ['/tmp/binarydeb/ros-kinetic-geometry-msgs-1.12.5/msg']} // !!!!!!!!!!! ['__class__', '__delattr__', '__dict__', '__doc__', '__eq__', '__format__', '__getattribute__', '__hash__', '__init__', '__module__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '__weakref__', '_parsed_fields', 'constants', 'fields', 'full_name', 'has_header', 'header_present', 'names', 'package', 'parsed_fields', 'short_name', 'text', 'types'] template <class ContainerAllocator> struct IsFixedSize< ::geometry_msgs::PoseStamped_<ContainerAllocator> > : FalseType { }; template <class ContainerAllocator> struct IsFixedSize< ::geometry_msgs::PoseStamped_<ContainerAllocator> const> : FalseType { }; template <class ContainerAllocator> struct IsMessage< ::geometry_msgs::PoseStamped_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct IsMessage< ::geometry_msgs::PoseStamped_<ContainerAllocator> const> : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::geometry_msgs::PoseStamped_<ContainerAllocator> > : TrueType { }; template <class ContainerAllocator> struct HasHeader< ::geometry_msgs::PoseStamped_<ContainerAllocator> const> : TrueType { }; template<class ContainerAllocator> struct MD5Sum< ::geometry_msgs::PoseStamped_<ContainerAllocator> > { static const char* value() { return "d3812c3cbc69362b77dc0b19b345f8f5"; } static const char* value(const ::geometry_msgs::PoseStamped_<ContainerAllocator>&) { return value(); } static const uint64_t static_value1 = 0xd3812c3cbc69362bULL; static const uint64_t static_value2 = 0x77dc0b19b345f8f5ULL; }; template<class ContainerAllocator> struct DataType< ::geometry_msgs::PoseStamped_<ContainerAllocator> > { static const char* value() { return "geometry_msgs/PoseStamped"; } static const char* value(const ::geometry_msgs::PoseStamped_<ContainerAllocator>&) { return value(); } }; template<class ContainerAllocator> struct Definition< ::geometry_msgs::PoseStamped_<ContainerAllocator> > { static const char* value() { return "# A Pose with reference coordinate frame and timestamp\n\ Header header\n\ Pose pose\n\ \n\ ================================================================================\n\ MSG: std_msgs/Header\n\ # Standard metadata for higher-level stamped data types.\n\ # This is generally used to communicate timestamped data \n\ # in a particular coordinate frame.\n\ # \n\ # sequence ID: consecutively increasing ID \n\ uint32 seq\n\ #Two-integer timestamp that is expressed as:\n\ # * stamp.sec: seconds (stamp_secs) since epoch (in Python the variable is called 'secs')\n\ # * stamp.nsec: nanoseconds since stamp_secs (in Python the variable is called 'nsecs')\n\ # time-handling sugar is provided by the client library\n\ time stamp\n\ #Frame this data is associated with\n\ # 0: no frame\n\ # 1: global frame\n\ string frame_id\n\ \n\ ================================================================================\n\ MSG: geometry_msgs/Pose\n\ # A representation of pose in free space, composed of position and orientation. \n\ Point position\n\ Quaternion orientation\n\ \n\ ================================================================================\n\ MSG: geometry_msgs/Point\n\ # This contains the position of a point in free space\n\ float64 x\n\ float64 y\n\ float64 z\n\ \n\ ================================================================================\n\ MSG: geometry_msgs/Quaternion\n\ # This represents an orientation in free space in quaternion form.\n\ \n\ float64 x\n\ float64 y\n\ float64 z\n\ float64 w\n\ "; } static const char* value(const ::geometry_msgs::PoseStamped_<ContainerAllocator>&) { return value(); } }; } // namespace message_traits } // namespace ros namespace ros { namespace serialization { template<class ContainerAllocator> struct Serializer< ::geometry_msgs::PoseStamped_<ContainerAllocator> > { template<typename Stream, typename T> inline static void allInOne(Stream& stream, T m) { stream.next(m.header); stream.next(m.pose); } ROS_DECLARE_ALLINONE_SERIALIZER }; // struct PoseStamped_ } // namespace serialization } // namespace ros namespace ros { namespace message_operations { template<class ContainerAllocator> struct Printer< ::geometry_msgs::PoseStamped_<ContainerAllocator> > { template<typename Stream> static void stream(Stream& s, const std::string& indent, const ::geometry_msgs::PoseStamped_<ContainerAllocator>& v) { s << indent << "header: "; s << std::endl; Printer< ::std_msgs::Header_<ContainerAllocator> >::stream(s, indent + " ", v.header); s << indent << "pose: "; s << std::endl; Printer< ::geometry_msgs::Pose_<ContainerAllocator> >::stream(s, indent + " ", v.pose); } }; } // namespace message_operations } // namespace ros #endif // GEOMETRY_MSGS_MESSAGE_POSESTAMPED_H
[ "michael.lehning@lehning.de" ]
michael.lehning@lehning.de
c1c3c3c99e9ddbc7309bc9068159ad559cd4b856
2155050f3f2d19b657fb56bf1a251977d3bd3477
/lab_4_csv_parser/Exception.cpp
b0e1f112fa9a76d16f6f7e7e8d3363b4396a5df3
[]
no_license
shadrina/learning-cpp
4b102f9b1178a40d8f5689a8f129a9487c6b40f3
6d3966be227fc36347ade3064f889b85b9fcc17b
refs/heads/master
2021-09-04T12:25:46.296474
2018-01-18T17:04:35
2018-01-18T17:04:35
null
0
0
null
null
null
null
UTF-8
C++
false
false
33
cpp
#include "Exception.h" // later
[ "a.shadrina5@mail.ru" ]
a.shadrina5@mail.ru
079c1557294f1ea9fc7dcf1476d2cde74ecab45f
a67e07f2dcc5784e128a12296c1245ca02a40f3e
/XHelper/TaskHandle.h
5d1c35e38de6b9c7d4e0d63baf2ade262f644a8e
[]
no_license
z379115475/MobileAssistant
ed1d0d2e346fef63a454a415f33a9c6b454d6979
06173ce440a5db1f43ae8a8b7c974fd6ce056ba8
refs/heads/main
2022-12-26T20:28:23.918067
2020-10-13T09:49:46
2020-10-13T09:49:46
303,656,521
0
0
null
null
null
null
GB18030
C++
false
false
563
h
#pragma once class ITaskHandle; struct CTask { UINT uStatus; // 任务状态 HWND hNtfWnd; // 任务完成时,接收消息的窗口 UINT uNtfMsg; // 消息id sciter::value param; // 请求参数 sciter::value ret; // 返回结果 ITaskHandle* pHost; // 任务处理者 CTask() { uStatus = 0; pHost = NULL; } }; class ITaskHandle { public: ITaskHandle* m_pNext; ITaskHandle() { m_pNext = NULL; } virtual ~ITaskHandle() {} virtual BOOL Init() = 0; virtual BOOL ProcessTask(CTask*) = 0; virtual BOOL CancelTask(CTask*) = 0; };
[ "379115475@qq.com" ]
379115475@qq.com
c8d746be25fd364a8d2a726b764dafa68c4aaecf
4e718d513ce9c5d57984e1f504678ae6615d94a6
/URI Judge/URI Judge/1155.cpp
7c98e0bfe7cb5d3aaa91482c090dd5869a68ebd5
[ "MIT" ]
permissive
AhmedNasser1601/ProblemSolving
91377968d4d93e8d5dc790ebe83c9e907db31a99
383b14221ca34d52257e53dc7a5f966790ca8678
refs/heads/master
2023-08-06T12:56:18.551695
2021-10-03T09:48:20
2021-10-03T09:48:20
393,166,609
0
0
null
null
null
null
UTF-8
C++
false
false
271
cpp
//#include <iostream> //#include <stdio.h> //#include <iomanip> //#include <string> // //using namespace std; // //int main() { // float x = 0; // // for (float i = 1; i <= 100; ++i) // x += 1 / i; // // cout << fixed << setprecision(2) << x << endl; // // return 0; //}
[ "60184582+AhmedNasser1601@users.noreply.github.com" ]
60184582+AhmedNasser1601@users.noreply.github.com
9c36dc49cdf10d9e037db2891f01492a4397332c
e217eaf05d0dab8dd339032b6c58636841aa8815
/IfcAlignment/src/OpenInfraPlatform/IfcAlignment/entity/IfcProject.cpp
64519e1f51ca07cae5d8b60a8b3aa4f9cbfbec8f
[]
no_license
bigdoods/OpenInfraPlatform
f7785ebe4cb46e24d7f636e1b4110679d78a4303
0266e86a9f25f2ea9ec837d8d340d31a58a83c8e
refs/heads/master
2021-01-21T03:41:20.124443
2016-01-26T23:20:21
2016-01-26T23:20:21
57,377,206
0
1
null
2016-04-29T10:38:19
2016-04-29T10:38:19
null
UTF-8
C++
false
false
4,482
cpp
/*! \verbatim * \copyright Copyright (c) 2015 Julian Amann. All rights reserved. * \author Julian Amann <julian.amann@tum.de> (https://www.cms.bgu.tum.de/en/team/amann) * \brief This file is part of the BlueFramework. * \endverbatim */ #include <sstream> #include <limits> #include "OpenInfraPlatform/IfcAlignment/model/IfcAlignmentP6Exception.h" #include "OpenInfraPlatform/IfcAlignment/reader/ReaderUtil.h" #include "OpenInfraPlatform/IfcAlignment/writer/WriterUtil.h" #include "OpenInfraPlatform/IfcAlignment/IfcAlignmentP6EntityEnums.h" #include "include/IfcGloballyUniqueId.h" #include "include/IfcLabel.h" #include "include/IfcOwnerHistory.h" #include "include/IfcProject.h" #include "include/IfcRelAggregates.h" #include "include/IfcRelAssigns.h" #include "include/IfcRelAssociates.h" #include "include/IfcRelDeclares.h" #include "include/IfcRelDefinesByProperties.h" #include "include/IfcRelNests.h" #include "include/IfcRepresentationContext.h" #include "include/IfcText.h" #include "include/IfcUnitAssignment.h" namespace OpenInfraPlatform { namespace IfcAlignment { // ENTITY IfcProject IfcProject::IfcProject() { m_entity_enum = IFCPROJECT; } IfcProject::IfcProject( int id ) { m_id = id; m_entity_enum = IFCPROJECT; } IfcProject::~IfcProject() {} // method setEntity takes over all attributes from another instance of the class void IfcProject::setEntity( shared_ptr<IfcAlignmentP6Entity> other_entity ) { shared_ptr<IfcProject> other = dynamic_pointer_cast<IfcProject>(other_entity); if( !other) { return; } m_GlobalId = other->m_GlobalId; m_OwnerHistory = other->m_OwnerHistory; m_Name = other->m_Name; m_Description = other->m_Description; m_ObjectType = other->m_ObjectType; m_LongName = other->m_LongName; m_Phase = other->m_Phase; m_RepresentationContexts = other->m_RepresentationContexts; m_UnitsInContext = other->m_UnitsInContext; } void IfcProject::getStepLine( std::stringstream& stream ) const { stream << "#" << m_id << "=IFCPROJECT" << "("; if( m_GlobalId ) { m_GlobalId->getStepParameter( stream ); } else { stream << "$"; } stream << ","; if( m_OwnerHistory ) { stream << "#" << m_OwnerHistory->getId(); } else { stream << "$"; } stream << ","; if( m_Name ) { m_Name->getStepParameter( stream ); } else { stream << "$"; } stream << ","; if( m_Description ) { m_Description->getStepParameter( stream ); } else { stream << "$"; } stream << ","; if( m_ObjectType ) { m_ObjectType->getStepParameter( stream ); } else { stream << "$"; } stream << ","; if( m_LongName ) { m_LongName->getStepParameter( stream ); } else { stream << "$"; } stream << ","; if( m_Phase ) { m_Phase->getStepParameter( stream ); } else { stream << "$"; } stream << ","; writeEntityList( stream, m_RepresentationContexts ); stream << ","; if( m_UnitsInContext ) { stream << "#" << m_UnitsInContext->getId(); } else { stream << "$"; } stream << ");"; } void IfcProject::getStepParameter( std::stringstream& stream, bool ) const { stream << "#" << m_id; } void IfcProject::readStepData( std::vector<std::string>& args, const std::map<int,shared_ptr<IfcAlignmentP6Entity> >& map ) { const int num_args = (int)args.size(); if( num_args<9 ){ std::stringstream strserr; strserr << "Wrong parameter count for entity IfcProject, expecting 9, having " << num_args << ". Object id: " << getId() << std::endl; throw IfcAlignmentP6Exception( strserr.str().c_str() ); } #ifdef _DEBUG if( num_args>9 ){ std::cout << "Wrong parameter count for entity IfcProject, expecting 9, having " << num_args << ". Object id: " << getId() << std::endl; } #endif m_GlobalId = IfcGloballyUniqueId::readStepData( args[0] ); readEntityReference( args[1], m_OwnerHistory, map ); m_Name = IfcLabel::readStepData( args[2] ); m_Description = IfcText::readStepData( args[3] ); m_ObjectType = IfcLabel::readStepData( args[4] ); m_LongName = IfcLabel::readStepData( args[5] ); m_Phase = IfcLabel::readStepData( args[6] ); readEntityReferenceList( args[7], m_RepresentationContexts, map ); readEntityReference( args[8], m_UnitsInContext, map ); } void IfcProject::setInverseCounterparts( shared_ptr<IfcAlignmentP6Entity> ptr_self_entity ) { IfcContext::setInverseCounterparts( ptr_self_entity ); } void IfcProject::unlinkSelf() { IfcContext::unlinkSelf(); } } // end namespace IfcAlignment } // end namespace OpenInfraPlatform
[ "planung.cms.bv@tum.de" ]
planung.cms.bv@tum.de
ce87e3b0935f56d21ef42ff18e1cf8f5d79ce06a
af12357c008084301d9c51d807261c8dbd185118
/task.h
42d2f292a8fd819cc46e291c61e5ec30c238aa0c
[]
no_license
rlmv/pyphi-condor
3761fe2f82e9c5cb4c4cd9b25653147fbada6e4b
118a6f27ef39e394f0a06752247f12df39617b12
refs/heads/master
2021-08-08T14:21:08.635430
2017-11-10T14:01:38
2017-11-10T14:01:38
109,983,750
0
0
null
null
null
null
UTF-8
C++
false
false
1,816
h
/***************************Copyright-DO-NOT-REMOVE-THIS-LINE** * * Condor Software Copyright Notice * Copyright (C) 1990-2004, Condor Team, Computer Sciences Department, * University of Wisconsin-Madison, WI. * * This source code is covered by the Condor Public License, which can * be found in the accompanying LICENSE.TXT file, or online at * www.condorproject.org. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * AND THE UNIVERSITY OF WISCONSIN-MADISON "AS IS" AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY, OF SATISFACTORY QUALITY, AND FITNESS * FOR A PARTICULAR PURPOSE OR USE ARE DISCLAIMED. THE COPYRIGHT * HOLDERS AND CONTRIBUTORS AND THE UNIVERSITY OF WISCONSIN-MADISON * MAKE NO MAKE NO REPRESENTATION THAT THE SOFTWARE, MODIFICATIONS, * ENHANCEMENTS OR DERIVATIVE WORKS THEREOF, WILL NOT INFRINGE ANY * PATENT, COPYRIGHT, TRADEMARK, TRADE SECRET OR OTHER PROPRIETARY * RIGHT. * ****************************Copyright-DO-NOT-REMOVE-THIS-LINE**/ #ifndef _TASK_H #define _TASK_H #include <Python.h> #include <stdio.h> #include "MWTask.h" #include <string> class Task : public MWTask { public: /* constructors */ Task(); Task(PyObject* input); /* destructor */ ~Task(); /* App is required to implement the following functions. */ void pack_work( void ); void unpack_work( void ); void pack_results( void ); void unpack_results( void ); void pack_PyObject(PyObject* obj ); PyObject* unpack_PyObject( void ); /* The following functions have default implementation. */ void printself( int level = 70 ); void write_ckpt_info( FILE *fp ); void read_ckpt_info( FILE *fp ); PyObject *input; PyObject *result; }; #endif
[ "bo.marchman@gmail.com" ]
bo.marchman@gmail.com
a425ff659beb67d01c587d695c13505a65262ebb
8d35a575ee5c6cc249ba7656869c16890f7e2e9b
/panda_safety/src/SphereListVisualizer.cpp
1b25136c8ba8946f4daedd4d8ad1cff223bfc8b1
[ "MIT" ]
permissive
erdalpekel/panda_simulation
5db473077bfee588b90890cba058052dc9fb1d2b
70b6a9d7a426a9cc4dd3e41b2a61f817f1531f4b
refs/heads/master
2023-03-10T06:22:39.883074
2022-09-22T08:03:49
2022-09-22T08:03:49
165,692,071
143
59
MIT
2023-03-06T20:46:27
2019-01-14T16:14:01
JavaScript
UTF-8
C++
false
false
3,380
cpp
#include <panda_safety/SphereListVisualizer.h> namespace nodes { SphereListVisualizer::SphereListVisualizer(const ros::NodeHandle &node_handle, const ros::NodeHandle &private_node_handle, ros::Rate rate) : node_handle(node_handle), private_node_handle(private_node_handle), rate(rate) { this->init(); } void SphereListVisualizer::init() { if (!private_node_handle.getParam(constants::CAMERA_ID, camera_id)) { throw std::runtime_error( "Parameter \"camera\" was not set when starting script! Specify which camera you are starting!"); } service = node_handle.advertiseService(constants::service_endpoints::SPHERE_LIST_DISPLAY + camera_id, &SphereListVisualizer::sphereListDisplayCallback, this); ROS_INFO("Created service server"); marker_pub = node_handle.advertise<visualization_msgs::Marker>("visualization_marker_" + camera_id, 10); float f = 0.0f; while (ros::ok()) { if (!points_frame_id.empty()) { visualization_msgs::Marker points; // Set the frame ID and timestamp. See the TF tutorials for information on these. points.header.frame_id = points_frame_id; points.header.stamp = ros::Time::now(); // Set the namespace and id for this marker. This serves to create a unique ID // Any marker sent with the same namespace and id will overwrite the old one points.ns = "points_" + camera_id; points.id = 0; // Set the marker type. Initially this is CUBE, and cycles between that and SPHERE, ARROW, and CYLINDER points.type = visualization_msgs::Marker::SPHERE_LIST; // Set the marker action. Options are ADD, DELETE, and new in ROS Indigo: 3 (DELETEALL) points.action = visualization_msgs::Marker::ADD; // Set the pose of the marker. This is a full 6DOF pose relative to the frame/time specified in the header points.pose.position.x = 0; points.pose.position.y = 0; points.pose.position.z = 0; points.pose.orientation.x = 0.0; points.pose.orientation.y = 0.0; points.pose.orientation.z = 0.0; points.pose.orientation.w = 1.0; // Set the scale of the marker -- 1x1x1 here means 1m on a side points.scale.x = 0.004; points.scale.y = 0.004; points.scale.z = 0.004; // Set the color -- be sure to set alpha to something non-zero! points.color.g = 1.0f; points.color.a = 1.0; ROS_DEBUG_STREAM("collision objects size: " << sphere_list.size()); points.points = sphere_list; // Publish the marker marker_pub.publish(points); } rate.sleep(); ros::spinOnce(); } } bool SphereListVisualizer::sphereListDisplayCallback(panda_msgs::SphereListDisplayMsgRequest &req, panda_msgs::SphereListDisplayMsgResponse &res) { ROS_INFO("In service callback"); ROS_INFO_STREAM("Collision points size: " << req.sphere_list.size()); sphere_list = req.sphere_list; points_frame_id = req.frame_id; return true; } } // namespace nodes int main(int argc, char **argv) { ros::init(argc, argv, constants::nodes::COLLISION_VISUALIZER); ros::NodeHandle node_handle(""); ros::NodeHandle private_node_handle("~"); nodes::SphereListVisualizer node(node_handle, private_node_handle, 30); return 0; }
[ "info@erdalpekel.de" ]
info@erdalpekel.de
92bf16a8e0bd28950b1b8b2f8122b6f9d4914535
f8b1dfccaef5a8f75567b527fc7c2f0a34e3877b
/uestc/c96/pj.cpp
ee003f74038774c49ee5070aacfaa8e64817dd18
[]
no_license
bamboohiko/problemSolve
e7e2a2c6e46a4d10ccfa54cffff3c9895b3ddb1b
cd3e9e5986325f5def4efe01975a950f6eaa6015
refs/heads/master
2021-01-17T06:39:42.502176
2017-09-13T14:30:08
2017-09-13T14:30:08
47,928,189
0
0
null
null
null
null
UTF-8
C++
false
false
1,554
cpp
#include<iostream> #include<cstdio> #include<map> #include<set> #include<vector> #include<stack> #include<queue> #include<string> #include<cstring> #include<sstream> #include<algorithm> #include<cmath> #define INF 0x3f3f3f3f #define eps 1e-8 #define pi acos(-1.0) using namespace std; typedef long long LL; const int maxn = 2e6 + 100; int q[maxn],a[maxn],sum[maxn]; bool cmp(int a,int b,int c,int _a,int _b,int _c) { if (a != _a) return a > _a; if (b != _b) return b < _b; return c < _c; } int main() { int n,k; scanf("%d%d",&n,&k); int ans = -1001,x,y; for (int i = 1;i <= n; i++) { scanf("%d",&a[i]); a[n+i] = a[i]; if (a[i] > ans) {ans = a[i];x = y = i;} } int l = 1,r = 1;q[1] = 0; for (int i = 1;i <= n+n; i++) { sum[i] = sum[i-1] + a[i]; while (l <= r && i-q[l] > k) { if (q[r] > q[l] && cmp(sum[q[r]] - sum[q[l]],q[l]+1,q[r]-q[l],ans,x,y-x+1)) { ans = sum[q[r]] - sum[q[l]]; x = q[l] + 1;y = q[r]; } l++; } while (l <= r && sum[i] < sum[q[r]]) r--; q[++r] = i; if (q[r] > q[l] && cmp(sum[q[r]] - sum[q[l]],q[l]+1,q[r]-q[l],ans,x,y-x+1)) { ans = sum[q[r]] - sum[q[l]]; x = q[l] + 1;y = q[r]; } } if (q[r] > q[l] && sum[q[r]]-sum[q[l]] > ans) { ans = sum[q[r]] - sum[q[l]]; x = q[l]+1,y = q[r]; } printf("%d %d %d\n",ans,x,(y-1)%n+1); return 0; }
[ "bamboohiko@163.com" ]
bamboohiko@163.com
14a60e57bb6da46ffc452dec2e896ef1d87af9a5
6c57043f3879c5cd49265cb21a8cb23ec74f6364
/RenderEdit/src/EditorLayer.h
5b0e307bb1d6cc46b78ad402fbeb5629e643b301
[ "Apache-2.0" ]
permissive
dannymato/Renderent
5bc4d73937bd61d57168226e9da5929fd691dbf6
7ad60e4eaa356a521bdf3fe89b53f06c74b06b17
refs/heads/master
2022-11-20T22:58:45.100717
2020-07-22T20:52:28
2020-07-22T20:52:28
275,656,952
0
0
null
null
null
null
UTF-8
C++
false
false
845
h
#pragma once #include <Renderent.h> #include <glm/glm.hpp> namespace Renderent { class EditorLayer : public Layer { public: EditorLayer(); virtual ~EditorLayer() = default; virtual void OnAttach() override; virtual void OnDetach() override; virtual void OnUpdate(Timestep ts) override; virtual void OnImGuiRender() override; virtual void OnEvent(Event& e) override; private: Ref<VertexArray> m_SquareVA; OrthographicCameraController m_CameraController; Ref<Shader> m_FlatColorShader; glm::vec4 m_SquareColor = { 1.0f, 1.0f, 1.0f, 1.0f }; Ref<Texture2D> m_Checkerboard; Ref<Texture2D> m_Spritesheet; Ref<SubTexture2D> m_TextureStairs, m_TextureBarrel, m_TextureTree, m_TextureGround; Ref<Framebuffer> m_Framebuffer; glm::vec2 m_ViewportSize = { 0.0f, 0.0f }; float m_CurrentTime = 0.0f; }; }
[ "danny.mato1@gmail.com" ]
danny.mato1@gmail.com
e34f2e7e23d3030cb1bb83fd5349970d563735eb
a281b1077b3c4d0722f00313ba8fab49859a2599
/timer/timer_queue.cpp
0fc18faa1ed6faec1723f99a921e9668ffd8a536
[]
no_license
weijingtao/snow_ev
e3b2ac8f4017b35718760efe6ca413efa4615217
dcfb0e45944d6a403bb544f7329587c361229d25
refs/heads/master
2020-04-02T13:46:04.862417
2016-11-19T14:48:37
2016-11-19T14:48:37
62,480,306
1
0
null
null
null
null
UTF-8
C++
false
false
2,941
cpp
// // Created by weitao on 7/9/16. // // // Created by weitao on 4/1/16. // #include "timer_queue.h" #include <cstring> #include "../logger/logger.h" namespace snow { timer_queue::timer_queue(poller* poller) : m_timer_fd(poller) { SNOW_LOG_DEBUG; m_timer_fd.init(); m_timer_fd.set_timeout_cb(std::bind(&timer_queue::handle_timeout, this)); } timer_queue::timer_id timer_queue::add_timer(const entry& timer) { bool earliestChanged = false; auto when = timer.get().expiration(); auto it = m_timers.cbegin(); if (it == m_timers.cend() || when < it->get().expiration()) { earliestChanged = true; } auto result = m_timers.insert(timer); assert(result.second); if(earliestChanged) { m_timer_fd.reset(m_timers.cbegin()->get().expiration()); } return result.first; } void timer_queue::cancel(timer_id& id) { if(id == m_timers.begin()) { m_timers.erase(id); if(!m_timers.empty()) m_timer_fd.reset(m_timers.cbegin()->get().expiration()); // else // m_timer_fd.reset(); } else { m_timers.erase(id); } } void timer_queue::handle_timeout() { auto now = std::chrono::steady_clock::now(); std::vector<entry> expired = get_expired(now); for (auto& timer : expired) { timer.get().run(); } reset(expired, now); } // move out all expired timers std::vector<timer_queue::entry> timer_queue::get_expired(const time_stamp& now) { std::vector<entry> expired; for(auto it = m_timers.begin(); it != m_timers.end();) { if(it->get().expiration() <= now) { expired.push_back(*it); it = m_timers.erase(it); } break; } /*timer sentry; auto end = m_timers.lower_bound(std::ref(sentry)); std::copy(m_timers.begin(), end, std::back_inserter(expired)); m_timers.erase(m_timers.begin(), end);*/ return std::move(expired); } void timer_queue::reset(std::vector<entry>& expired, const time_stamp& now) { for (auto& timer : expired) { if(timer.get().repeat()) { timer.get().restart(now); insert(timer); } } if (!m_timers.empty()) { m_timer_fd.reset(m_timers.cbegin()->get().expiration()); } } bool timer_queue::insert(entry& timer) { bool earliestChanged = false; auto when = timer.get().expiration(); auto it = m_timers.cbegin(); if (it == m_timers.cend() || when < it->get().expiration()) { earliestChanged = true; } auto result = m_timers.insert(timer); assert(result.second); return earliestChanged; } }
[ "625171422@qq.com" ]
625171422@qq.com
65d4fe0cf0e5ea55fc2d31a221012cf608420a1b
29c804bd89c0865e8f8b1f1a54be35131655171a
/src/ParticleSystem.cpp
0265301b01c1beb0bf4db1bd7bee618560db41a9
[ "MIT" ]
permissive
IcedLeon/Introduction-to-3D-with-OpenGL
2aa2d6e41a9b3ca3ee95de65cda88db6ffd7c787
7e0edcb768d2e2b4b19cb5015a73335c60cd8f60
refs/heads/master
2020-04-06T04:30:14.772510
2017-05-25T13:56:24
2017-05-25T13:56:24
30,327,236
0
0
null
null
null
null
UTF-8
C++
false
false
865
cpp
#include "ParticleSystem.h" #include "ParticleEmitter.h" #include "ParticleUpdater.h" ParticleSystem::ParticleSystem(size_t a_MaxCount) { m_Count = a_MaxCount; m_oParticles.Generate(a_MaxCount); m_oAliveParticles.Generate(a_MaxCount); for (size_t i = NULL; i < a_MaxCount; ++i) { m_oParticles.m_pbAlive[i] = false; } } void ParticleSystem::Update(double a_dDeltaTime) { for (auto& em : m_voEmitters) { em->Emit(a_dDeltaTime, &m_oParticles); } for (size_t i = 0; i < m_Count; ++i) { m_oParticles.m_pvAcceleration[i] = vec4(0.0f); } for (auto& updt : m_voUpdaters) { updt->Update(a_dDeltaTime, &m_oParticles); } } void ParticleSystem::Reset() { m_oParticles.m_AliveCounter = NULL; } size_t ParticleSystem::ComputeMemoryUsage(const ParticleSystem& a_roParticle) { return 2 * ParticleData::ComputeMemoryUsage(a_roParticle.m_oParticles); }
[ "tommaso.galatolo@gmail.com" ]
tommaso.galatolo@gmail.com
7e8156e0d777f6e5a7c4b170dcb683433eed4865
b637b60f765f77187f62838614ef5b0fc3f38783
/c++/setTest.cpp
45ef3b81815f5c400b7a40192c29f5ce04bd067d
[]
no_license
spacewander/AlgorithmAndDataStructure
3cdeb0e39a967b2cb05585cc856d2b4b11e5ad10
127220c713be1f1afa2bc5347053fb587675c948
refs/heads/master
2021-04-30T22:06:50.152285
2020-10-13T06:20:56
2020-10-13T06:20:56
28,530,308
2
3
null
2020-10-13T06:20:57
2014-12-27T06:28:21
JavaScript
UTF-8
C++
false
false
2,014
cpp
#include "test.h" #include "set.hpp" using namespace std; class Set : public ::testing::Test { protected: vector<int> a{1, 2, 3, 4}; vector<int> b{3, 4, 5, 6}; }; TEST_F(Set, merge) { vector<int> c(a.size() + b.size()); my::merge(a.begin(), a.end(), b.begin(), b.end(), c.begin()); vector<int> ab{1, 2, 3, 3, 4, 4, 5, 6}; EXPECT_EQ(ab, c); } TEST_F(Set, inplace_merge) { vector<pair<int, int> > pairs{ make_pair(8, 20), make_pair(10, 9), make_pair(10, 10), make_pair(8, 10), make_pair(10, 11), make_pair(20, 10), }; vector<pair<int, int> > merged = pairs; auto cp = [](const pair<int, int> &a, const pair<int, int> &b){ return a.first < b.first; }; my::inplace_merge(pairs.begin(), pairs.begin() + 3, pairs.end(), cp); std::inplace_merge(merged.begin(), merged.begin() + 3, merged.end(), cp); EXPECT_EQ(merged, pairs); } TEST_F(Set, includes) { EXPECT_FALSE(my::includes(a.begin(), a.end(), b.begin(), b.end(), less<int>())); vector<int> c{1, 2}; EXPECT_TRUE(my::includes(a.begin(), a.end(), c.begin(), c.end(), less<int>())); } TEST_F(Set, set_difference) { vector<int> c(2); my::set_difference(a.begin(), a.end(), b.begin(), b.end(), c.begin()); vector<int> diff{1, 2}; EXPECT_EQ(diff, c); } TEST_F(Set, set_intersection) { vector<int> c(2); my::set_intersection(a.begin(), a.end(), b.begin(), b.end(), c.begin()); vector<int> intersection{3, 4}; EXPECT_EQ(intersection, c); } TEST_F(Set, set_symmetric_difference) { vector<int> c(4); my::set_symmetric_difference(a.begin(), a.end(), b.begin(), b.end(), c.begin()); vector<int> symmetric_difference{1, 2, 5, 6}; EXPECT_EQ(symmetric_difference, c); } TEST_F(Set, set_union) { vector<int> c(6); my::set_union(a.begin(), a.end(), b.begin(), b.end(), c.begin()); vector<int> ab{1, 2, 3, 4, 5, 6}; EXPECT_EQ(ab, c); }
[ "spacewanderlzx@gmail.com" ]
spacewanderlzx@gmail.com
e374a020755833c2196bc6dc9343cc94cba7d7c7
684a35add439b69b48793f4fe659423d43b0f57f
/MatrixMultiplication/main.cpp
aa370abcce83582b051764ac72ec6091aaecdf80
[]
no_license
beginner1986/MatrixMultiplication
039cca80e5c69b3bb5a4a71a0944703264298d02
6ea2ebb73a01e77ef820da62f023e881f808038e
refs/heads/master
2020-09-01T17:33:44.620824
2019-12-05T19:25:06
2019-12-05T19:25:06
218,965,210
0
0
null
null
null
null
WINDOWS-1250
C++
false
false
6,137
cpp
#include <iostream> #include <iomanip> #include <string> #include <chrono> #include <vector> #include <omp.h> #include "Matrix.h" double multiplyI(const Matrix& A, const Matrix& B, Matrix& result, int threadsNumber); double multiplyJ(const Matrix& A, const Matrix& B, Matrix& result, int threadsNumber); double multiplyK(const Matrix& A, const Matrix& B, Matrix& result, int threadsNumber); void printTable(double table[5][6]); int main() { // polish language support setlocale(LC_ALL, "polish"); std::cout << std::setprecision(5) << std::fixed; // read the matrices to multiply Matrix* A, * B; std::vector<int> sizes{ 100, 500, 1000, 2000 }; // result arrays rows initialization double timesI[5][6]; double timesJ[5][6]; double timesK[5][6]; // top - left field timesI[0][0] = 0; timesJ[0][0] = 0; timesK[0][0] = 0; // first column (sizes) for (size_t i=0; i<sizes.size(); i++) { timesI[i + 1][0] = sizes[i]; timesJ[i + 1][0] = sizes[i]; timesK[i + 1][0] = sizes[i]; } // test cases for (int numberOfThreads = 1, column = 1; numberOfThreads <= 16; numberOfThreads *= 2, column++) { // result arrays columns initialization timesI[0][column] = numberOfThreads; timesJ[0][column] = numberOfThreads; timesK[0][column] = numberOfThreads; for (size_t row=0; row<sizes.size(); row++) { int size = sizes[row]; std::string matrixAFileName = "a" + std::to_string(size); std::string matrixBFileName = "b" + std::to_string(size); std::string matrixCFileName = "c" + std::to_string(size); omp_set_num_threads(2); #pragma omp parallel { #pragma omp sections { #pragma omp section { A = new Matrix(matrixAFileName); } #pragma omp section { B = new Matrix(matrixBFileName); } } } // prepare the result matrix Matrix *C = new Matrix(A->getN(), B->getM()); // multiply the matrices, save result to file and count time timesI[row + 1][column] = multiplyI(*A, *B, *C, numberOfThreads); C->writeToFile(matrixCFileName + "i"); timesJ[row + 1][column] = multiplyJ(*A, *B, *C, numberOfThreads); C->writeToFile(matrixCFileName + "j"); timesK[row + 1][column] = multiplyK(*A, *B, *C, numberOfThreads); C->writeToFile(matrixCFileName + "k"); // free the memory delete A, B, C; } } // print the times std::cout << "i - loop:" << std::endl; printTable(timesI); std::cout << "j - loop:" << std::endl; printTable(timesJ); std::cout << "k - loop:" << std::endl; printTable(timesK); // hold the screen std::cin.get(); int temp; std::cin >> temp; return 0; } void printTable(double table[5][6]) { for (int i = 0; i < 5; i++) { for (int j = 0; j < 6; j++) { std::cout << (i==0 || j==0 ? std::setprecision(0) : std::setprecision(5)) << std::fixed << table[i][j] << "\t" << (table[i][j] > 10.0f ? "" : "\t"); } std::cout << std::endl; } std::cout << std::endl; } double multiplyI(const Matrix& A, const Matrix& B, Matrix &result, int threadsNumber) { // start time masurement auto startTime = std::chrono::system_clock::now(); // check multiplication correctness condition if (A.getN() != B.getM()) { std::cout << "Nie można pomnożyć tych macierzy!" << std::endl; exit(-1); } // perform the multiplication int i, j, k; omp_set_num_threads(threadsNumber); #pragma omp parallel shared(A, B, result) private(i, j, k) { #pragma omp for for (i = 0; i < A.getM(); i++) { for (j = 0; j < B.getN(); j++) { float temp = 0; for (k = 0; k < A.getN(); k++) { temp = temp + A.getAt(i, k) * B.getAt(k, j); } result.setAt(i, j, temp); } } }; // end time and time difference print auto endTime = std::chrono::system_clock::now(); std::chrono::duration<double> time = endTime - startTime; std::cout << "Pętla i" << "\t\t" << "Wymiar: " << A.getM() << "\t" << "wątków: " << threadsNumber << "\t" << "czas: " << time.count() << "s." << std::endl; return time.count(); } double multiplyJ(const Matrix& A, const Matrix& B, Matrix& result, int threadsNumber) { // start time masurement auto startTime = std::chrono::system_clock::now(); // check multiplication correctness condition if (A.getN() != B.getM()) { std::cout << "Nie można pomnożyć tych macierzy!" << std::endl; exit(-1); } // perform the multiplication int i, j, k; omp_set_num_threads(threadsNumber); for (i = 0; i < A.getM(); i++) { #pragma omp parallel shared(A, B, result, i) private(j, k) { #pragma omp for for (j = 0; j < B.getN(); j++) { float temp = 0; for (k = 0; k < A.getN(); k++) { temp = temp + A.getAt(i, k) * B.getAt(k, j); } result.setAt(i, j, temp); } } }; // end time and time difference print auto endTime = std::chrono::system_clock::now(); std::chrono::duration<double> time = endTime - startTime; std::cout << "Pętla j" << "\t\t" << "Wymiar: " << A.getM() << "\t" << "wątków: " << threadsNumber << "\t" << "czas: " << time.count() << "s." << std::endl; return time.count(); } double multiplyK(const Matrix& A, const Matrix& B, Matrix& result, int threadsNumber) { // start time masurement auto startTime = std::chrono::system_clock::now(); // check multiplication correctness condition if (A.getN() != B.getM()) { std::cout << "Nie można pomnożyć tych macierzy!" << std::endl; exit(-1); } // perform the multiplication int i, j, k; omp_set_num_threads(threadsNumber); for (i = 0; i < A.getM(); i++) { for (j = 0; j < B.getN(); j++) { float temp = 0; #pragma omp parallel shared(A, B, result, i, j, temp) private(k) { #pragma omp for for (k = 0; k < A.getN(); k++) { temp = temp + A.getAt(i, k) * B.getAt(k, j); } result.setAt(i, j, temp); } } }; // end time and time difference print auto endTime = std::chrono::system_clock::now(); std::chrono::duration<double> time = endTime - startTime; std::cout << "Pętla k" << "\t\t" << "Wymiar: " << A.getM() << "\t" << "wątków: " << threadsNumber << "\t" << "czas: " << time.count() << "s." << std::endl; return time.count(); }
[ "beginner1986@gmail.com" ]
beginner1986@gmail.com
c311dc956b472f7fc72a2b5ad9b2257a0da2b950
9bc2462106be4df51f31e44e28ea6a78b42a3deb
/2019_05_11/b/src.cpp
3ee49129eb29e8a0b8d245ee1862c02e16dfb7a5
[]
no_license
ysuzuki19/atcoder
4c8128c8a7c7ed10fc5684b1157ab5513ba9c32e
0fbe0e41953144f24197b4dcd623ff04ef5bc4e4
refs/heads/master
2021-08-14T19:35:45.660024
2021-07-31T13:40:39
2021-07-31T13:40:39
178,597,227
0
0
null
null
null
null
UTF-8
C++
false
false
347
cpp
#include <bits/stdc++.h> using namespace std; int main(){ int i, j; int R, G, B, N; cin >> R >> G >> B >> N; int pat = 0; for(int r=0; r*R<=N; r++){ int ball = 0; for(int g=0; r*R+g*G<=N; g++){ ball = r*R + g*G; if((N-ball)/B>=0 && (N-ball)%B==0){ pat++; } } } cout << pat << endl; return 0; }
[ "msethuuh7@i.softbank.jp" ]
msethuuh7@i.softbank.jp
6333ac3a2c501dd2998c261cfc0f2ec84d85003e
87de63798f786e8f32c171554f16cc1cb05bd61f
/SystemModels/Connections/BloodTissue/BloodTissueCnFactory.cpp
e19cdc8bc001224e7682581cda6c6eb2546136a6
[]
no_license
avgolov/virtual-human
a0bd4d88b0c76f8f9c0fbf795e9c0e3ccff43d60
82636e04489efad9efe57077b8e6369d8cf5feff
refs/heads/master
2021-07-17T17:15:47.189088
2017-10-24T08:57:21
2017-10-24T08:57:21
108,100,427
1
0
null
null
null
null
UTF-8
C++
false
false
998
cpp
#include "BloodTissueCnFactory.h" #include "BaseBloodTissueCn.h" #include "BodyBloodBaseTissueCn.h" #include "../../Systems/TissueSystem/BaseTissueSys.h" #include "../../Systems/BloodSystem/BodyBloodSys.h" #include "../../Systems/BloodSystem/BodyBioChemBloodSys.h" #include "BodyBioChemTissueCn.h" namespace SystemModels { std::shared_ptr<IBloodTissueCn> BloodTissueCnFactory::Create(boost::shared_ptr<IBloodSys> system1, boost::shared_ptr<ITissueSys> system2) { if (dynamic_cast<BodyBloodSys*>(system1.get()) && dynamic_cast<BaseTissueSys*>(system2.get())) { return std::static_pointer_cast<IBloodTissueCn>(std::make_shared<BodyBloodBaseTissueCn>(system1, system2)); } if (dynamic_cast<BodyBioChemBloodSys*>(system1.get()) && dynamic_cast<BaseTissueSys*>(system2.get())) { return std::static_pointer_cast<IBloodTissueCn>(std::make_shared<BodyBioChemTissueCn>(system1, system2)); } return std::shared_ptr<IBloodTissueCn>(nullptr); } }
[ "golov.andrey@hotmail.com" ]
golov.andrey@hotmail.com
e1782d495b8422051cc6f022c75def4ad9183e71
01a42b69633daf62a2eb3bb70c5b1b6e2639aa5f
/SCUM_UI_HandsHolstersWidget3_functions.cpp
3a5926edb55e644262e8779a5377ac9703c30716
[]
no_license
Kehczar/scum_sdk
45db80e46dac736cc7370912ed671fa77fcb95cf
8d1770b44321a9d0b277e4029551f39b11f15111
refs/heads/master
2022-07-25T10:06:20.892750
2020-05-21T11:45:36
2020-05-21T11:45:36
265,826,541
1
0
null
null
null
null
UTF-8
C++
false
false
1,980
cpp
// Scum 3.79.22573 (UE 4.24) #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "../SDK.hpp" namespace Classes { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function UI_HandsHolstersWidget3.UI_HandsHolstersWidget3_C.PreConstruct // (NetRequest, Exec, NetResponse, Static, NetMulticast, MulticastDelegate, Public, Private, Protected, NetClient, DLLImport, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // bool* IsDesignTime (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void UUI_HandsHolstersWidget3_C::STATIC_PreConstruct(bool* IsDesignTime) { static auto fn = UObject::FindObject<UFunction>("Function UI_HandsHolstersWidget3.UI_HandsHolstersWidget3_C.PreConstruct"); UUI_HandsHolstersWidget3_C_PreConstruct_Params params; params.IsDesignTime = IsDesignTime; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function UI_HandsHolstersWidget3.UI_HandsHolstersWidget3_C.ExecuteUbergraph_UI_HandsHolstersWidget3 // (Net, NetResponse, Private, Protected, NetServer, HasDefaults, DLLImport, BlueprintCallable, BlueprintEvent) // Parameters: // int* EntryPoint (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData) void UUI_HandsHolstersWidget3_C::ExecuteUbergraph_UI_HandsHolstersWidget3(int* EntryPoint) { static auto fn = UObject::FindObject<UFunction>("Function UI_HandsHolstersWidget3.UI_HandsHolstersWidget3_C.ExecuteUbergraph_UI_HandsHolstersWidget3"); UUI_HandsHolstersWidget3_C_ExecuteUbergraph_UI_HandsHolstersWidget3_Params params; params.EntryPoint = EntryPoint; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } } #ifdef _MSC_VER #pragma pack(pop) #endif
[ "65712402+Kehczar@users.noreply.github.com" ]
65712402+Kehczar@users.noreply.github.com
b789f20fbc927ca2aa0ccf232f47b61bc9df937e
ef946fb8bb11daac8eb1157ca0f6efe133924c88
/StRoot/StEvent/StRnDHit.h
8c816a2edb4db56aa46a4aaa08fd87f29428afeb
[]
no_license
jdbrice/StMtdTrgMaker
b91453cb08394c1bc92da56fad657730d17c3946
45f721394a9f153e7665c2fe390d741222dd4fee
refs/heads/master
2021-01-21T13:57:01.894549
2016-05-12T23:23:48
2016-05-12T23:23:48
54,059,023
0
0
null
null
null
null
UTF-8
C++
false
false
4,326
h
/*! * \class StRnDHit * \author Mike Miller and Andrew Rose, Jan 2006 */ /*************************************************************************** * * $Id: StRnDHit.h,v 2.2 2006/09/27 18:31:43 ullrich Exp $ * * Author: Mike Miller and Andrew Rose, Jan 2006 *************************************************************************** * * Description: This is an experimental class and not final yet * *************************************************************************** * * $Log: StRnDHit.h,v $ * Revision 2.2 2006/09/27 18:31:43 ullrich * Fixed setDouble() interface. Was sooo wrong. * * Revision 2.1 2006/01/19 21:42:06 ullrich * Initial Revision. * **************************************************************************/ #ifndef StRnDHit_hh #define StRnDHit_hh #include "StHit.h" #include "StMemoryPool.hh" #include "StEnumerations.h" class StRnDHit : public StHit { public: StRnDHit(); StRnDHit(const StThreeVectorF& position, const StThreeVectorF& error, unsigned int hwPosition, float charge, unsigned char trackRefCount = 0, unsigned short idTruth=0, unsigned short quality=0, unsigned short id =0, StDetectorId = kUnknownId); ~StRnDHit(); StDetectorId detector() const; short layer() const; short ladder() const; short wafer() const; int extraByte0() const; int extraByte1() const; int key() const; int volumeId() const; double double0() const; double double1() const; double double2() const; double double3() const; double double4() const; void setLayer(short); void setLadder(short); void setWafer(short); void setExtraByte0(int); void setExtraByte1(int); void setDetectorId(StDetectorId); void setKey(int); void setVolumeId(int); void setDouble0(double); void setDouble1(double); void setDouble2(double); void setDouble3(double); void setDouble4(double); void* operator new(size_t sz,void *p) { return p;} void* operator new(size_t) { return mPool.alloc(); } void operator delete(void* p) { mPool.free(p); } friend ostream& operator<<(ostream& os, const StRnDHit& h); protected: Short_t mLayer; ///Layer Short_t mLadder; ///Ladder Short_t mWafer; ///Wafer //Extras Int_t mExtraByte0; Int_t mExtraByte1; //info to get back to StMcHit pointer: Int_t mKey; ///key from StMcHit Int_t mVolumeId; ///VolumeId from StMcHit //and 5 overflow doubles Double_t mDouble0; Double_t mDouble1; Double_t mDouble2; Double_t mDouble3; Double_t mDouble4; // this has to go once the playing and testing is over. // should be hard wired in member function. StDetectorId mDetectorId; static StMemoryPool mPool; //! ClassDef(StRnDHit,1) }; inline short StRnDHit::layer() const {return mLayer;} inline short StRnDHit::ladder() const {return mLadder;} inline short StRnDHit::wafer() const {return mWafer;} inline int StRnDHit::extraByte0() const {return mExtraByte0;} inline int StRnDHit::extraByte1() const {return mExtraByte1;} inline int StRnDHit::key() const {return mKey;} inline int StRnDHit::volumeId() const {return mVolumeId;} inline double StRnDHit::double0() const {return mDouble0;} inline double StRnDHit::double1() const {return mDouble1;} inline double StRnDHit::double2() const {return mDouble2;} inline double StRnDHit::double3() const {return mDouble3;} inline double StRnDHit::double4() const {return mDouble4;} inline void StRnDHit::setLayer(short v) {mLayer = v;} inline void StRnDHit::setLadder(short v) {mLadder = v;} inline void StRnDHit::setWafer(short v) {mWafer = v;} inline void StRnDHit::setExtraByte0(int v) {mExtraByte0=v;} inline void StRnDHit::setExtraByte1(int v) {mExtraByte1=v;} inline void StRnDHit::setKey(int v) {mKey = v;} inline void StRnDHit::setVolumeId(int v) {mVolumeId=v;} inline void StRnDHit::setDouble0(double val) {mDouble0 = val;} inline void StRnDHit::setDouble1(double val) {mDouble1 = val;} inline void StRnDHit::setDouble2(double val) {mDouble2 = val;} inline void StRnDHit::setDouble3(double val) {mDouble3 = val;} inline void StRnDHit::setDouble4(double val) {mDouble4 = val;} #endif
[ "jdb12@rice.edu" ]
jdb12@rice.edu
ceec5f9861516c5e748ed114bbf807592374978c
91262d4e1279cea5c5f638777c355cb4c8243a4b
/Chapter-03/Puzzle/Source/Puzzle/PuzzlePlayerController.cpp
7ad42a77f73a37f20b4bf04d2834a8f1bbf5a70a
[ "MIT" ]
permissive
MENGJIANGTAO/Complete-Unreal-Engine-Game-Development-Guide
0aaf6c13bd23e6b83eaf747883862ed24cc195f4
76817acb3988c57db022a7bcd04a8e5ba8ebfecf
refs/heads/master
2022-03-07T08:12:40.657991
2019-11-18T11:27:01
2019-11-18T11:27:01
null
0
0
null
null
null
null
UTF-8
C++
false
false
284
cpp
// Copyright 1998-2018 Epic Games, Inc. All Rights Reserved. #include "PuzzlePlayerController.h" APuzzlePlayerController::APuzzlePlayerController() { bShowMouseCursor = true; bEnableClickEvents = true; bEnableTouchEvents = true; DefaultMouseCursor = EMouseCursor::Crosshairs; }
[ "56333060+ashishjPackt@users.noreply.github.com" ]
56333060+ashishjPackt@users.noreply.github.com
203ec0a6504fe53b101c690b92c87c45cba6d420
b32ab8ff6cfcb2f1c12692773a37ab009d75526a
/randoms/random_std.cpp
1e5aa4bf5a3dc8f1aa9c3cc2f2a1eb7391bbb19b
[]
no_license
un44444444/magicbox
61a7035731ccba867e476896e6f0ac736941ce6b
982140f5b0bb17ef09b902720417d1baf94ecaaa
refs/heads/master
2020-05-27T15:42:12.679145
2014-11-24T07:33:09
2014-11-24T07:33:09
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,744
cpp
#include "random_std.h" //see http://www.cplusplus.com/reference/random/ #include <random>//require c++11 #include "seed.h" #include "utils/log.h" // CRandomGenerator class CRandomGenerator { public: static CRandomGenerator* Instance(int rstart, int rend); void ChangeParam(const std::string& params); int GenarateNumber(); protected: private: CRandomGenerator(int rstart, int rend); CRandomGenerator(const CRandomGenerator& rhs); ~CRandomGenerator(); private: std::default_random_engine* m_pGenerator; std::uniform_int_distribution<int>* m_pDistribution; }; CRandomGenerator* CRandomGenerator::Instance(int rstart, int rend) { static CRandomGenerator instance(rstart, rend); return &instance; } CRandomGenerator::CRandomGenerator(int rstart, int rend) { m_pGenerator = new std::default_random_engine(get_32bit_seed()); m_pDistribution = new std::uniform_int_distribution<int>(rstart, rend); } CRandomGenerator::~CRandomGenerator() { delete m_pGenerator; m_pGenerator = NULL; delete m_pDistribution; m_pDistribution = NULL; } void CRandomGenerator::ChangeParam(const std::string& params) { MAGICBOX_LOG_DEBUG(params); } int CRandomGenerator::GenarateNumber() { int number = (*m_pDistribution)(*m_pGenerator); return number; } // CRandomStd static CRandomGenerator* s_pInstance = NULL; CRandomStd::CRandomStd(int low, int high) { s_pInstance = CRandomGenerator::Instance(low, high); } CRandomStd::CRandomStd(int low, int high, const std::string& params) { s_pInstance = CRandomGenerator::Instance(low, high); s_pInstance->ChangeParam(params); } CRandomStd::~CRandomStd() { } int CRandomStd::RandomNumber() { return s_pInstance->GenarateNumber(); }
[ "un44444444@gmail.com" ]
un44444444@gmail.com
d4d13b53a6e20ddd6e8a22515a13d02a9c123fb3
38477b69e2f499505f149f096dfe5f962bb7d33b
/VSProject/gSpan/gSpan/main.cpp
422217fdf90e44764baf9de11eba57f8d269bd86
[]
no_license
wsgan001/gSpan
0f2e03df43ec728c878d0bdf5606eacac65fbc27
2cc04b9358d3d1b27488a3027c6b5289afc211c9
refs/heads/master
2021-05-09T20:38:28.958306
2015-10-31T14:57:34
2015-10-31T14:57:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
391
cpp
#include "head.h" #include "Solver.h" Solver solver; void init() { solver.init("in.txt", 0.6); } void input() { solver.input(); } void solve() { solver.solve(); } void output() { solver.output(); } int main() { //freopen("debug.txt", "w", stdout); init(); input(); solve(); output(); return 0; } /* Test data set * Graph.data * cntGraph == 10000 * vn < 250 * en < 250 */
[ "xysmlx@163.com" ]
xysmlx@163.com
f0a6aaa2b4f04d582c0563618f3b40e633eff226
804a1a6b44fe3a013352d04eaf47ea6ad89f9522
/dbms/src/Parsers/ParserShowCreateAccessEntityQuery.cpp
0caba5e0495f56fb1260307050ab099035b2edb3
[ "Apache-2.0" ]
permissive
kssenii/ClickHouse
680f533c3372094b92f407d49fe14692dde0b33b
7c300d098d409772bdfb26f25c7d0fe750adf69f
refs/heads/master
2023-08-05T03:42:09.498378
2020-02-13T17:49:51
2020-02-13T17:49:51
232,254,869
10
3
Apache-2.0
2021-06-15T11:34:08
2020-01-07T06:07:06
C++
UTF-8
C++
false
false
2,022
cpp
#include <Parsers/ParserShowCreateAccessEntityQuery.h> #include <Parsers/ASTShowCreateAccessEntityQuery.h> #include <Parsers/CommonParsers.h> #include <Parsers/parseIdentifierOrStringLiteral.h> #include <Parsers/parseDatabaseAndTableName.h> #include <assert.h> namespace DB { bool ParserShowCreateAccessEntityQuery::parseImpl(Pos & pos, ASTPtr & node, Expected & expected) { if (!ParserKeyword{"SHOW CREATE"}.ignore(pos, expected)) return false; using Kind = ASTShowCreateAccessEntityQuery::Kind; Kind kind; if (ParserKeyword{"QUOTA"}.ignore(pos, expected)) kind = Kind::QUOTA; else if (ParserKeyword{"POLICY"}.ignore(pos, expected) || ParserKeyword{"ROW POLICY"}.ignore(pos, expected)) kind = Kind::ROW_POLICY; else return false; String name; bool current_quota = false; RowPolicy::FullNameParts row_policy_name; if (kind == Kind::ROW_POLICY) { String & database = row_policy_name.database; String & table_name = row_policy_name.table_name; String & policy_name = row_policy_name.policy_name; if (!parseIdentifierOrStringLiteral(pos, expected, policy_name) || !ParserKeyword{"ON"}.ignore(pos, expected) || !parseDatabaseAndTableName(pos, expected, database, table_name)) return false; } else { assert(kind == Kind::QUOTA); if (ParserKeyword{"CURRENT"}.ignore(pos, expected)) { /// SHOW CREATE QUOTA CURRENT current_quota = true; } else if (parseIdentifierOrStringLiteral(pos, expected, name)) { /// SHOW CREATE QUOTA name } else { /// SHOW CREATE QUOTA current_quota = true; } } auto query = std::make_shared<ASTShowCreateAccessEntityQuery>(kind); node = query; query->name = std::move(name); query->current_quota = current_quota; query->row_policy_name = std::move(row_policy_name); return true; } }
[ "vitbar@yandex-team.ru" ]
vitbar@yandex-team.ru
434e7266cdf89ce0003e579e1dbcdc6d3a6ca235
67ca2eedf4831569f81ef1c746b6befc818be6fe
/OpenGL_6/OpenGL_6/dirLight.h
f0dc36a4de2f6ae11b336db7c8cc30690f3a469b
[]
no_license
arepina/openGL
94bfbeeb15ccd25f8a18e44fc610a2659dc7382f
d39f9d1b32cb0b73875f99b36d257182ca81c619
refs/heads/master
2021-09-08T12:55:15.543250
2018-03-09T20:34:30
2018-03-09T20:34:30
110,345,400
0
0
null
null
null
null
UTF-8
C++
false
false
553
h
#pragma once #include "shaders.h" /******************************** Class: CDirectionalLight Purpose: Support class for adding directional lights to scene. ********************************/ class CDirectionalLight { public: glm::vec3 vColor; // Color of directional light glm::vec3 vDirection; // and its direction float fAmbient; int iSkybox; void SetUniformData(CShaderProgram* spProgram, string sLightVarName); CDirectionalLight(); CDirectionalLight(glm::vec3 a_vColor, glm::vec3 a_vDirection, float a_fAmbient, int a_iSkybox); };
[ "anastasiya.repina2012@yandex.ru" ]
anastasiya.repina2012@yandex.ru
06fbd51e3f65289794e34dd85f50c655d51df1c2
7ea45377de05a91d447687c53e1a836cfaec4b11
/fb_hackercup/qualround_14/square_detector.cpp
9503763ace3d4e558e03fe0f742962de546cfe00
[]
no_license
saikrishna17394/Code
d2b71efe5e3e932824339149008c3ea33dff6acb
1213f951233a502ae6ecf2df337f340d8d65d498
refs/heads/master
2020-05-19T14:16:49.037709
2017-01-26T17:17:13
2017-01-26T17:17:13
24,478,656
0
0
null
null
null
null
UTF-8
C++
false
false
1,382
cpp
#include <iostream> #include <cstdio> #include <vector> #include <algorithm> #include <set> #include <map> #include <bitset> #include <cstring> #include <string> #include <cmath> #include <queue> #define lli long long int #define ii pair<long long int,long long int> #define mp make_pair #define mod 1000000007 #define inf 999999999 using namespace std; inline void inp(int &n ) {//fast input function n=0; int ch=getchar_unlocked(),sign=1; while( ch < '0' || ch > '9' ){if(ch=='-')sign=-1; ch=getchar_unlocked();} while( ch >= '0' && ch <= '9' ) n=(n<<3)+(n<<1)+ ch-'0', ch=getchar_unlocked(); n=n*sign; } int main() { freopen("square_detector.txt", "r", stdin); freopen("square_detector_out.txt", "w", stdout); int t,n,cnt,x,y,k; bool ok; string s[20]; inp(t); for(int a=1;a<=t;a++) { inp(n); for(int i=0;i<n;i++) cin>>s[i]; cnt=0; ok=true; for(int i=0;i<n;i++) { for(int j=0;j<n;j++) { if(s[i][j]=='#') { cnt++; if(ok) { x=i; y=j; ok=false; } } } } k=sqrt(cnt); if(k*k!=cnt || x+k>n || y+k>n) { printf("Case #%d: NO\n",a); continue; } ok=false; for(int i=x;i<x+k;i++) { for(int j=y;j<y+k;j++) { if(s[i][j]=='.') { ok=true; break; } } if(ok) break; } if(ok) printf("Case #%d: NO\n",a); else printf("Case #%d: YES\n",a); } return 0; }
[ "saikrishna17394@gmail.com" ]
saikrishna17394@gmail.com
cf9b6db226ac7351fa5115ae324bd00367adf3a7
a16da86a4b90cdae3963f6adc46315d7a9056cbb
/Source/UsefulFunctions.cpp
c2f7e0af679c42ce521b746da72bf915e43a3d66
[ "MIT", "Unlicense" ]
permissive
Project-3-UPC-DDV-BCN/Project3
0b18abfa21c97db1e036b4a20fa125e0243699d7
3fb345ce49485ccbc7d03fb320623df6114b210c
refs/heads/master
2021-07-15T10:55:35.559526
2018-10-19T14:35:14
2018-10-19T14:35:14
114,779,047
10
1
MIT
2018-04-23T21:26:45
2017-12-19T15:05:53
C++
UTF-8
C++
false
false
2,731
cpp
#include <ctype.h> #include "UsefulFunctions.h" #include <stdio.h> #include <cmath> #include <random> #include <limits> #include <stdlib.h> #include "Globals.h" #include "MathGeoLib\TransformOps.h" // Returns the angle between two points in degrees float AngleFromTwoPoints(float x1, float y1, float x2, float y2) { float deltaY = y2 - y1; float deltaX = x2 - x1; float angle = atan2(deltaY, deltaX) * RADTODEG; if (angle <= 180) return -angle; if (angle > 180) return angle / 2; } float NormalizeAngle(float angle) { if (angle > 360) { int multiplers = angle / 360; angle -= (360 * multiplers); } if (angle < -360) { int multiplers = abs(angle) / 360; angle += (360 * multiplers); } return angle; } float4x4 RotateArround(float4x4 to_rotate, float3 center, float angle_x, float angle_y, float angle_z) { float3 to_rotate_pos; Quat to_rotate_rot; float3 to_rotate_scal; to_rotate.Decompose(to_rotate_pos, to_rotate_rot, to_rotate_scal); float3 distance = to_rotate_pos - center; Quat X(to_rotate.WorldX(), angle_x * DEGTORAD); Quat Y(to_rotate.WorldY(), angle_y * DEGTORAD); Quat Z(to_rotate.WorldZ(), angle_z * DEGTORAD); distance = X.Transform(distance); distance = Y.Transform(distance); distance = Z.Transform(distance); float4x4 ret = to_rotate; ret[0][3] = distance.x + center.x; ret[1][3] = distance.y + center.y; ret[2][3] = distance.z + center.z; return ret; } float DistanceFromTwoPoints(float x1, float y1, float x2, float y2) { int distance_x = x2 - x1; int distance_y = y2 - y1; float sign = ((distance_x * distance_x) + (distance_y * distance_y)); float dist = abs((distance_x * distance_x) + (distance_y * distance_y)); if (sign > 0) return sqrt(dist); else return -sqrt(dist); } bool TextCmp(const char * text1, const char * text2) { bool ret = false; if (text1 == nullptr || text2 == nullptr) return false; if (strcmp(text1, text2) == 0) ret = true; return ret; } void TextCpy(char* destination, const char * origen) { if (origen != nullptr) { strcpy_s(destination, strlen(origen), origen); } } void Tokenize(std::string string, const char separator, std::list<std::string>& tokens) { int i = 0; const char* str = string.c_str(); while (*(str + i) != 0) { std::string temporal; while (*(str + i) != separator && *(str + i) && *(str + i) != '\n') { temporal.push_back(*(str + i)); i++; } tokens.push_back(temporal); if (*(str + i)) i++; } } std::string ToUpperCase(std::string str) { for (uint i = 0; i < str.size(); i++) { str[i] = toupper(str[i]); } return str; } std::string ToLowerCase(std::string str) { for (uint i = 0; i < str.size(); i++) { str[i] = tolower(str[i]); } return str; }
[ "gsunyercaldu@gmail.com" ]
gsunyercaldu@gmail.com
77f0646fc78709efd3e8e8b512ba9811a93def23
a23f3487ebe1a870c3d4c24664295d1140027290
/ARALGIS/VehicleDetection/SourceFiles/VehicleDetection.cpp
2d46f2e03dcecc743cc0353164fbce786343db58
[]
no_license
alisezgin/ARALGIS
c5617393daf2aab84e6b1d9b6bc93bd53d31114d
55ce3d55cf15edf818b5f0bd944a1d7b8f684fa9
refs/heads/master
2021-01-19T09:48:55.611879
2017-07-31T13:23:36
2017-07-31T13:23:36
87,786,703
0
1
null
null
null
null
UTF-8
C++
false
false
27,179
cpp
#include "stdafx.h" #include "ARALGIS.h" #include "..\HeaderFiles\VehicleDetection.h" #include "MainFrm.h" #include "ARALGISView.h" ////////////////////////////////////////////////////////////////////// // Construction/Destruction ////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::CVehicleDetection // // DESCRIPTION: C'tor // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// CVehicleDetection::CVehicleDetection() { bRun = FALSE; } //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::CVehicleDetection // // DESCRIPTION: D'tor // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// CVehicleDetection::~CVehicleDetection() { Shutdown(); } //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::CVehicleDetection // // DESCRIPTION: starts the CameraDBServer Thread // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// BOOL CVehicleDetection::Start(CMainFrame* pFrame) { if (bRun) { TRACE("_beginthreadex(...) failure, for Launch ThreadVehicleDetection::Start\n"); return FALSE; } TRACE("Vehicle Detection Thread Starting ...\n"); m_pFrame = pFrame; bRun = TRUE; ShutdownEvent = CreateEvent(NULL, TRUE, FALSE, NULL); ProcessingFinishedEvent = CreateEvent(NULL, TRUE, TRUE, NULL); /// created as Set, 3rd argument is TRUE !!!!!!!! ProcessDataEvent = CreateEvent(NULL, TRUE, FALSE, NULL); // Launch Vehicle Detection Thread ThreadVehicleDetection = (HANDLE)_beginthreadex(NULL, 0, VehicleDetectionThread, this, 0, &ThreadIDVD ); if (!ThreadVehicleDetection) { TRACE("_beginthreadex(...) failure, ThreadVehicleDetection::Start\n"); return FALSE; } TRACE("ThreadVehicleDetection ThreadID %x ...\n", ThreadIDVD); TRACE(L"VehicleDetection Camera Interface Thread Starting ...\n"); // Launch CameraInterface Thread ThreadCameraInterface = (HANDLE)_beginthreadex( NULL, 0, CameraInterfaceThread, this, 0, &ThreadIDCI ); if (!ThreadCameraInterface) { TRACE("_beginthreadex(...) failure, VehicleDetection-ThreadCameraInterface::Start\n"); return FALSE; } TRACE("VehicleDetection-ThreadCameraInterface ThreadID %x ...\n", ThreadIDCI); return TRUE; } //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::Shutdown // // DESCRIPTION: stops the CameraDBServer thread // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// BOOL CVehicleDetection::Shutdown() { if (!bRun) return FALSE; TRACE("ThreadVehicleDetection Shutting down ...\n"); SetEvent(ShutdownEvent); WaitForSingleObject(ThreadVehicleDetection, INFINITE); WaitForSingleObject(ThreadCameraInterface, INFINITE); CloseHandle(ShutdownEvent); CloseHandle(ProcessingFinishedEvent); CloseHandle(ProcessDataEvent); CloseHandle(ThreadVehicleDetection); CloseHandle(ThreadCameraInterface); bRun = FALSE; return TRUE; } //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::CameraInterfaceThread // // DESCRIPTION: thread function for starting camera interface thread // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// UINT __stdcall CVehicleDetection::CameraInterfaceThread(LPVOID pParam) { CVehicleDetection *pVehicleDetection = (CVehicleDetection*)pParam; int dFrmCntr; TRACE("CameraInterfaceThread Started\n"); HANDLE Handles[2]; Handles[0] = pVehicleDetection->ShutdownEvent; Handles[1] = g_IntermediateImageReadyEvent; for (;;) { DWORD EventCaused = WaitForMultipleObjects( 2, Handles, FALSE, INFINITE); if (EventCaused == WAIT_FAILED || EventCaused == WAIT_OBJECT_0) { if (EventCaused == WAIT_FAILED) TRACE("WaitForMultipleObjects failure at CameraInterfaceThread", GetLastError()); else TRACE("CameraInterfaceThread is shutting Down normally...\n"); return THREADEXIT_SUCCESS; } // g_IntermediateImageReadyEvent is received else if (EventCaused == WAIT_OBJECT_0 + 1) { TRACE("g_IntermediateImageReadyEvent received \n"); if (g_AutoDetect_Type != NO_AUTO_VEHICLE_DETECT) { dFrmCntr = g_IntermediateCounter; } else { dFrmCntr = 1; } if (dFrmCntr == 1) { TRACE("waiting EventTTTTTTTT \n"); WaitForSingleObject(pVehicleDetection->ProcessingFinishedEvent, INFINITE); ResetEvent(pVehicleDetection->ProcessingFinishedEvent); pVehicleDetection->m_dProcessedFrameCounter = 0; pVehicleDetection->m_dFrameCounter = dFrmCntr; pVehicleDetection->m_isStopSignalled = false; //SetEvent(pVehicleDetection->ProcessDataEvent); } pVehicleDetection->m_dFrameCounter = dFrmCntr; TRACE("THR_2 FRM_CNT %d PRS_CNT %d \n", pVehicleDetection->m_dFrameCounter, pVehicleDetection->m_dProcessedFrameCounter); if (g_AutoDetect_Type != NO_AUTO_VEHICLE_DETECT) { if (pVehicleDetection->m_dFrameCounter - pVehicleDetection->m_dProcessedFrameCounter - 1 == 0) { TRACE(L"SetEvent(pVehicleDetection->ProcessDataEvent) \n"); SetEvent(pVehicleDetection->ProcessDataEvent); } } else { SetEvent(pVehicleDetection->ProcessDataEvent); } ResetEvent(g_IntermediateImageReadyEvent); } } // infite for loop return THREADEXIT_SUCCESS; } //////////////////////////////////////////////////////////////////////////////// // // FUNCTION: CVehicleDetection::VehicleDetectionThread // // DESCRIPTION: thread function for starting vehicle detection thread from test image // // INPUTS: // // NOTES: // // MODIFICATIONS: // //////////////////////////////////////////////////////////////////////////////// UINT __stdcall CVehicleDetection::VehicleDetectionThread(LPVOID pParam) { CVehicleDetection *pVehicleDetection = (CVehicleDetection*)pParam; TRACE("VehicleDetectionThread Started\n"); CView * pView = pVehicleDetection->m_pFrame->GetActiveView(); LPARAM pLparam; pLparam = reinterpret_cast<LPARAM>("ARALGIS"); bool bIsProcessingFinished; bool bIsCarFound = false; cv::Mat inGray; cv::Mat inClr; int nRows; int nCols; uchar* dataPtr1; float* fMean; fMean = new float[100000]; ////////////////////////////////////////////// int dAnalysisWindow = 10; float fMeanWindow; float fStdWindow; bool bBegIdxFound; bool bEndIdxFound; float fMeanWindowPrev, fMeanWindowCurr; float fStdWindowPrev, fStdWindowCurr; float fMeanWindowPrev2, fStdWindowPrev2; float fMeanWindowPrev3, fStdWindowPrev3; float fCoeffOfVar1, fCoeffOfVar2; //int k; fStdWindowPrev = fStdWindowCurr = 0.0; fMeanWindowPrev = fMeanWindowCurr = 0; fMeanWindowPrev2 = fStdWindowPrev2 = 0.0; float fMeanMeanStart1, fMeanMeanStart2; float fStdMeanStart1, fStdMeanStart2; int dMeanStartCtr1, dMeanStartCtr2; int dStartCancelCounter = 0; float fStartMean = 0.0; float fStartStd = 0.0; int dThresholdStartControl = 200; int dStartZeroStdCntr = 0; int dStartZeroStdThreshold = 5; int dStdSpikeCounterStart = 0; int dSpikeCtrTresholdStart = 30; fMeanMeanStart1 = fMeanMeanStart2 = 0.0; fStdMeanStart1 = fStdMeanStart2 = 0.0; dMeanStartCtr1 = 0; dMeanStartCtr2 = 0; float fMeanMeanEnd1, fMeanMeanEnd2; float fStdMeanEnd1, fStdMeanEnd2; int dMeanEndCtr1, dMeanEndCtr2; int dEndCancelCounter = 0; float fEndMean = 0.0; float fEndStd = 0.0; fMeanMeanEnd2 = 0.0; fStdMeanEnd2 = 0.0; fMeanMeanStart1 = fMeanMeanStart2 = (float)0.0; fStdMeanStart1 = fStdMeanStart2 = (float)0.0; dMeanEndCtr1 = dMeanEndCtr2 = 0; int dThresholdEndControl = 200; int dStdSpikeCounterEnd = 0; int dSpikeCtrTresholdEnd = 15; int dSmallStdCounterEnd = 0; int dSmallStdCounterTresholdEnd = 5; float fCVEnd; int dCVEndCounter = 0; int dCVEndCounterThreshold = 10; float dMagicMultiplier = (float)0.3; float dMagicMultiplier1 = (float)0.10; float dMagicMultiplier2 = (float) 0.05; float dMagicMultiplier3 = (float)0.01; bool bStartPassedTest = false; bool bEndPassedTest = false; ////////////////////////////////////////////// HANDLE Handles[2]; Handles[0] = pVehicleDetection->ShutdownEvent; Handles[1] = pVehicleDetection->ProcessDataEvent; for (;;) { DWORD EventCaused = WaitForMultipleObjects( 2, Handles, FALSE, INFINITE); if (EventCaused == WAIT_FAILED || EventCaused == WAIT_OBJECT_0) { if (EventCaused == WAIT_FAILED) TRACE("WaitForMultipleObjects failure at VehicleDetectionThread", GetLastError()); else TRACE("VehicleDetectionThread is shutting Down normally...\n"); delete[] fMean; return THREADEXIT_SUCCESS; } // ProcessDataEvent is received else if (EventCaused == WAIT_OBJECT_0 + 1) { if (pVehicleDetection->m_dFrameCounter == 1) { TRACE("THR_1 Init\n"); pVehicleDetection->m_dlineCounter = 0; g_dEndIndex = g_dBeginIndex = 0; fStdWindowCurr = (float)0.0; fStdWindowPrev = (float)0.0; fStdWindowPrev2 = (float)0.0; fStdWindowPrev3 = (float)0.0; fMeanWindowCurr = (float)0.0; fMeanWindowPrev = (float)0.0; fMeanWindowPrev2 = (float)0.0; fMeanWindowPrev3 =(float)0.0; bEndIdxFound = false; bBegIdxFound = false; bIsCarFound = false; g_dCarDetectCount = 0; g_CarFound = FALSE; dMeanStartCtr1 = 0; dMeanStartCtr2 = 0; ///////// dStartCancelCounter = 0; fStartMean =(float)0.0; fStartStd = (float)0.0; dThresholdStartControl = 200; dStartZeroStdCntr = 0; dStartZeroStdThreshold = 5; dStdSpikeCounterStart = 0; dSpikeCtrTresholdStart = 30; dEndCancelCounter = 0; fEndMean = 0.0; fEndStd = 0.0; fMeanMeanEnd2 = (float)0.0; fStdMeanEnd2 = (float)0.0; fMeanMeanStart1 = fMeanMeanStart2 = (float)0.0; fStdMeanStart1 = fStdMeanStart2 = (float)0.0; dMeanEndCtr1 = 0; dMeanEndCtr2 = 0; dThresholdEndControl = 200; dStdSpikeCounterEnd = 0; dSpikeCtrTresholdEnd = 15; dSmallStdCounterEnd = 0; dSmallStdCounterTresholdEnd = 5; dCVEndCounter = 0; dCVEndCounterThreshold = 10; bStartPassedTest = false; bEndPassedTest = false; ///////// } else { g_dEndIndex = g_dBeginIndex = 0; fStdWindowCurr = (float)0.0; fStdWindowPrev = (float)0.0; fStdWindowPrev2 = (float)0.0; fStdWindowPrev3 = (float)0.0; fMeanWindowCurr = (float)0.0; fMeanWindowPrev = (float)0.0; fMeanWindowPrev2 = (float)0.0; fMeanWindowPrev3 = (float)0.0; bEndIdxFound = false; bBegIdxFound = false; bIsCarFound = false; g_dCarDetectCount = 0; g_CarFound = FALSE; dMeanStartCtr1 = 0; dMeanStartCtr2 = 0; ///////// dStartCancelCounter = 0; fStartMean = (float)0.0; fStartStd = (float)0.0; dThresholdStartControl = 200; dStartZeroStdCntr = 0; dStartZeroStdThreshold = 5; dStdSpikeCounterStart = 0; dSpikeCtrTresholdStart = 30; dEndCancelCounter = 0; fEndMean = 0.0; fEndStd = 0.0; fMeanMeanEnd2 = (float)0.0; fStdMeanEnd2 = (float)0.0; dMeanEndCtr2 = 0; fMeanMeanStart1 = fMeanMeanStart2 = (float)0.0; fStdMeanStart1 = fStdMeanStart2 = (float)0.0; dMeanEndCtr1 = 0; dMeanEndCtr2 = 0; dThresholdEndControl = 200; dStdSpikeCounterEnd = 0; dSpikeCtrTresholdEnd = 15; dSmallStdCounterEnd = 0; dSmallStdCounterTresholdEnd = 5; dCVEndCounter = 0; dCVEndCounterThreshold = 10; bStartPassedTest = false; bEndPassedTest = false; ///TRACE("\n\n\n RESETTING THINGS !!!!!!!!!!!!!!!!!!!\n\n\n"); } //TRACE("\n STARTING WHILE \n"); bIsProcessingFinished = false; while ((bIsProcessingFinished == false) ) { TRACE("PRS FRM-CNT %d \n", pVehicleDetection->m_dProcessedFrameCounter); if (g_CameraPixelBits == 24) { inClr = g_CVImageTestIntermediate[pVehicleDetection->m_dProcessedFrameCounter].clone(); cv::cvtColor(inClr, inGray, CV_RGB2GRAY); } else { if (g_AutoDetect_Type != NO_AUTO_VEHICLE_DETECT) { inGray.create(g_CVImageTestIntermediate[pVehicleDetection->m_dProcessedFrameCounter].size(), g_CVImageTestIntermediate[pVehicleDetection->m_dProcessedFrameCounter].type()); inGray = g_CVImageTestIntermediate[pVehicleDetection->m_dProcessedFrameCounter].clone(); } else { inGray.create(g_CVImageTest.size(), g_CVImageTest.type()); inGray = g_CVImageTest.clone(); } } nRows = inGray.rows; nCols = inGray.cols; fStdWindowPrev = fStdWindowCurr = 0.0; fMeanWindowPrev = fMeanWindowCurr = 0; fMeanWindowPrev2 = fStdWindowPrev2 = 0.0; fMeanWindowPrev3 = fStdWindowPrev3 = 0.0; { g_dEndIndex = g_dBeginIndex = 0; fStdWindowCurr = (float)0.0; fStdWindowPrev = (float)0.0; fStdWindowPrev2 = (float)0.0; fStdWindowPrev3 = (float)0.0; fMeanWindowCurr = (float)0.0; fMeanWindowPrev = (float)0.0; fMeanWindowPrev2 = (float)0.0; fMeanWindowPrev3 = (float)0.0; bEndIdxFound = false; bBegIdxFound = false; bIsCarFound = false; g_CarFound = FALSE; g_dCarDetectCount = 0; dMeanStartCtr1 = 0; dMeanStartCtr2 = 0; ///////// dStartCancelCounter = 0; fStartMean = (float)0.0; fStartStd = (float)0.0; dThresholdStartControl = 200; dStartZeroStdCntr = 0; dStartZeroStdThreshold = 5; dStdSpikeCounterStart = 0; dSpikeCtrTresholdStart = 30; dEndCancelCounter = 0; fEndMean = 0.0; fEndStd = 0.0; fMeanMeanEnd2 = (float)0.0; fStdMeanEnd2 = (float)0.0; fMeanMeanStart1 = fMeanMeanStart2 = (float)0.0; fStdMeanStart1 = fStdMeanStart2 = (float)0.0; dThresholdEndControl = 200; dMeanEndCtr1 = 0; dMeanEndCtr2 = 0; dStdSpikeCounterEnd = 0; dSpikeCtrTresholdEnd = 15; dSmallStdCounterEnd = 0; dSmallStdCounterTresholdEnd = 5; dCVEndCounter = 0; dCVEndCounterThreshold = 10; bStartPassedTest = false; bEndPassedTest = false; //TRACE("\n\n\n RESETTING THINGS !!!!!!!!!!!!!!!!!!!\n\n\n"); } TRACE("lineCounter-1 %d \n", pVehicleDetection->m_dlineCounter); for (int i = 0; i < nRows; i++) { dataPtr1 = inGray.ptr<uchar>(i); fMean[pVehicleDetection->m_dlineCounter] = 0.0; for (int j = 0; j < nCols; j++) { fMean[pVehicleDetection->m_dlineCounter] += (uchar)dataPtr1[j]; } fMean[pVehicleDetection->m_dlineCounter] = (float)((float)fMean[pVehicleDetection->m_dlineCounter] / (float)nCols); pVehicleDetection->m_dlineCounter++; } TRACE("lineCounter-2 %d \n", pVehicleDetection->m_dlineCounter); #ifdef DEBUG_BORA FILE* fp; fopen_s(&fp, "C:\\Users\\bora\\Desktop\\sil\\meanStd.txt", "w"); #endif for (int k = 0; k < pVehicleDetection->m_dlineCounter - dAnalysisWindow; k++) { fMeanWindow = 0; for (int i = k; i < (dAnalysisWindow + k); i++) { fMeanWindow += fMean[i]; } fMeanWindow = fMeanWindow / (float)dAnalysisWindow; fStdWindow = 0; for (int i = k; i < (dAnalysisWindow + k); i++) { fStdWindow += ((fMeanWindow - fMean[i]) * (fMeanWindow - fMean[i])); } fStdWindow = fStdWindow / (float)dAnalysisWindow; fStdWindow = sqrtf(fStdWindow); if (bBegIdxFound == false) { fMeanMeanStart1 += fMeanWindow; fStdMeanStart1 += fStdWindow; dMeanStartCtr1++; } if (bBegIdxFound == true) { fMeanMeanStart2 += fMeanWindow; fStdMeanStart2 += fStdWindow; dMeanStartCtr2++; } if (bEndIdxFound == true) { fMeanMeanEnd2 += fMeanWindow; fStdMeanEnd2 += fStdWindow; dMeanEndCtr2++; } fStdWindowPrev3 = fStdWindowPrev2; fMeanWindowPrev3 = fMeanWindowPrev2; fStdWindowPrev2 = fStdWindowPrev; fMeanWindowPrev2 = fMeanWindowPrev; fStdWindowPrev = fStdWindowCurr; fMeanWindowPrev = fMeanWindowCurr; fMeanWindowCurr = fMeanWindow; fStdWindowCurr = fStdWindow; fCoeffOfVar1 = fMeanWindowPrev / fStdWindowPrev; fCoeffOfVar2 = fMeanWindowCurr / fStdWindowCurr; // check if begin index is still valid if ((dMeanStartCtr2 < dThresholdStartControl) && (dMeanStartCtr2 > 4)) { //TRACE("\nChecking BEGIN for Index %d MeanCurr %f MeanBegin %f CurrentCV %f PrevCV %f CurrentStd %f PrevStd %f CntrlValue %d \n", // k, fMeanWindowCurr, fMeanMeanStart1, fCoeffOfVar2, fCoeffOfVar1, fStdWindowCurr, fStdWindowPrev, dMeanStartCtr2); { if (fStdWindowCurr < 0.1) { dStdSpikeCounterStart++; } else { dStdSpikeCounterStart = 0; } if (fStdWindowCurr == 0.0) { dStartZeroStdCntr++; //TRACE("\n\n\nSTART ZERO STD %d \n\n\n", dStartZeroStdCntr); } if ((fCoeffOfVar2 > 3000) || (fStdWindowCurr < 0.1)) { if ( ( (fStdWindowCurr > (1.0 - dMagicMultiplier) * fStdMeanStart1) && (fStdWindowCurr < (1.0 + dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev >(1.0 - dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev < (1.0 + dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev2 >(1.0 - dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev2 < (1.0 + dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev3 >(1.0 - dMagicMultiplier) * fStdMeanStart1) && (fStdWindowPrev3 < (1.0 + dMagicMultiplier) * fStdMeanStart1) ) || (dStdSpikeCounterStart > dSpikeCtrTresholdStart) || (dStartZeroStdCntr >= dStartZeroStdThreshold) ) { if ((fCoeffOfVar1 > 2000) || (dStartZeroStdCntr >= dStartZeroStdThreshold)) { bBegIdxFound = FALSE; g_dBeginIndex = 0; fMeanMeanStart1 = fMeanMeanStart2; fStdMeanStart1 = fStdMeanStart2; dMeanStartCtr1 = dMeanStartCtr2; if (fStartMean != 0.0) { fMeanMeanStart1 += fStartMean; fMeanMeanStart1 /= 2.0; fStartMean = 0.0; fStdMeanStart1 += fStartStd; fStdMeanStart1 /= 2.0; fStartStd = 0.0; } fMeanMeanStart2 = 0.0; fStdMeanStart2 = 0.0; dMeanStartCtr2 = 0; dStartZeroStdCntr = 0; dStartCancelCounter++; TRACE("\nCancelling Start.... for %d time(s) \n", dStartCancelCounter); } } } } if ((fMeanWindowCurr > fMeanMeanStart1*(1.0 - dMagicMultiplier2)) && (dStdSpikeCounterStart == 0)) { dThresholdStartControl = 100; } if ((fMeanWindowCurr > fMeanMeanStart1*(1.0 - dMagicMultiplier3)) && (dStdSpikeCounterStart == 0)) { dThresholdStartControl = 20; } } if ((dMeanStartCtr2 > dThresholdStartControl) && (bBegIdxFound == true)) { bStartPassedTest = true; } /// end of begin index control /// check if end is still valid if ((dMeanEndCtr2 < dThresholdEndControl) && (dMeanEndCtr2 > 4)) { //TRACE("\nChecking end for Index %d MeanCurr %f MeanBegin %f CurrentCV %f PrevCV %f CurrentStd %f PrevStd %f CntrlValue %d THreshold %d \n", // k, fMeanWindowCurr, fMeanMeanStart1, fCoeffOfVar2, fCoeffOfVar1, fStdWindowCurr, fStdWindowPrev, dMeanEndCtr2, dThresholdEndControl); if ((fStdWindowCurr > fStdMeanStart1*1.3) && (fStdWindowCurr > 0.1)) { dStdSpikeCounterEnd++; //TRACE("\n!!!!!!!Checking end for Index %d fStdMeanStart1 %f fStdMeanEnd2 %f Counter %d CntrlValue %d \n", // k, fStdMeanStart1, fStdWindowCurr, dStdSpikeCounterEnd, dMeanEndCtr2); } if (fStdWindowCurr < 0.05) { dSmallStdCounterEnd++; } if (dSmallStdCounterEnd >= dSmallStdCounterTresholdEnd) { if (dThresholdEndControl > 20) { dThresholdEndControl = 20; dSmallStdCounterEnd = 0; dMeanEndCtr2 = 0;; } } fCVEnd = fMeanMeanEnd2 / fStdMeanEnd2; //TRACE("\nEND CV %f\n", fCVEnd); if (fCVEnd > (float) 1500.0) { dCVEndCounter++; } if (dCVEndCounter > dCVEndCounterThreshold) { if (dThresholdEndControl > 20) { dThresholdEndControl = 20; //TRACE("\n\n\nEND BIG CV Counter %d \n\n\n", dCVEndCounter); dCVEndCounter = 0; dMeanEndCtr2 = 0;; } } if (fMeanWindowCurr < fMeanMeanStart1*(1.0 - dMagicMultiplier1)) { dThresholdEndControl++; if ( (fCoeffOfVar2 > 4000) || (fStdWindowCurr > 0.2) ) { bEndIdxFound = false; g_dEndIndex = 0; fMeanMeanEnd1 = fMeanMeanEnd2; fStdMeanEnd1 = fStdMeanEnd2; dMeanEndCtr1 = dMeanEndCtr2; if (fEndMean != 0.0) { fMeanMeanEnd1 += fEndMean; fMeanMeanEnd1 /= 2.0; fEndMean = 0.0; fStdMeanEnd1 += fEndStd; fStdMeanEnd1 /= 2.0; fEndStd = 0.0; } fMeanMeanEnd2 = 0.0; fStdMeanEnd2 = 0.0; dMeanEndCtr2 = 0; dThresholdEndControl = 200; dEndCancelCounter++; dStdSpikeCounterEnd = 0; dSmallStdCounterEnd = 0; dCVEndCounter = 0; g_dCarDetectCount--; TRACE("\nCancelling 1st End.... for %d time(s) for index %d \n", dEndCancelCounter, k); } } else if (dStdSpikeCounterEnd > dSpikeCtrTresholdEnd) { bEndIdxFound = false; g_dEndIndex = 0; fMeanMeanEnd1 = fMeanMeanEnd2; fStdMeanEnd1 = fStdMeanEnd2; dMeanEndCtr1 = dMeanEndCtr2; if (fEndMean != 0.0) { fMeanMeanEnd1 += fEndMean; fMeanMeanEnd1 /= 2.0; fEndMean = 0.0; fStdMeanEnd1 += fEndStd; fStdMeanEnd1 /= 2.0; fEndStd = 0.0; } fMeanMeanEnd2 = 0.0; fStdMeanEnd2 = 0.0; dMeanEndCtr2 = 0; dThresholdEndControl = 200; dEndCancelCounter++; dStdSpikeCounterEnd = 0; dSmallStdCounterEnd = 0; dCVEndCounter = 0; g_dCarDetectCount--; TRACE("\nCancelling 2nd End.... for %d time(s) for index %d \n", dEndCancelCounter, k); } /// end of END index cancelling if ((fMeanWindowCurr > fMeanMeanStart1*(1.0 - dMagicMultiplier2)) && (dStdSpikeCounterEnd == 0)) { dThresholdEndControl = 100; } if ((fMeanWindowCurr > fMeanMeanStart1*(1.0 - dMagicMultiplier3)) && (dStdSpikeCounterEnd == 0)) { dThresholdEndControl = 20; } } if ((dMeanEndCtr2 > dThresholdEndControl) && (bEndIdxFound == true)) { bEndPassedTest = true; } #ifdef DEBUG_BORA fprintf_s(fp, "%lf %lf %lf %lf \n", fMeanWindow, fStdWindow, fCoeffOfVar1, fCoeffOfVar2); #endif ////////////////////// if ( ( (bBegIdxFound == false) && (fStdWindowCurr > 1.0) && // 2,5 (fStdWindowPrev > 1.0) && // 1,0 (fStdWindowPrev2 > 1.0) && // 0,5 (fStdWindowPrev3 > 1.0) && // 0,5 (k > 300) && (fCoeffOfVar1 < 500.0) && (fCoeffOfVar2 > 10.0) ) ) { bBegIdxFound = true; g_dBeginIndex = k; fMeanMeanStart1 /= dMeanStartCtr1; fStdMeanStart1 /= dMeanStartCtr1; fStartMean = fMeanMeanStart1; fStartStd = fStdMeanStart1; TRACE("\n Found Start at %d ", g_dBeginIndex); } if ( ( (bEndIdxFound == false) && (bBegIdxFound == true) && (fStdWindowCurr < 0.5) && (fStdWindowPrev < 0.5) && (fStdWindowPrev2 < 0.5) && (fStdWindowPrev3 < 0.5) && (k - g_dBeginIndex > 2000) && (fCoeffOfVar1 > 4000.0) ) || ( (bEndIdxFound == false) && (bBegIdxFound == true) && (fStdWindowCurr < 0.1) && (fStdWindowPrev < 0.1) && (fStdWindowPrev2 < 0.1) && (fStdWindowPrev3 < 0.1) && (k - g_dBeginIndex > 2000) ) ) { bEndIdxFound = true; g_dEndIndex = k; g_dCarDetectCount++; fMeanMeanEnd1 = fMeanMeanStart2; fStdMeanEnd1 = fStdMeanStart2; dMeanEndCtr1 = dMeanStartCtr2; fMeanMeanEnd1 /= dMeanEndCtr1; fStdMeanEnd1 /= dMeanEndCtr1; fEndMean = fMeanMeanEnd1; fEndStd = fStdMeanEnd1; TRACE("\n Found End at %d ", g_dEndIndex); } } //// end of MAIN loop #ifdef DEBUG_BORA fclose(fp); #endif TRACE("\n bStartPassedTest %d bEndPassedTest %d \n", bStartPassedTest, bEndPassedTest); if ( (bBegIdxFound == true) && (bEndIdxFound == true) && (g_dCarDetectCount == 1) && (bStartPassedTest == true) && (bEndPassedTest == true) && (g_AutoDetect_Type != NO_AUTO_VEHICLE_DETECT) ) { bIsCarFound = true; g_CarFound = TRUE; TRACE("\n\n\nSTART %d END %d\n\n\n", g_dBeginIndex, g_dEndIndex); if (pVehicleDetection->m_isStopSignalled == false) { pVehicleDetection->m_isStopSignalled = true; TRACE("Signal STOPPPPPPPPPPPPPPPP\n"); SetEvent(g_CameraStopDataRecieveEvent); } } if (g_AutoDetect_Type == NO_AUTO_VEHICLE_DETECT) { //if ((bBegIdxFound == false) || (bEndIdxFound == false)) //{ g_CarFound = FALSE; g_dBeginIndex = 0; g_dEndIndex = pVehicleDetection->m_dlineCounter - dAnalysisWindow; pVehicleDetection->m_isStopSignalled = true; //SetEvent(g_CameraStopDataRecieveEvent); pView->SendMessage(WM_VEHICLEDETECT_FINISHED, 0, pLparam); //} } TRACE("FRM_CNT %d PRS_CNT %d \n", pVehicleDetection->m_dFrameCounter, pVehicleDetection->m_dProcessedFrameCounter); pVehicleDetection->m_dProcessedFrameCounter++; if ( (bIsCarFound == true) || (pVehicleDetection->m_dFrameCounter - pVehicleDetection->m_dProcessedFrameCounter == 0) ) { bIsProcessingFinished = true; ResetEvent(pVehicleDetection->ProcessDataEvent); SetEvent(pVehicleDetection->ProcessingFinishedEvent); } } } } // infite for loop delete[] fMean; if (inClr.rows != 0 || inClr.cols != 0) { inClr.release(); } if (inGray.rows != 0 || inGray.cols != 0) { inGray.release(); } return THREADEXIT_SUCCESS; }
[ "bora.nakiboglu@gmail.com" ]
bora.nakiboglu@gmail.com
720d3d04bff9fa2a6b6d87c2aa998c941b55a2c9
f16a6a1f0e53bd30fec3b97ffdde9f5eeae16fbd
/C++/practice/Multi table/add.cpp
8827f30410120d6db46cb05718a509b53ce53de1
[]
no_license
dungeonfighter/git
558444358a35dfe3b5fbecc9aeeb1171de532f15
6d1c635188fb1428002423730e813628737f72f2
refs/heads/master
2021-01-11T20:55:25.884789
2019-11-22T02:24:38
2019-11-22T02:24:38
79,209,682
0
0
null
null
null
null
UTF-8
C++
false
false
462
cpp
#include <iostream> using namespace std; /*==============================================================*/ void tem::pri(int num){ int count=0; while(count<=this->y){ for (int i = 1; i < this->x+1 ; ++i) { for (int j = 1+count; j <num+1+count ; ++j) { if(j<=y){ cout<<j<<"*"<<i<<"="<<j*i<<" ,"; } } cout<<endl; } count += num ; cout<<endl; } } /*==============================================================*/
[ "1103105339@gm.kuas.com" ]
1103105339@gm.kuas.com
3e3ee1c02c1f0bb339f772eca717b42ca598c35c
1c9c67d3923e61226f62c7d1b1571d7fb05fdfeb
/Systems/Comm.cpp
dbbb111aff4960f5fc6c37a6794ed1fd14e3f765
[ "MIT" ]
permissive
atrakeur/arduino-quadripod
3b05e4b7c53127ed60f80b6c6bb460558ad97f34
9577c10f2396e6636c433cf1195a452b1c04995c
refs/heads/master
2020-05-16T20:50:19.064842
2014-06-11T20:36:34
2014-06-11T20:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
2,020
cpp
#include <stdarg.h> #include "Arduino.h" #include "Comm.h" extern const char COMM_ERROR_STR[] = "ERROR"; extern const char COMM_ERROR_STR_NOERROR[] = "No error"; extern const char COMM_ERROR_STR_NODELIM[] = "No delimiter"; extern const char COMM_ERROR_STR_BUFFLEN[] = "Buf overflow"; void Comm::init() { inputUsed = 0; Serial.begin(9600); while (!Serial); //wait for serial ready } Command* Comm::recvCommand() { while(Serial.available() > 0) { int remSpace = COMM_COMMAND_BUFF - inputUsed; if (remSpace <= 0) { //invalidate command Comm::sendCommand(COMM_ERROR_STR, COMM_ERROR_STR_BUFFLEN); Comm::resetInputCommand(); //TODO discard overflow data? return NULL; } char data = (char)Serial.read(); if (data == '\n' || data == '\r') { //locate the delimiter int delimiter = -1; for (int i = 0; i < inputUsed; i++) { if (inputBuff[i] == ':') { delimiter = i; break; } } if (delimiter == -1) { //Invalid command Comm::sendCommand(COMM_ERROR_STR, COMM_ERROR_STR_NODELIM); Comm::resetInputCommand(); return NULL; } strncpy(input.key, inputBuff, delimiter); input.key[delimiter] = '\0'; strncpy(input.val, &inputBuff[delimiter + 1], inputUsed - delimiter - 1); input.val[inputUsed - delimiter - 1] = '\0'; Comm::resetInputCommand(); return &input; } else { inputBuff[inputUsed++] = data; } } return NULL; } void Comm::sendCommand(const char* key, const char* val, ...) { char buff[COMM_COMMAND_VAL]; va_list args; va_start(args, val); vsnprintf(buff, COMM_COMMAND_VAL, val, args); va_end(args); Serial.print(""); Serial.print(key); Serial.print(":"); Serial.print(buff); Serial.println(); } void Comm::sendError(const char* value, ...) { va_list args; va_start(args, value); Comm::sendCommand(COMM_ERROR_STR, value, args); va_end(args); } void Comm::resetInputCommand() { memset(inputBuff, '\0', COMM_COMMAND_KEY + COMM_COMMAND_VAL); inputUsed = 0; }
[ "atrakeur@gmail.com" ]
atrakeur@gmail.com
23d4e041e02971b0902675df76d3832583d920f8
0eff74b05b60098333ad66cf801bdd93becc9ea4
/second/download/httpd/gumtree/httpd_new_hunk_2657.cpp
b3f2f72943d3cd278c6b173ec1eff036259eed5a
[]
no_license
niuxu18/logTracker-old
97543445ea7e414ed40bdc681239365d33418975
f2b060f13a0295387fe02187543db124916eb446
refs/heads/master
2021-09-13T21:39:37.686481
2017-12-11T03:36:34
2017-12-11T03:36:34
null
0
0
null
null
null
null
UTF-8
C++
false
false
666
cpp
putLong((unsigned char *)&buf[0], ctx->crc); putLong((unsigned char *)&buf[4], ctx->stream.total_in); b = apr_bucket_pool_create(buf, VALIDATION_SIZE, r->pool, f->c->bucket_alloc); APR_BRIGADE_INSERT_TAIL(ctx->bb, b); ap_log_rerror(APLOG_MARK, APLOG_DEBUG, 0, r, APLOGNO(01384) "Zlib: Compressed %ld to %ld : URL %s", ctx->stream.total_in, ctx->stream.total_out, r->uri); /* leave notes for logging */ if (c->note_input_name) { apr_table_setn(r->notes, c->note_input_name,
[ "993273596@qq.com" ]
993273596@qq.com
0d0f12f4e7c94111fd9bce5f7e64d883e0ebbf23
7b8555b4c30b7b7daec43cf705cedd9ee8b74895
/BehaviorModel/StraightBehaviorModel.h
b168330ed0076b4ebdb402aec477e18ffa1331f7
[]
no_license
EniwaSentaiToshiking/etrobo-eniwa-sentai-toshiking
bd8fdbffdb2e883173d845c804bf004dd26a66e4
b34744f6bc05308f1bf754c9ef6702bbf4bd0759
refs/heads/master
2023-02-26T17:05:34.254633
2021-02-03T02:23:57
2021-02-03T02:23:57
null
0
0
null
null
null
null
UTF-8
C++
false
false
463
h
/* * Created on Wed Feb 03 2021 * * Copyright (c) 2021 Kazuki Hamaguchi */ #pragma once #include "TemplateBehaviorModel.h" #include "StraightBehaviorModel.h" #include "WheelDeviceDriver.h" #include "StraightForwardOrBackward.h" class StraightBehaviorModel : public TemplateBehaviorModel { WheelDeviceDriver wheelDeviceDriver; public: void init(); void run(int pwm, StraightForwardOrBackward straightForwardOrBackward); void terminate(); };
[ "hamamatcha@gmail.com" ]
hamamatcha@gmail.com
7a2f5173ce25d70a7389141315d318697b8df4ed
85cce50c27d7bbd6d098ec0af7b5ec712ad6abd8
/CodeChef/C++/CookOff/COOK69_April16/CodeChef_MovieWKN.cpp
a27e9899bf80daa968e3b5aebacd14f59f3f6bf9
[]
no_license
saikiran03/competitive
69648adcf783183a6767caf6db2f63aa5be4aa25
c65e583c46cf14e232fdb5126db1492f958ba267
refs/heads/master
2020-04-06T07:04:06.577311
2016-10-05T08:28:19
2016-10-05T08:28:19
53,259,126
0
0
null
null
null
null
UTF-8
C++
false
false
948
cpp
#include <bits/stdc++.h> using namespace std; #define inf 1000000007 typedef long long ll; typedef unsigned long long ull; typedef vector<int> vi; typedef vector<vi> vii; typedef pair<int,int> ii; #define rf freopen("in.txt","r",stdin); #define wf freopen("out.txt","w",stdout); #define boost ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define FOR(i,a,b) for(int i=a; i<=b; i++) #define tcase int __T; cin >> __T; while(__T--) #define rep(i,n) for(int i=0; i<n; i++) #define tr(it,x) for(auto it=x.begin(); it!=x.end(); it++) #define pb push_back #define all(x) x.begin(),x.end() int main(){ boost; int n; tcase{ cin >> n; int cnt,l[n],r[n],lr[n]; rep(i,n) cin >> l[i]; rep(i,n){ cin >> r[i]; lr[i] = r[i]*l[i]; } int* mx = max_element(lr,lr+n); if(count(lr,lr+n,*mx)>1){ mx = max_element(r,r+n); cout << mx-r+1 << endl; }else{ cout << mx-lr+1 << endl; } } }
[ "kiransai3284462@gmail.com" ]
kiransai3284462@gmail.com
fed16fa68c89b8d34dd6e794f81951573f9b0faa
84cd51502a8e091452de7ff63f729c6f762fec6f
/Study/SZPE/SZPE/Common.cpp
57f5e82a4bbdc5142c83c15207ff087897370702
[]
no_license
thinkingl/thinkingl-code-lib
4a5d8b431fed998cb1dd2e5f541a6a322880429e
75cb90a53c8bab8009c39b16d73913cf870c6d71
refs/heads/master
2022-12-25T08:32:00.813091
2022-12-14T06:18:51
2022-12-14T06:18:51
32,558,719
9
2
null
null
null
null
UTF-8
C++
false
false
46
cpp
#include "StdAfx.h" #include "Common.h"
[ "thinkingzx@076e9d56-d92b-0410-8186-f370c9e58ff5" ]
thinkingzx@076e9d56-d92b-0410-8186-f370c9e58ff5
ef736c0fcac01be5078ac2a2604cce1bc80fb8ae
83195bb76eb33ed93ab36c3782295e4a2df6f005
/Source/ToolCore/JSBind/JSBTypeScript.h
02afc7d1ba7fb5c9769610e7ef4e2cb7b4cc3c1c
[ "MIT", "BSD-3-Clause", "Zlib", "LicenseRef-scancode-openssl", "LicenseRef-scancode-khronos", "BSL-1.0", "Apache-2.0", "LicenseRef-scancode-public-domain", "BSD-2-Clause", "NTP" ]
permissive
MrRefactoring/AtomicGameEngine
ff227c054d3758bc1fbd5e502c382d7de81b0d47
9cd1bf1d4ae7503794cc3b84b980e4da17ad30bb
refs/heads/master
2020-12-09T07:24:48.735251
2020-01-11T14:03:29
2020-01-11T14:03:29
233,235,105
0
0
NOASSERTION
2020-01-11T13:21:19
2020-01-11T13:21:18
null
UTF-8
C++
false
false
1,851
h
// // Copyright (c) 2014-2016 THUNDERBEAST GAMES LLC // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in // all copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN // THE SOFTWARE. // #pragma once #include <Atomic/Container/Str.h> using namespace Atomic; class JSBFunction; class JSBPackage; class JSBModule; namespace ToolCore { class JSBFunctionType; class JSBTypeScript { public: void Emit(JSBPackage* package, const String& path); private: String source_; void Begin(); void End(); void ExportFunction(JSBFunction* function); String GetScriptType(JSBFunctionType* ftype); void ExportModuleEnums(JSBModule* moduleName); void ExportModuleConstants(JSBModule* moduleName); void ExportModuleClasses(JSBModule* moduleName); void ExportModuleEvents(JSBModule* module); void WriteToFile(const String& path); JSBPackage* package_; }; }
[ "josh@galaxyfarfaraway.com" ]
josh@galaxyfarfaraway.com
f890852eef4f6439203a779732e05a9197371554
7e2465414cdca35ea6b948392d1929da10db7427
/chapter_5_induction_and_recursion/5.4_recursive_algorithms/exercises/repo/solution_10.cpp
019b9765ee89ca34cfc085a3360c600d20037d69
[]
no_license
6guojun/discrete_mathematics_and_its_applications
244bcc0a033cc218a1ba88390c4ad957c66e939c
a41e905179f88b91b1402b515c01b09716db5142
refs/heads/master
2021-03-23T07:25:27.545525
2020-01-16T05:37:48
2020-01-16T05:37:48
null
0
0
null
null
null
null
UTF-8
C++
false
false
913
cpp
/* Discrete Mathematics and Its Applications by Dr. Kenneth H. Rosen Chapter 5.4 Recursive Algorithms Solution 10 Rakesh Kumar, cpp.rakesh(at)gmail.com 17/07/2017 */ #include "common.h" #include <cstdio> #include <vector> int largest(const std::vector<int>& list, int n) { discrete_mathematics::Common<int> common; if (n == 0) return list[0]; else return common.max(list[n], largest(list, n - 1)); } inline void print(const std::vector<int>& list) { for (std::size_t i = 0; i < list.size(); ++i) printf("%d ", list[i]); printf("\n"); } void test() { discrete_mathematics::Common<int> common; std::vector<int> list; for (int i = 0; i < 10; ++i) list.push_back(common.random(1, 100)); print(list); printf("Largest element in the list == [%d]\n", largest(list, list.size() - 1)); } int main() { test(); return 0; }
[ "cpp.rakesh@gmail.com" ]
cpp.rakesh@gmail.com
3f62ed9896c5b3fc358bcc980ceea69b5674ec9b
3979ad10a1915fb7336eceb51ad807b4341dc4b6
/wink1.cpp
90278761d0a95619ca057f7bf9fe6369cef7a6b6
[]
no_license
tdonca/wink
ee536a476bcb0ebfc69abdc77159742847902573
61aee681485a906c7fbbc1d7b1e41db123c6b2f2
refs/heads/master
2021-08-28T15:24:11.284781
2017-12-12T15:58:16
2017-12-12T15:58:16
111,460,835
0
0
null
2017-12-12T15:49:55
2017-11-20T20:43:59
Makefile
UTF-8
C++
false
false
455
cpp
#include <opencv2/opencv.hpp> #include <iostream> #include "VideoStreamer.h" //when to include header files? int main(int argc, char* argv[]){ //create window cv::namedWindow("Wink", cv::WINDOW_NORMAL); cv::resizeWindow("Wink", 1600, 900); cv::moveWindow("Wink", 100, 900); //create video stream VideoStreamer stream{1600, 900}; //start streaming stream.startStream(0, "Wink"); std::cout << "Finished streaming." << std::endl; return 0; }
[ "tgdonca@gmail.com" ]
tgdonca@gmail.com
a0d6c3c557f48cea04e4bd72def37ae1947a622c
3c65a5f203f2d4b02ff9c1bdd999c9e3b18007e7
/plugin/gui/custom_tooltip.cpp
d04cf5b96b8fb598d22c1018eca517c2c90991cf
[ "BSL-1.0" ]
permissive
cristivlas/zerobugs
07c81ceec27fd1191716e52b29825087baad39e4
5f080c8645b123d7887fd8a64f60e8d226e3b1d5
refs/heads/master
2020-03-19T17:20:35.491229
2018-06-09T20:17:55
2018-06-09T20:17:55
136,754,214
0
0
null
null
null
null
UTF-8
C++
false
false
4,640
cpp
// // $Id$ // // ------------------------------------------------------------------------- // This file is part of ZeroBugs, Copyright (c) 2010 Cristian L. Vlasceanu // // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // ------------------------------------------------------------------------- // #include <assert.h> #include <iostream> #include <vector> #include "generic/temporary.h" #include "gtkmm/clist.h" #include "gtkmm/connect.h" #include "gtkmm/ctree.h" #include "gtkmm/flags.h" #include "gtkmm/label.h" #include "gtkmm/resize.h" #include "gtkmm/style.h" #include "gtkmm/widget.h" #include "gtkmm/window.h" #include "custom_tooltip.h" CustomToolTip::CustomToolTip(Gtk::Widget* w, GetTextAtPointer fn) : widget_(w) , getTextAtPointer_(fn) , hrow_(INIT_ROW_HANDLE) , hcol_(-1) , drawing_(false) { assert(w); assert(fn); w->add_events(Gdk_FLAG(POINTER_MOTION_MASK) | Gdk_FLAG(ENTER_NOTIFY_MASK) | Gdk_FLAG(LEAVE_NOTIFY_MASK) /* | Gdk_FLAG(BUTTON_PRESS_MASK) */); } CustomToolTip::~CustomToolTip() { } void CustomToolTip::reset_tooltip() { tooltip_.reset(); } #if !GTKMM_2 void CustomToolTip::position_tooltip(int x, int y) { assert(tooltip_.get()); // show the tooltip slightly off from the mouse x += 10; y += 10; // make sure that the tooltip is fully visible, // by forcing its coordinates inside the screen Gtk_adjust_coords_for_visibility(tooltip_, x, y); Gtk_move(tooltip_.get(), x, y); } #endif int CustomToolTip::on_pointer_motion(GdkEventMotion* event) { #if !GTKMM_2 // silence off compiler warnings about converting doubles to ints const int x_root = static_cast<int>(event->x_root); const int y_root = static_cast<int>(event->y_root); if (tooltip_.get()) { position_tooltip(x_root, y_root); } #endif assert(widget_); std::string text; if (!(*getTextAtPointer_)(*widget_, event->x, event->y, hrow_, hcol_, text)) { return 0; } #if (GTKMM_2) widget_->set_tooltip_text(text); #else // Gtk-1.2 gunk if (text.empty()) { tooltip_.reset(); hrow_ = INIT_ROW_HANDLE; hcol_ = -1; } else { tooltip_.reset(new Gtk::Window(Gtk_FLAG(WINDOW_POPUP))); assert(tooltip_.get()); tooltip_->set_name("tooltip"); tooltip_->set_border_width(3); Gtk_set_resizable(tooltip_, false); tooltip_->set_app_paintable(true); Gtk_CONNECT_0(tooltip_, expose_event, this, &CustomToolTip::on_paint_custom_tip); Gtk::Label* label = manage(new Gtk::Label(text, .0)); tooltip_->add(*label); label->set_line_wrap(false); label->set_justify(Gtk_FLAG(JUSTIFY_LEFT)); StylePtr style = CHKPTR(tooltip_->get_style())->copy(); // fixme: get the background color from the current theme style->set_bg(Gtk_FLAG(STATE_NORMAL), Gdk_Color("lightyellow")); style->set_fg(Gtk_FLAG(STATE_NORMAL), Gdk_Color("black")); Gtk_set_style(tooltip_, style); //move it out of sight, initially Gtk_move(tooltip_.get(), gdk_screen_width(), gdk_screen_height()); assert(tooltip_.get()); tooltip_->show_all(); position_tooltip(x_root, y_root); } #endif return 0; } int CustomToolTip::on_pointer_leave(GdkEventCrossing*) { #if GTKMM_2 widget_->set_has_tooltip(false); #else tooltip_.reset(); hrow_ = INIT_ROW_HANDLE; hcol_ = -1; #endif return 0; } int CustomToolTip::on_paint_custom_tip(GdkEventExpose* event) { if (drawing_) { return 0; } assert(event); assert(widget_); // otherwise how could we get this event? if (event->count == 0 && tooltip_.get()) { Temporary<bool> setFlag(drawing_, true); assert(tooltip_->get_style()); const GdkRectangle& r = event->area; gtk_paint_flat_box(GTKOBJ(tooltip_->get_style()), event->window, GTK_STATE_NORMAL, GTK_SHADOW_OUT, NULL, GTK_WIDGET(GTKOBJ(tooltip_)), "tooltip", r.x, r.y, r.width, r.height); //#ifdef GTKMM_2 // std::vector<Gtk::Widget*> children = tooltip_->get_children(); // gtk_widget_draw(GTKOBJ(children[0]), NULL); //#endif } return 0; } // vim: tabstop=4:softtabstop=4:expandtab:shiftwidth=4
[ "cvlasceanu@tableau.com" ]
cvlasceanu@tableau.com
ce8547f60310f7c84bc0b8c90b9507e2eb2fd77c
600df3590cce1fe49b9a96e9ca5b5242884a2a70
/v8/src/interpreter/constant-array-builder.cc
d2b799562383dd87c5210509bff00061436d6573
[ "BSD-3-Clause", "SunPro", "bzip2-1.0.6" ]
permissive
metux/chromium-suckless
efd087ba4f4070a6caac5bfbfb0f7a4e2f3c438a
72a05af97787001756bae2511b7985e61498c965
refs/heads/orig
2022-12-04T23:53:58.681218
2017-04-30T10:59:06
2017-04-30T23:35:58
89,884,931
5
3
BSD-3-Clause
2022-11-23T20:52:53
2017-05-01T00:09:08
null
UTF-8
C++
false
false
8,196
cc
// Copyright 2015 the V8 project authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "src/interpreter/constant-array-builder.h" #include <functional> #include <set> #include "src/isolate.h" #include "src/objects-inl.h" namespace v8 { namespace internal { namespace interpreter { ConstantArrayBuilder::ConstantArraySlice::ConstantArraySlice( Zone* zone, size_t start_index, size_t capacity, OperandSize operand_size) : start_index_(start_index), capacity_(capacity), reserved_(0), operand_size_(operand_size), constants_(zone) {} void ConstantArrayBuilder::ConstantArraySlice::Reserve() { DCHECK_GT(available(), 0u); reserved_++; DCHECK_LE(reserved_, capacity() - constants_.size()); } void ConstantArrayBuilder::ConstantArraySlice::Unreserve() { DCHECK_GT(reserved_, 0u); reserved_--; } size_t ConstantArrayBuilder::ConstantArraySlice::Allocate( Handle<Object> object) { DCHECK_GT(available(), 0u); size_t index = constants_.size(); DCHECK_LT(index, capacity()); constants_.push_back(object); return index + start_index(); } Handle<Object> ConstantArrayBuilder::ConstantArraySlice::At( size_t index) const { DCHECK_GE(index, start_index()); DCHECK_LT(index, start_index() + size()); return constants_[index - start_index()]; } void ConstantArrayBuilder::ConstantArraySlice::InsertAt(size_t index, Handle<Object> object) { DCHECK_GE(index, start_index()); DCHECK_LT(index, start_index() + size()); constants_[index - start_index()] = object; } bool ConstantArrayBuilder::ConstantArraySlice::AllElementsAreUnique() const { std::set<Object*> elements; for (auto constant : constants_) { if (elements.find(*constant) != elements.end()) return false; elements.insert(*constant); } return true; } STATIC_CONST_MEMBER_DEFINITION const size_t ConstantArrayBuilder::k8BitCapacity; STATIC_CONST_MEMBER_DEFINITION const size_t ConstantArrayBuilder::k16BitCapacity; STATIC_CONST_MEMBER_DEFINITION const size_t ConstantArrayBuilder::k32BitCapacity; ConstantArrayBuilder::ConstantArrayBuilder(Zone* zone, Handle<Object> the_hole_value) : constants_map_(16, base::KeyEqualityMatcher<Address>(), ZoneAllocationPolicy(zone)), smi_map_(zone), smi_pairs_(zone), zone_(zone), the_hole_value_(the_hole_value) { idx_slice_[0] = new (zone) ConstantArraySlice(zone, 0, k8BitCapacity, OperandSize::kByte); idx_slice_[1] = new (zone) ConstantArraySlice( zone, k8BitCapacity, k16BitCapacity, OperandSize::kShort); idx_slice_[2] = new (zone) ConstantArraySlice( zone, k8BitCapacity + k16BitCapacity, k32BitCapacity, OperandSize::kQuad); } size_t ConstantArrayBuilder::size() const { size_t i = arraysize(idx_slice_); while (i > 0) { ConstantArraySlice* slice = idx_slice_[--i]; if (slice->size() > 0) { return slice->start_index() + slice->size(); } } return idx_slice_[0]->size(); } ConstantArrayBuilder::ConstantArraySlice* ConstantArrayBuilder::IndexToSlice( size_t index) const { for (ConstantArraySlice* slice : idx_slice_) { if (index <= slice->max_index()) { return slice; } } UNREACHABLE(); return nullptr; } Handle<Object> ConstantArrayBuilder::At(size_t index) const { const ConstantArraySlice* slice = IndexToSlice(index); if (index < slice->start_index() + slice->size()) { return slice->At(index); } else { DCHECK_LT(index, slice->capacity()); return the_hole_value(); } } Handle<FixedArray> ConstantArrayBuilder::ToFixedArray(Isolate* isolate) { // First insert reserved SMI values. for (auto reserved_smi : smi_pairs_) { InsertAllocatedEntry(reserved_smi.second, handle(reserved_smi.first, isolate)); } Handle<FixedArray> fixed_array = isolate->factory()->NewFixedArray( static_cast<int>(size()), PretenureFlag::TENURED); int array_index = 0; for (const ConstantArraySlice* slice : idx_slice_) { if (array_index == fixed_array->length()) { break; } DCHECK(array_index == 0 || base::bits::IsPowerOfTwo32(static_cast<uint32_t>(array_index))); // Different slices might contain the same element due to reservations, but // all elements within a slice should be unique. If this DCHECK fails, then // the AST nodes are not being internalized within a CanonicalHandleScope. DCHECK(slice->AllElementsAreUnique()); // Copy objects from slice into array. for (size_t i = 0; i < slice->size(); ++i) { fixed_array->set(array_index++, *slice->At(slice->start_index() + i)); } // Insert holes where reservations led to unused slots. size_t padding = std::min(static_cast<size_t>(fixed_array->length() - array_index), slice->capacity() - slice->size()); for (size_t i = 0; i < padding; i++) { fixed_array->set(array_index++, *the_hole_value()); } } DCHECK_EQ(array_index, fixed_array->length()); return fixed_array; } size_t ConstantArrayBuilder::Insert(Handle<Object> object) { return constants_map_ .LookupOrInsert(object.address(), ObjectHash(object.address()), [&]() { return AllocateIndex(object); }, ZoneAllocationPolicy(zone_)) ->value; } ConstantArrayBuilder::index_t ConstantArrayBuilder::AllocateIndex( Handle<Object> object) { for (size_t i = 0; i < arraysize(idx_slice_); ++i) { if (idx_slice_[i]->available() > 0) { return static_cast<index_t>(idx_slice_[i]->Allocate(object)); } } UNREACHABLE(); return kMaxUInt32; } ConstantArrayBuilder::ConstantArraySlice* ConstantArrayBuilder::OperandSizeToSlice(OperandSize operand_size) const { ConstantArraySlice* slice = nullptr; switch (operand_size) { case OperandSize::kNone: UNREACHABLE(); break; case OperandSize::kByte: slice = idx_slice_[0]; break; case OperandSize::kShort: slice = idx_slice_[1]; break; case OperandSize::kQuad: slice = idx_slice_[2]; break; } DCHECK(slice->operand_size() == operand_size); return slice; } size_t ConstantArrayBuilder::AllocateEntry() { return AllocateIndex(the_hole_value()); } void ConstantArrayBuilder::InsertAllocatedEntry(size_t index, Handle<Object> object) { DCHECK_EQ(the_hole_value().address(), At(index).address()); ConstantArraySlice* slice = IndexToSlice(index); slice->InsertAt(index, object); } OperandSize ConstantArrayBuilder::CreateReservedEntry() { for (size_t i = 0; i < arraysize(idx_slice_); ++i) { if (idx_slice_[i]->available() > 0) { idx_slice_[i]->Reserve(); return idx_slice_[i]->operand_size(); } } UNREACHABLE(); return OperandSize::kNone; } ConstantArrayBuilder::index_t ConstantArrayBuilder::AllocateReservedEntry( Smi* value) { index_t index = static_cast<index_t>(AllocateEntry()); smi_map_[value] = index; smi_pairs_.push_back(std::make_pair(value, index)); return index; } size_t ConstantArrayBuilder::CommitReservedEntry(OperandSize operand_size, Smi* value) { DiscardReservedEntry(operand_size); size_t index; auto entry = smi_map_.find(value); if (entry == smi_map_.end()) { index = AllocateReservedEntry(value); } else { ConstantArraySlice* slice = OperandSizeToSlice(operand_size); index = entry->second; if (index > slice->max_index()) { // The object is already in the constant array, but may have an // index too big for the reserved operand_size. So, duplicate // entry with the smaller operand size. index = AllocateReservedEntry(value); } DCHECK_LE(index, slice->max_index()); } return index; } void ConstantArrayBuilder::DiscardReservedEntry(OperandSize operand_size) { OperandSizeToSlice(operand_size)->Unreserve(); } } // namespace interpreter } // namespace internal } // namespace v8
[ "enrico.weigelt@gr13.net" ]
enrico.weigelt@gr13.net
1a91e12e3448f2bac779fab407a6d071eb0499a5
562d2183cecd232559eb89d7f733bf1fe967768c
/Source/libClang/Source/lib/Target/ARM/ARMFrameLowering.h
f1146040568cdf1e1348d4ef8eba8c856a293006
[ "LicenseRef-scancode-arm-llvm-sga", "NCSA" ]
permissive
orcun-gokbulut/ze-externals-sources
f1fd970ed6161b8f7ac19d1991f44a720c0125e9
500a237d6e0ff6308db1e2e513ad9871ac4cda65
refs/heads/master
2023-09-01T19:44:32.292637
2021-10-13T14:26:53
2021-10-13T14:26:53
416,611,297
1
1
null
null
null
null
UTF-8
C++
false
false
3,258
h
//==-- ARMTargetFrameLowering.h - Define frame lowering for ARM --*- C++ -*-==// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // // //===----------------------------------------------------------------------===// #ifndef ARM_FRAMEINFO_H #define ARM_FRAMEINFO_H #include "llvm/Target/TargetFrameLowering.h" namespace llvm { class ARMSubtarget; class ARMFrameLowering : public TargetFrameLowering { protected: const ARMSubtarget &STI; public: explicit ARMFrameLowering(const ARMSubtarget &sti); /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. void emitPrologue(MachineFunction &MF) const override; void emitEpilogue(MachineFunction &MF, MachineBasicBlock &MBB) const override; bool spillCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const override; bool restoreCalleeSavedRegisters(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, const TargetRegisterInfo *TRI) const override; bool hasFP(const MachineFunction &MF) const override; bool hasReservedCallFrame(const MachineFunction &MF) const override; bool canSimplifyCallFramePseudos(const MachineFunction &MF) const override; int getFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg) const override; int ResolveFrameIndexReference(const MachineFunction &MF, int FI, unsigned &FrameReg, int SPAdj) const; int getFrameIndexOffset(const MachineFunction &MF, int FI) const override; void processFunctionBeforeCalleeSavedScan(MachineFunction &MF, RegScavenger *RS) const override; void adjustForSegmentedStacks(MachineFunction &MF) const override; private: void emitPushInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, unsigned StmOpc, unsigned StrOpc, bool NoGap, bool(*Func)(unsigned, bool), unsigned NumAlignedDPRCS2Regs, unsigned MIFlags = 0) const; void emitPopInst(MachineBasicBlock &MBB, MachineBasicBlock::iterator MI, const std::vector<CalleeSavedInfo> &CSI, unsigned LdmOpc, unsigned LdrOpc, bool isVarArg, bool NoGap, bool(*Func)(unsigned, bool), unsigned NumAlignedDPRCS2Regs) const; void eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB, MachineBasicBlock::iterator MI) const override; }; } // End llvm namespace #endif
[ "orcun.gokbulut@zinek.xyz" ]
orcun.gokbulut@zinek.xyz
bb30f923d38a7e3550ddf01b71fb8eaeae37fc30
4c3cce59ac0552bbf95eeccfcd99538a36aa9337
/src/include/cui/cui.h
b452179c944ce266b04d19db88b5723399f211e0
[]
no_license
naota-inamoto/Altair
2f02ae47cefc1e920f9af8fd1fb76e665a8f82c9
e8fe97b919206270d037d4df0285a0c92c67a5f3
refs/heads/master
2020-05-30T08:58:18.197831
2020-02-16T09:50:55
2020-02-16T09:50:55
70,219,982
0
0
null
null
null
null
UTF-8
C++
false
false
1,783
h
/* * Copyright (C) 1995-2020 Naota Inamoto, * All rights reserved. * * For conditions of redistribution and reuse, * see the accompanying License-Altair.txt file */ #ifndef _AUI_CUI_H #define _AUI_CUI_H class AL_EXT_CLASS AUiProgramMgr : public AGm { public: AUiProgramMgr(); virtual ~AUiProgramMgr(); static AUiProgramMgr* Instance(); static AGmNode *CreateCommonClasses(); AGmNode* LibSearchPath(); AGmNode* LibList(); AGmNode* ProjectList(); int LoadLibrary(AGmNode *proj_root_class, AGmString *lib_name, AGmNode** lib); AGmNode *_lib_search_path; AGmNode *_lib_list; AGmNode *_proj_list; public: static int New(); static int Open(); static int _Open(AGmString *dir, AGmString *name); static int __Open(AGmString *path, AGmNode* proj, int inet=0); static int Save(AGmNode *root_class); static int SaveAs(AGmNode *root_class); static int _Save(AGmString *path, AGmNode *root); static void Exit(); static int MakeLibText(AGmNode *root_class, AGmNode *root); static int _MakeLibText(AGmFile*, AGmNode* root_class, AGmNode *root, int step); static int MakeLibGraph(AGmNode *root_class, AGmNode *root); static int MakeLibText2(AGmNode *root_class, AGmNode *classes); static int LoadLib(AGmNode *root_class, int tmp=0); static int _LoadLib(AGmFile*, AGmString *s, AGmNode *root_class, AGmNode** lib); static int _LoadLibText(AGmFile*, AGmString*, AGmNode *root_class, AGmNode *root, int, AGmNode **lib); static int _LoadLibGraph(AGmFile*, AGmNode *root_class, AGmNode *root, AGmNode **lib); static void CloseWindow(ADvWindow *aw); static void CloseAllWindows(); static int check_load; static int OpenProjectEditor(); static int IsReserveWord(AGmString*); // for garbage collection public: void GCmark(); }; #endif /* _AUI_CUI_H */
[ "naota_inamoto@yahoo.co.jp" ]
naota_inamoto@yahoo.co.jp
5130d1814aaf73c715a2ec5b6e53174696bbcf66
7ee8756eb4e1f10539b13b1fe4246bccc5d7416f
/tools/cgcomp/source/compiler.cpp
af1f5f87f0ab4b72d2499e83be80ea23f98fee29
[ "MIT" ]
permissive
andoma/PSL1GHT
dc0434d25c71ca38f7a278dc0d89fbc5c7490a5f
0fbf81fe13c19aa3f9cec62a0fc6a7b81f2ce758
refs/heads/master
2021-01-18T05:22:24.843892
2015-06-26T17:00:06
2015-06-26T17:00:06
1,261,063
4
5
null
null
null
null
UTF-8
C++
false
false
10,267
cpp
#include "types.h" #include "parser.h" #include "compiler.h" #define gen_op(o,t) \ ((NVFX_VP_INST_SLOT_##t<<7)|NVFX_VP_INST_##t##_OP_##o) #define arith(s,d,m,s0,s1,s2) \ nvfx_insn((s), 0, -1, (d), (m), (s0), (s1), (s2)) #define arith_ctor(ins,d,s0,s1,s2) \ nvfx_insn_ctor((ins), (d), (s0), (s1), (s2)) static INLINE s32 ffs(u32 u) { u32 i = 0; if(!(u&0xffffffff)) return 0; while(!(u&0x1)) { u >>= 1; i++; } return i + 1; } CCompiler::CCompiler() { m_nInputMask = 0; m_nOutputMask = 0; m_nInstructions = 0; m_nConsts = 0; m_rTemps = 0; m_nNumRegs = 1; m_rTempsDiscard = 0; m_pInstructions = NULL; m_pConstData = NULL; m_pCurInstruction = NULL; m_rTemp = NULL; m_rConst = NULL; } CCompiler::~CCompiler() { } void CCompiler::Prepare(CParser *pParser) { s32 high_const = -1,high_temp = -1; u32 i,j,nICount = pParser->GetInstructionCount(); struct nvfx_insn *insns = pParser->GetInstructions(); for(i=0;i<nICount;i++) { struct nvfx_insn *insn = &insns[i]; for(j=0;j<3;j++) { struct nvfx_src *src = &insn->src[j]; switch(src->reg.type) { case NVFXSR_TEMP: if((s32)src->reg.index>high_temp) high_temp = src->reg.index; break; case NVFXSR_CONST: if((s32)src->reg.index>high_const) high_const = src->reg.index; break; } } switch(insn->dst.type) { case NVFXSR_TEMP: if((s32)insn->dst.index>high_temp) high_temp = insn->dst.index; break; case NVFXSR_CONST: if((s32)insn->dst.index>high_const) high_const = insn->dst.index; break; } } if(++high_temp) { m_nNumRegs = high_temp; m_rTemp = (struct nvfx_reg*)calloc(high_temp,sizeof(struct nvfx_reg)); for(i=0;i<(u32)high_temp;i++) m_rTemp[i] = temp(); m_rTempsDiscard = 0; } if(++high_const) { m_rConst = (struct nvfx_reg*)calloc(high_const,sizeof(struct nvfx_reg)); for(i=0;i<(u32)high_const;i++) m_rConst[i] = constant(i,0.0f,0.0f,0.0f,0.0f); } } void CCompiler::Compile(CParser *pParser) { struct nvfx_src tmp; int i,nICount = pParser->GetInstructionCount(); struct nvfx_src none = nvfx_src(nvfx_reg(NVFXSR_NONE,0)); struct nvfx_insn tmp_insn,*insns = pParser->GetInstructions(); Prepare(pParser); for(i=0;i<nICount;i++) { struct nvfx_insn *insn = &insns[i]; switch(insn->op) { case OPCODE_ADD: emit_insn(gen_op(ADD,VEC),insn); break; case OPCODE_COS: emit_insn(gen_op(COS,SCA),insn); break; case OPCODE_DP3: emit_insn(gen_op(DP3,VEC),insn); break; case OPCODE_DP4: emit_insn(gen_op(DP4,VEC),insn); break; case OPCODE_POW: tmp = nvfx_src(temp()); tmp_insn = arith(0, tmp.reg, NVFX_VP_MASK_X, none, none, insn->src[0]); emit_insn(gen_op(LG2,SCA),&tmp_insn); tmp_insn = arith(0, tmp.reg, NVFX_VP_MASK_X, swz(tmp, X, X, X, X), insn->src[1], none); emit_insn(gen_op(MUL,VEC),&tmp_insn); tmp_insn = arith_ctor(insn, insn->dst, none, none, swz(tmp, X, X, X, X)); emit_insn(gen_op(EX2,SCA),&tmp_insn); break; case OPCODE_RSQ: emit_insn(gen_op(RSQ,SCA),insn); break; case OPCODE_MAD: emit_insn(gen_op(MAD,VEC),insn); break; case OPCODE_MAX: emit_insn(gen_op(MAX,VEC),insn); break; case OPCODE_MOV: emit_insn(gen_op(MOV,VEC),insn); break; case OPCODE_MUL: emit_insn(gen_op(MUL,VEC),insn); break; case OPCODE_END: if(m_nInstructions) m_pInstructions[m_nInstructions - 1].data[3] |= NVFX_VP_INST_LAST; else { tmp_insn = arith(0,none.reg,0,none,none,none); emit_insn(gen_op(NOP,VEC),&tmp_insn); m_pInstructions[m_nInstructions - 1].data[3] |= NVFX_VP_INST_LAST; } break; } release_temps(); } } void CCompiler::emit_insn(u8 opcode,struct nvfx_insn *insn) { u32 *hw; u32 slot = opcode>>7; u32 op = opcode&0x7f; m_pInstructions = (struct vertex_program_exec*)realloc(m_pInstructions,++m_nInstructions*sizeof(struct vertex_program_exec)); m_pCurInstruction = &m_pInstructions[m_nInstructions - 1]; memset(m_pCurInstruction,0,sizeof(struct vertex_program_exec)); hw = m_pCurInstruction->data; emit_dst(hw,slot,insn); emit_src(hw,0,&insn->src[0]); emit_src(hw,1,&insn->src[1]); emit_src(hw,2,&insn->src[2]); hw[0] |= (insn->cc_cond << NVFX_VP(INST_COND_SHIFT)); hw[0] |= (insn->cc_test << NVFX_VP(INST_COND_TEST_SHIFT)); hw[0] |= (insn->cc_test_reg << NVFX_VP(INST_COND_REG_SELECT_SHIFT)); hw[0] |= ((insn->cc_swz[0] << NVFX_VP(INST_COND_SWZ_X_SHIFT)) | (insn->cc_swz[1] << NVFX_VP(INST_COND_SWZ_Y_SHIFT)) | (insn->cc_swz[2] << NVFX_VP(INST_COND_SWZ_Z_SHIFT)) | (insn->cc_swz[3] << NVFX_VP(INST_COND_SWZ_W_SHIFT))); if(insn->cc_update) hw[0] |= NVFX_VP(INST_COND_UPDATE_ENABLE); if(insn->sat) { hw[0] |= NV40_VP_INST_SATURATE; } if (slot == 0) { hw[1] |= (op << NV40_VP_INST_VEC_OPCODE_SHIFT); hw[3] |= NV40_VP_INST_SCA_DEST_TEMP_MASK; hw[3] |= (insn->mask << NV40_VP_INST_VEC_WRITEMASK_SHIFT); } else { hw[1] |= (op << NV40_VP_INST_SCA_OPCODE_SHIFT); hw[0] |= NV40_VP_INST_VEC_DEST_TEMP_MASK ; hw[3] |= (insn->mask << NV40_VP_INST_SCA_WRITEMASK_SHIFT); } } void CCompiler::emit_dst(u32 *hw,u8 slot,struct nvfx_insn *insn) { struct nvfx_reg *dst = &insn->dst; switch(dst->type) { case NVFXSR_NONE: hw[3] |= NV40_VP_INST_DEST_MASK; if(slot==0) hw[0] |= NV40_VP_INST_VEC_DEST_TEMP_MASK; else hw[3] |= NV40_VP_INST_SCA_DEST_TEMP_MASK; break; case NVFXSR_TEMP: hw[3] |= NV40_VP_INST_DEST_MASK; if (slot == 0) hw[0] |= (dst->index << NV40_VP_INST_VEC_DEST_TEMP_SHIFT); else hw[3] |= (dst->index << NV40_VP_INST_SCA_DEST_TEMP_SHIFT); break; case NVFXSR_OUTPUT: switch (dst->index) { case NV30_VP_INST_DEST_CLP(0): dst->index = NVFX_VP(INST_DEST_FOGC); insn->mask = NVFX_VP_MASK_Y; m_nOutputMask |= (1 << 6); break; case NV30_VP_INST_DEST_CLP(1): dst->index = NVFX_VP(INST_DEST_FOGC); insn->mask = NVFX_VP_MASK_Z; m_nOutputMask |= (1 << 7); break; case NV30_VP_INST_DEST_CLP(2): dst->index = NVFX_VP(INST_DEST_FOGC); insn->mask = NVFX_VP_MASK_W; m_nOutputMask |= (1 << 8); break; case NV30_VP_INST_DEST_CLP(3): dst->index = NVFX_VP(INST_DEST_PSZ); insn->mask = NVFX_VP_MASK_Y; m_nOutputMask |= (1 << 9); break; case NV30_VP_INST_DEST_CLP(4): dst->index = NVFX_VP(INST_DEST_PSZ); insn->mask = NVFX_VP_MASK_Z; m_nOutputMask |= (1 << 10); break; case NV30_VP_INST_DEST_CLP(5): dst->index = NVFX_VP(INST_DEST_PSZ); insn->mask = NVFX_VP_MASK_W; m_nOutputMask |= (1 << 11); break; case NV40_VP_INST_DEST_COL0 : m_nOutputMask |= (1 << 0); break; case NV40_VP_INST_DEST_COL1 : m_nOutputMask |= (1 << 1); break; case NV40_VP_INST_DEST_BFC0 : m_nOutputMask |= (1 << 2); break; case NV40_VP_INST_DEST_BFC1 : m_nOutputMask |= (1 << 3); break; case NV40_VP_INST_DEST_FOGC : m_nOutputMask |= (1 << 4); break; case NV40_VP_INST_DEST_PSZ : m_nOutputMask |= (1 << 5); break; default: if(dst->index>=NV40_VP_INST_DEST_TC(0) && dst->index<=NV40_VP_INST_DEST_TC(7)) m_nOutputMask |= (1<<(dst->index - NV40_VP_INST_DEST_TC0 + 14)); break; } hw[3] |= (dst->index << NV40_VP_INST_DEST_SHIFT); if (slot == 0) { hw[0] |= NV40_VP_INST_VEC_RESULT; hw[0] |= NV40_VP_INST_VEC_DEST_TEMP_MASK; } else { hw[3] |= NV40_VP_INST_SCA_RESULT; hw[3] |= NV40_VP_INST_SCA_DEST_TEMP_MASK; } break; } } void CCompiler::emit_src(u32 *hw, u8 pos, struct nvfx_src *src) { u32 sr = 0; struct nvfx_relocation reloc; switch(src->reg.type) { case NVFXSR_TEMP: sr |= (NVFX_VP(SRC_REG_TYPE_TEMP) << NVFX_VP(SRC_REG_TYPE_SHIFT)); sr |= (src->reg.index << NVFX_VP(SRC_TEMP_SRC_SHIFT)); break; case NVFXSR_INPUT: sr |= (NVFX_VP(SRC_REG_TYPE_INPUT) << NVFX_VP(SRC_REG_TYPE_SHIFT)); m_nInputMask |= (1 << src->reg.index); hw[1] |= (src->reg.index << NVFX_VP(INST_INPUT_SRC_SHIFT)); break; case NVFXSR_CONST: sr |= (NVFX_VP(SRC_REG_TYPE_CONST) << NVFX_VP(SRC_REG_TYPE_SHIFT)); reloc.location = m_nInstructions - 1; reloc.target = src->reg.index; m_lConstRelocation.push_back(reloc); break; case NVFXSR_NONE: sr |= (NVFX_VP(SRC_REG_TYPE_INPUT) << NVFX_VP(SRC_REG_TYPE_SHIFT)); break; } if (src->negate) sr |= NVFX_VP(SRC_NEGATE); if (src->abs) hw[0] |= (1 << (21 + pos)); sr |= ((src->swz[0] << NVFX_VP(SRC_SWZ_X_SHIFT)) | (src->swz[1] << NVFX_VP(SRC_SWZ_Y_SHIFT)) | (src->swz[2] << NVFX_VP(SRC_SWZ_Z_SHIFT)) | (src->swz[3] << NVFX_VP(SRC_SWZ_W_SHIFT))); if(src->indirect) { if(src->reg.type == NVFXSR_CONST) hw[3] |= NVFX_VP(INST_INDEX_CONST); else if(src->reg.type == NVFXSR_INPUT) hw[0] |= NVFX_VP(INST_INDEX_INPUT); if(src->indirect_reg) hw[0] |= NVFX_VP(INST_ADDR_REG_SELECT_1); hw[0] |= src->indirect_swz << NVFX_VP(INST_ADDR_SWZ_SHIFT); } switch (pos) { case 0: hw[1] |= (((sr & NVFX_VP(SRC0_HIGH_MASK)) >> NVFX_VP(SRC0_HIGH_SHIFT)) << NVFX_VP(INST_SRC0H_SHIFT)); hw[2] |= ((sr & NVFX_VP(SRC0_LOW_MASK)) << NVFX_VP(INST_SRC0L_SHIFT)); break; case 1: hw[2] |= (sr << NVFX_VP(INST_SRC1_SHIFT)); break; case 2: hw[2] |= (((sr & NVFX_VP(SRC2_HIGH_MASK)) >> NVFX_VP(SRC2_HIGH_SHIFT)) << NVFX_VP(INST_SRC2H_SHIFT)); hw[3] |= ((sr & NVFX_VP(SRC2_LOW_MASK)) << NVFX_VP(INST_SRC2L_SHIFT)); break; } } struct nvfx_reg CCompiler::temp() { s32 idx = ffs(~m_rTemps) - 1; if(idx<0) return nvfx_reg(NVFXSR_NONE,0); m_rTemps |= (1<<idx); m_rTempsDiscard |= (1<<idx); if((s32)m_nNumRegs<idx) m_nNumRegs = idx; return nvfx_reg(NVFXSR_TEMP,idx); } void CCompiler::release_temps() { m_rTemps &= ~m_rTempsDiscard; m_rTempsDiscard = 0; } struct nvfx_reg CCompiler::constant(s32 pipe, f32 x, f32 y, f32 z, f32 w) { int idx; struct vertex_program_data *vpd; if(pipe>=0) { for(idx=0;idx<m_nConsts;idx++) { if(m_pConstData[idx].index==pipe) return nvfx_reg(NVFXSR_CONST,idx); } } idx = m_nConsts++; m_pConstData = (struct vertex_program_data*)realloc(m_pConstData,sizeof(struct vertex_program_data)*m_nConsts); vpd = &m_pConstData[idx]; vpd->index = pipe; vpd->value[0] = x; vpd->value[1] = y; vpd->value[2] = z; vpd->value[3] = w; return nvfx_reg(NVFXSR_CONST,idx); }
[ "shagkur@gmx.net" ]
shagkur@gmx.net
5f319b5adec2517a82f2cfa97d6f0aeaed42ecfc
920177e9f2236c612aa406a0949accdfb1294104
/tools/pacotes/Inline-0.50/C/_Inline_test/lib/auto/_01syntax_t_5b3f/_01syntax_t_5b3f.inl
b852607dcedb598405d01e55a9036d7a9e4444d9
[]
no_license
franciellevargas/NewsCrawler
76dec8d426317d090bd618dd4d1deac8549b2343
6042648b28067338b3d7c15a23288c870b69b6b9
refs/heads/master
2022-05-01T07:58:57.938173
2016-11-06T03:03:18
2016-11-06T03:03:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
593
inl
md5 : 5b3f02a5689473a9f4268428bfe0f3cd name : _01syntax_t_5b3f version : "" language : C language_id : C installed : 0 date_compiled : Fri Jan 17 00:15:29 2014 inline_version : 0.5 ILSM : % module : Inline::C suffix : so type : compiled Config : % apiversion : ? archname : i686-linux-gnu-thread-multi-64int cc : cc ccflags : -D_REENTRANT -D_GNU_SOURCE -DDEBIAN -fstack-protector -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 ld : cc osname : linux osvers : 3.2.0-37-generic so : so version : 5.14.2
[ "erick@EricksComputer.local" ]
erick@EricksComputer.local
b6c10e1a1fdad05d30f01d51be9549200ef26d66
14da2a5b65d7d188b9ccbd18238ac02588df70be
/POJ3255.cpp
fd676652cb4bae8bd2dd69c0733bbc9529988c62
[]
no_license
sgc109/algorithm_practice
754f378634c68a29577abffb8371e58ac0433345
19fa107892754b227f8592aa9b6ae7fad175728e
refs/heads/master
2020-03-17T21:39:58.570520
2018-05-23T20:06:44
2018-05-23T20:06:44
133,968,628
0
0
null
null
null
null
UTF-8
C++
false
false
1,567
cpp
// #include <bits/stdc++.h> #include <set> #include <map> #include <cmath> #include <stack> #include <queue> #include <cstdio> #include <vector> #include <cstring> #include <utility> #include <iostream> #include <algorithm> #define pb push_back #define sz(v) ((int)(v).size()) #define all(v) (v).begin(), (v).end() using namespace std; typedef long long ll; const int mod = 1e9+7; const int inf = 0x3c3c3c3c; const long long infl = 0x3c3c3c3c3c3c3c3c; vector<int> dist[5003]; int V, E; vector<pair<int,int> > G[5003]; priority_queue<pair<int,int> > pq; int push(int node, int d){ for(int i = 0 ; i < sz(dist[node]); i++) if(dist[node][i] == d) return 0; if(sz(dist[node]) == 2 && dist[node][1] < d) return 0; dist[node].pb(d); sort(all(dist[node])); dist[node] = vector<int>(dist[node].begin(), dist[node].begin() + min(sz(dist[node]), 2)); return 1; } void dijkstra(int s, int e){ dist[s].pb(0); pq.push(make_pair(0, s)); while(!pq.empty()){ pair<int,int> p = pq.top(); pq.pop(); int curD = -p.first; int cur = p.second; if(dist[cur].back() < curD) continue; for(int i = 0 ; i < sz(G[cur]); i++){ pair<int,int> pp = G[cur][i]; int next = pp.first; int cost = curD + pp.second; if(!push(next, cost)) continue; pq.push(make_pair(-cost, next)); } } } int main() { scanf("%d %d", &V, &E); while(E--){ int a, b, c; scanf("%d %d %d", &a, &b, &c); G[a].pb(make_pair(b, c)); G[b].pb(make_pair(a, c)); } dijkstra(1, V); printf("%d", dist[V][1]); return 0; }
[ "sgc109@LAPTOP-KBAMD1MP.localdomain" ]
sgc109@LAPTOP-KBAMD1MP.localdomain
180439d0e4974d87050123c3c4f9a80fea348445
87d69ded7629a54220ceefcdf21449acf6a0d5a0
/extlib/sol2/sol2/forward.hpp
64df2c38e1ec610e67e0863c209eea2d1ca35173
[ "Apache-2.0" ]
permissive
F4r3n/FarenMediaLibrary
955e63f3c94bae9a0245cbfa2a2e0ff49c5d915d
a138ea5ec687e7252b63d5cb1bdbc06be02961aa
refs/heads/main
2023-08-08T20:25:27.094533
2023-08-07T12:56:55
2023-08-07T12:56:55
65,391,951
8
1
Apache-2.0
2023-08-15T15:37:24
2016-08-10T15:02:46
C
UTF-8
C++
false
false
36,766
hpp
// The MIT License (MIT) // Copyright (c) 2013-2020 Rapptz, ThePhD and contributors // Permission is hereby granted, free of charge, to any person obtaining a copy of // this software and associated documentation files (the "Software"), to deal in // the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do so, // subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS // FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR // COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER // IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN // CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // This file was generated with a script. // Generated 2022-06-25 08:14:19.328625 UTC // This header was generated with sol v3.3.0 (revision eba86625) // https://github.com/ThePhD/sol2 #ifndef SOL_SINGLE_INCLUDE_FORWARD_HPP #define SOL_SINGLE_INCLUDE_FORWARD_HPP // beginning of sol/forward.hpp #ifndef SOL_FORWARD_HPP #define SOL_FORWARD_HPP // beginning of sol/version.hpp #include <sol2/config.hpp> #define SOL_VERSION_MAJOR 3 #define SOL_VERSION_MINOR 2 #define SOL_VERSION_PATCH 3 #define SOL_VERSION_STRING "3.2.3" #define SOL_VERSION ((SOL_VERSION_MAJOR * 100000) + (SOL_VERSION_MINOR * 100) + (SOL_VERSION_PATCH)) #define SOL_TOKEN_TO_STRING_POST_EXPANSION_I_(_TOKEN) #_TOKEN #define SOL_TOKEN_TO_STRING_I_(_TOKEN) SOL_TOKEN_TO_STRING_POST_EXPANSION_I_(_TOKEN) #define SOL_CONCAT_TOKENS_POST_EXPANSION_I_(_LEFT, _RIGHT) _LEFT##_RIGHT #define SOL_CONCAT_TOKENS_I_(_LEFT, _RIGHT) SOL_CONCAT_TOKENS_POST_EXPANSION_I_(_LEFT, _RIGHT) #define SOL_RAW_IS_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) != 0) #define SOL_RAW_IS_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3) == 0) #define SOL_RAW_IS_DEFAULT_ON(OP_SYMBOL) ((3 OP_SYMBOL 3) > 3) #define SOL_RAW_IS_DEFAULT_OFF(OP_SYMBOL) ((3 OP_SYMBOL 3 OP_SYMBOL 3) < 0) #define SOL_IS_ON(OP_SYMBOL) SOL_RAW_IS_ON(OP_SYMBOL ## _I_) #define SOL_IS_OFF(OP_SYMBOL) SOL_RAW_IS_OFF(OP_SYMBOL ## _I_) #define SOL_IS_DEFAULT_ON(OP_SYMBOL) SOL_RAW_IS_DEFAULT_ON(OP_SYMBOL ## _I_) #define SOL_IS_DEFAULT_OFF(OP_SYMBOL) SOL_RAW_IS_DEFAULT_OFF(OP_SYMBOL ## _I_) #define SOL_ON | #define SOL_OFF ^ #define SOL_DEFAULT_ON + #define SOL_DEFAULT_OFF - #if defined(SOL_BUILD_CXX_MODE) #if (SOL_BUILD_CXX_MODE != 0) #define SOL_BUILD_CXX_MODE_I_ SOL_ON #else #define SOL_BUILD_CXX_MODE_I_ SOL_OFF #endif #elif defined(__cplusplus) #define SOL_BUILD_CXX_MODE_I_ SOL_DEFAULT_ON #else #define SOL_BUILD_CXX_MODE_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_BUILD_C_MODE) #if (SOL_BUILD_C_MODE != 0) #define SOL_BUILD_C_MODE_I_ SOL_ON #else #define SOL_BUILD_C_MODE_I_ SOL_OFF #endif #elif defined(__STDC__) #define SOL_BUILD_C_MODE_I_ SOL_DEFAULT_ON #else #define SOL_BUILD_C_MODE_I_ SOL_DEFAULT_OFF #endif #if SOL_IS_ON(SOL_BUILD_C_MODE) #include <stddef.h> #include <stdint.h> #include <limits.h> #else #include <cstddef> #include <cstdint> #include <climits> #endif #if defined(SOL_COMPILER_VCXX) #if defined(SOL_COMPILER_VCXX != 0) #define SOL_COMPILER_VCXX_I_ SOL_ON #else #define SOL_COMPILER_VCXX_I_ SOL_OFF #endif #elif defined(_MSC_VER) #define SOL_COMPILER_VCXX_I_ SOL_DEFAULT_ON #else #define SOL_COMPILER_VCXX_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_COMPILER_GCC) #if defined(SOL_COMPILER_GCC != 0) #define SOL_COMPILER_GCC_I_ SOL_ON #else #define SOL_COMPILER_GCC_I_ SOL_OFF #endif #elif defined(__GNUC__) #define SOL_COMPILER_GCC_I_ SOL_DEFAULT_ON #else #define SOL_COMPILER_GCC_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_COMPILER_CLANG) #if defined(SOL_COMPILER_CLANG != 0) #define SOL_COMPILER_CLANG_I_ SOL_ON #else #define SOL_COMPILER_CLANG_I_ SOL_OFF #endif #elif defined(__clang__) #define SOL_COMPILER_CLANG_I_ SOL_DEFAULT_ON #else #define SOL_COMPILER_CLANG_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_COMPILER_EDG) #if defined(SOL_COMPILER_EDG != 0) #define SOL_COMPILER_EDG_I_ SOL_ON #else #define SOL_COMPILER_EDG_I_ SOL_OFF #endif #else #define SOL_COMPILER_EDG_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_COMPILER_MINGW) #if (SOL_COMPILER_MINGW != 0) #define SOL_COMPILER_MINGW_I_ SOL_ON #else #define SOL_COMPILER_MINGW_I_ SOL_OFF #endif #elif defined(__MINGW32__) #define SOL_COMPILER_MINGW_I_ SOL_DEFAULT_ON #else #define SOL_COMPILER_MINGW_I_ SOL_DEFAULT_OFF #endif #if SIZE_MAX <= 0xFFFFULL #define SOL_PLATFORM_X16_I_ SOL_ON #define SOL_PLATFORM_X86_I_ SOL_OFF #define SOL_PLATFORM_X64_I_ SOL_OFF #elif SIZE_MAX <= 0xFFFFFFFFULL #define SOL_PLATFORM_X16_I_ SOL_OFF #define SOL_PLATFORM_X86_I_ SOL_ON #define SOL_PLATFORM_X64_I_ SOL_OFF #else #define SOL_PLATFORM_X16_I_ SOL_OFF #define SOL_PLATFORM_X86_I_ SOL_OFF #define SOL_PLATFORM_X64_I_ SOL_ON #endif #define SOL_PLATFORM_ARM32_I_ SOL_OFF #define SOL_PLATFORM_ARM64_I_ SOL_OFF #if defined(SOL_PLATFORM_WINDOWS) #if (SOL_PLATFORM_WINDOWS != 0) #define SOL_PLATFORM_WINDOWS_I_ SOL_ON #else #define SOL_PLATFORM_WINDOWS_I_ SOL_OFF #endif #elif defined(_WIN32) #define SOL_PLATFORM_WINDOWS_I_ SOL_DEFAULT_ON #else #define SOL_PLATFORM_WINDOWS_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_PLATFORM_CYGWIN) #if (SOL_PLATFORM_CYGWIN != 0) #define SOL_PLATFORM_CYGWIN_I_ SOL_ON #else #define SOL_PLATFORM_CYGWIN_I_ SOL_ON #endif #elif defined(__CYGWIN__) #define SOL_PLATFORM_CYGWIN_I_ SOL_DEFAULT_ON #else #define SOL_PLATFORM_CYGWIN_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_PLATFORM_APPLE) #if (SOL_PLATFORM_APPLE != 0) #define SOL_PLATFORM_APPLE_I_ SOL_ON #else #define SOL_PLATFORM_APPLE_I_ SOL_OFF #endif #elif defined(__APPLE__) #define SOL_PLATFORM_APPLE_I_ SOL_DEFAULT_ON #else #define SOL_PLATFORM_APPLE_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_PLATFORM_UNIX) #if (SOL_PLATFORM_UNIX != 0) #define SOL_PLATFORM_UNIXLIKE_I_ SOL_ON #else #define SOL_PLATFORM_UNIXLIKE_I_ SOL_OFF #endif #elif defined(__unix__) #define SOL_PLATFORM_UNIXLIKE_I_ SOL_DEFAUKT_ON #else #define SOL_PLATFORM_UNIXLIKE_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_PLATFORM_LINUX) #if (SOL_PLATFORM_LINUX != 0) #define SOL_PLATFORM_LINUXLIKE_I_ SOL_ON #else #define SOL_PLATFORM_LINUXLIKE_I_ SOL_OFF #endif #elif defined(__LINUX__) #define SOL_PLATFORM_LINUXLIKE_I_ SOL_DEFAUKT_ON #else #define SOL_PLATFORM_LINUXLIKE_I_ SOL_DEFAULT_OFF #endif #define SOL_PLATFORM_APPLE_IPHONE_I_ SOL_OFF #define SOL_PLATFORM_BSDLIKE_I_ SOL_OFF #if defined(SOL_IN_DEBUG_DETECTED) #if SOL_IN_DEBUG_DETECTED != 0 #define SOL_DEBUG_BUILD_I_ SOL_ON #else #define SOL_DEBUG_BUILD_I_ SOL_OFF #endif #elif !defined(NDEBUG) #if SOL_IS_ON(SOL_COMPILER_VCXX) && defined(_DEBUG) #define SOL_DEBUG_BUILD_I_ SOL_ON #elif (SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC)) && !defined(__OPTIMIZE__) #define SOL_DEBUG_BUILD_I_ SOL_ON #else #define SOL_DEBUG_BUILD_I_ SOL_OFF #endif #else #define SOL_DEBUG_BUILD_I_ SOL_DEFAULT_OFF #endif // We are in a debug mode of some sort #if defined(SOL_NO_EXCEPTIONS) #if (SOL_NO_EXCEPTIONS != 0) #define SOL_EXCEPTIONS_I_ SOL_OFF #else #define SOL_EXCEPTIONS_I_ SOL_ON #endif #elif SOL_IS_ON(SOL_COMPILER_VCXX) #if !defined(_CPPUNWIND) #define SOL_EXCEPTIONS_I_ SOL_OFF #else #define SOL_EXCEPTIONS_I_ SOL_ON #endif #elif SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC) #if !defined(__EXCEPTIONS) #define SOL_EXCEPTIONS_I_ SOL_OFF #else #define SOL_EXCEPTIONS_I_ SOL_ON #endif #else #define SOL_EXCEPTIONS_I_ SOL_DEFAULT_ON #endif #if defined(SOL_NO_RTTI) #if (SOL_NO_RTTI != 0) #define SOL_RTTI_I_ SOL_OFF #else #define SOL_RTTI_I_ SOL_ON #endif #elif SOL_IS_ON(SOL_COMPILER_VCXX) #if !defined(_CPPRTTI) #define SOL_RTTI_I_ SOL_OFF #else #define SOL_RTTI_I_ SOL_ON #endif #elif SOL_IS_ON(SOL_COMPILER_CLANG) || SOL_IS_ON(SOL_COMPILER_GCC) #if !defined(__GXX_RTTI) #define SOL_RTTI_I_ SOL_OFF #else #define SOL_RTTI_I_ SOL_ON #endif #else #define SOL_RTTI_I_ SOL_DEFAULT_ON #endif #if defined(SOL_NO_THREAD_LOCAL) #if SOL_NO_THREAD_LOCAL != 0 #define SOL_USE_THREAD_LOCAL_I_ SOL_OFF #else #define SOL_USE_THREAD_LOCAL_I_ SOL_ON #endif #else #define SOL_USE_THREAD_LOCAL_I_ SOL_DEFAULT_ON #endif // thread_local keyword is bjorked on some platforms #if defined(SOL_ALL_SAFETIES_ON) #if SOL_ALL_SAFETIES_ON != 0 #define SOL_ALL_SAFETIES_ON_I_ SOL_ON #else #define SOL_ALL_SAFETIES_ON_I_ SOL_OFF #endif #else #define SOL_ALL_SAFETIES_ON_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_SAFE_GETTER) #if SOL_SAFE_GETTER != 0 #define SOL_SAFE_GETTER_I_ SOL_ON #else #define SOL_SAFE_GETTER_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_GETTER_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_GETTER_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_USERTYPE) #if SOL_SAFE_USERTYPE != 0 #define SOL_SAFE_USERTYPE_I_ SOL_ON #else #define SOL_SAFE_USERTYPE_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_USERTYPE_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_USERTYPE_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_REFERENCES) #if SOL_SAFE_REFERENCES != 0 #define SOL_SAFE_REFERENCES_I_ SOL_ON #else #define SOL_SAFE_REFERENCES_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_REFERENCES_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_REFERENCES_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_FUNCTIONS) #if SOL_SAFE_FUNCTIONS != 0 #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON #else #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_OFF #endif #elif defined (SOL_SAFE_FUNCTION_OBJECTS) #if SOL_SAFE_FUNCTION_OBJECTS != 0 #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON #else #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_FUNCTION_OBJECTS_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_FUNCTION_CALLS) #if SOL_SAFE_FUNCTION_CALLS != 0 #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON #else #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_FUNCTION_CALLS_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_PROXIES) #if SOL_SAFE_PROXIES != 0 #define SOL_SAFE_PROXIES_I_ SOL_ON #else #define SOL_SAFE_PROXIES_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_PROXIES_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_PROXIES_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_SAFE_NUMERICS) #if SOL_SAFE_NUMERICS != 0 #define SOL_SAFE_NUMERICS_I_ SOL_ON #else #define SOL_SAFE_NUMERICS_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_NUMERICS_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_NUMERICS_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_ALL_INTEGER_VALUES_FIT) #if (SOL_ALL_INTEGER_VALUES_FIT != 0) #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_ON #else #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_OFF #endif #elif !SOL_IS_DEFAULT_OFF(SOL_SAFE_NUMERICS) && SOL_IS_OFF(SOL_SAFE_NUMERICS) // if numerics is intentionally turned off, flip this on #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_DEFAULT_ON #else // default to off #define SOL_ALL_INTEGER_VALUES_FIT_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_SAFE_STACK_CHECK) #if SOL_SAFE_STACK_CHECK != 0 #define SOL_SAFE_STACK_CHECK_I_ SOL_ON #else #define SOL_SAFE_STACK_CHECK_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_SAFE_STACK_CHECK_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_ON #else #define SOL_SAFE_STACK_CHECK_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_NO_CHECK_NUMBER_PRECISION) #if SOL_NO_CHECK_NUMBER_PRECISION != 0 #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_OFF #else #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON #endif #elif defined(SOL_NO_CHECKING_NUMBER_PRECISION) #if SOL_NO_CHECKING_NUMBER_PRECISION != 0 #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_OFF #else #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON #elif SOL_IS_ON(SOL_SAFE_NUMERICS) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_ON #else #define SOL_NUMBER_PRECISION_CHECKS_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_STRINGS_ARE_NUMBERS) #if (SOL_STRINGS_ARE_NUMBERS != 0) #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_ON #else #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_OFF #endif #else #define SOL_STRINGS_ARE_NUMBERS_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_ENABLE_INTEROP) #if SOL_ENABLE_INTEROP != 0 #define SOL_USE_INTEROP_I_ SOL_ON #else #define SOL_USE_INTEROP_I_ SOL_OFF #endif #elif defined(SOL_USE_INTEROP) #if SOL_USE_INTEROP != 0 #define SOL_USE_INTEROP_I_ SOL_ON #else #define SOL_USE_INTEROP_I_ SOL_OFF #endif #else #define SOL_USE_INTEROP_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_NO_NIL) #if (SOL_NO_NIL != 0) #define SOL_NIL_I_ SOL_OFF #else #define SOL_NIL_I_ SOL_ON #endif #elif defined(__MAC_OS_X_VERSION_MAX_ALLOWED) || defined(__OBJC__) || defined(nil) #define SOL_NIL_I_ SOL_DEFAULT_OFF #else #define SOL_NIL_I_ SOL_DEFAULT_ON #endif #if defined(SOL_USERTYPE_TYPE_BINDING_INFO) #if (SOL_USERTYPE_TYPE_BINDING_INFO != 0) #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_ON #else #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_OFF #endif #else #define SOL_USERTYPE_TYPE_BINDING_INFO_I_ SOL_DEFAULT_ON #endif // We should generate a my_type.__type table with lots of class information for usertypes #if defined(SOL_AUTOMAGICAL_TYPES_BY_DEFAULT) #if (SOL_AUTOMAGICAL_TYPES_BY_DEFAULT != 0) #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON #else #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF #endif #elif defined(SOL_DEFAULT_AUTOMAGICAL_USERTYPES) #if (SOL_DEFAULT_AUTOMAGICAL_USERTYPES != 0) #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_ON #else #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_OFF #endif #else #define SOL_DEFAULT_AUTOMAGICAL_USERTYPES_I_ SOL_DEFAULT_ON #endif // make is_automagical on/off by default #if defined(SOL_STD_VARIANT) #if (SOL_STD_VARIANT != 0) #define SOL_STD_VARIANT_I_ SOL_ON #else #define SOL_STD_VARIANT_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_COMPILER_CLANG) && SOL_IS_ON(SOL_PLATFORM_APPLE) #if defined(__has_include) #if __has_include(<variant>) #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON #else #define SOL_STD_VARIANT_I_ SOL_DEFAULT_OFF #endif #else #define SOL_STD_VARIANT_I_ SOL_DEFAULT_OFF #endif #else #define SOL_STD_VARIANT_I_ SOL_DEFAULT_ON #endif #endif // make is_automagical on/off by default #if defined(SOL_NOEXCEPT_FUNCTION_TYPE) #if (SOL_NOEXCEPT_FUNCTION_TYPE != 0) #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON #else #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF #endif #else #if defined(__cpp_noexcept_function_type) #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_ON #elif SOL_IS_ON(SOL_COMPILER_VCXX) && (defined(_MSVC_LANG) && (_MSVC_LANG < 201403L)) // There is a bug in the VC++ compiler?? // on /std:c++latest under x86 conditions (VS 15.5.2), // compiler errors are tossed for noexcept markings being on function types // that are identical in every other way to their non-noexcept marked types function types... // VS 2019: There is absolutely a bug. #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_OFF #else #define SOL_USE_NOEXCEPT_FUNCTION_TYPE_I_ SOL_DEFAULT_ON #endif #endif // noexcept is part of a function's type #if defined(SOL_STACK_STRING_OPTIMIZATION_SIZE) && SOL_STACK_STRING_OPTIMIZATION_SIZE > 0 #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ SOL_STACK_STRING_OPTIMIZATION_SIZE #else #define SOL_OPTIMIZATION_STRING_CONVERSION_STACK_SIZE_I_ 1024 #endif #if defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 #define SOL_ID_SIZE_I_ SOL_ID_SIZE #else #define SOL_ID_SIZE_I_ 512 #endif #if defined(LUA_IDSIZE) && LUA_IDSIZE > 0 #define SOL_FILE_ID_SIZE_I_ LUA_IDSIZE #elif defined(SOL_ID_SIZE) && SOL_ID_SIZE > 0 #define SOL_FILE_ID_SIZE_I_ SOL_FILE_ID_SIZE #else #define SOL_FILE_ID_SIZE_I_ 2048 #endif #if defined(SOL_PRINT_ERRORS) #if (SOL_PRINT_ERRORS != 0) #define SOL_PRINT_ERRORS_I_ SOL_ON #else #define SOL_PRINT_ERRORS_I_ SOL_OFF #endif #else #if SOL_IS_ON(SOL_ALL_SAFETIES_ON) #define SOL_PRINT_ERRORS_I_ SOL_ON #elif SOL_IS_ON(SOL_DEBUG_BUILD) #define SOL_PRINT_ERRORS_I_ SOL_DEFAULT_ON #else #define SOL_PRINT_ERRORS_I_ SOL_OFF #endif #endif #if defined(SOL_DEFAULT_PASS_ON_ERROR) #if (SOL_DEFAULT_PASS_ON_ERROR != 0) #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_ON #else #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_OFF #endif #else #define SOL_DEFAULT_PASS_ON_ERROR_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_USING_CXX_LUA) #if (SOL_USING_CXX_LUA != 0) #define SOL_USE_CXX_LUA_I_ SOL_ON #else #define SOL_USE_CXX_LUA_I_ SOL_OFF #endif #elif defined(SOL_USE_CXX_LUA) #if (SOL_USE_CXX_LUA != 0) #define SOL_USE_CXX_LUA_I_ SOL_ON #else #define SOL_USE_CXX_LUA_I_ SOL_OFF #endif #else #define SOL_USE_CXX_LUA_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_USING_CXX_LUAJIT) #if (SOL_USING_CXX_LUA != 0) #define SOL_USE_CXX_LUAJIT_I_ SOL_ON #else #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF #endif #elif defined(SOL_USE_CXX_LUAJIT) #if (SOL_USE_CXX_LUA != 0) #define SOL_USE_CXX_LUAJIT_I_ SOL_ON #else #define SOL_USE_CXX_LUAJIT_I_ SOL_OFF #endif #else #define SOL_USE_CXX_LUAJIT_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_NO_LUA_HPP) #if (SOL_NO_LUA_HPP != 0) #define SOL_USE_LUA_HPP_I_ SOL_OFF #else #define SOL_USE_LUA_HPP_I_ SOL_ON #endif #elif defined(SOL_USING_CXX_LUA) #define SOL_USE_LUA_HPP_I_ SOL_OFF #elif defined(__has_include) #if __has_include(<lua.hpp>) #define SOL_USE_LUA_HPP_I_ SOL_ON #else #define SOL_USE_LUA_HPP_I_ SOL_OFF #endif #else #define SOL_USE_LUA_HPP_I_ SOL_DEFAULT_ON #endif #if defined(SOL_CONTAINERS_START) #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START #elif defined(SOL_CONTAINERS_START_INDEX) #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINERS_START_INDEX #elif defined(SOL_CONTAINER_START_INDEX) #define SOL_CONTAINER_START_INDEX_I_ SOL_CONTAINER_START_INDEX #else #define SOL_CONTAINER_START_INDEX_I_ 1 #endif #if defined (SOL_NO_MEMORY_ALIGNMENT) #if (SOL_NO_MEMORY_ALIGNMENT != 0) #define SOL_ALIGN_MEMORY_I_ SOL_OFF #else #define SOL_ALIGN_MEMORY_I_ SOL_ON #endif #else #define SOL_ALIGN_MEMORY_I_ SOL_DEFAULT_ON #endif #if defined(SOL_USE_BOOST) #if (SOL_USE_BOOST != 0) #define SOL_USE_BOOST_I_ SOL_ON #else #define SOL_USE_BOOST_I_ SOL_OFF #endif #else #define SOL_USE_BOOST_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_USE_UNSAFE_BASE_LOOKUP) #if (SOL_USE_UNSAFE_BASE_LOOKUP != 0) #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_ON #else #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_OFF #endif #else #define SOL_USE_UNSAFE_BASE_LOOKUP_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_INSIDE_UNREAL) #if (SOL_INSIDE_UNREAL != 0) #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_ON #else #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_OFF #endif #else #if defined(UE_BUILD_DEBUG) || defined(UE_BUILD_DEVELOPMENT) || defined(UE_BUILD_TEST) || defined(UE_BUILD_SHIPPING) || defined(UE_SERVER) #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_DEFAULT_ON #else #define SOL_INSIDE_UNREAL_ENGINE_I_ SOL_DEFAULT_OFF #endif #endif #if defined(SOL_NO_COMPAT) #if (SOL_NO_COMPAT != 0) #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_OFF #else #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_ON #endif #else #define SOL_USE_COMPATIBILITY_LAYER_I_ SOL_DEFAULT_ON #endif #if defined(SOL_GET_FUNCTION_POINTER_UNSAFE) #if (SOL_GET_FUNCTION_POINTER_UNSAFE != 0) #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_ON #else #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_OFF #endif #else #define SOL_GET_FUNCTION_POINTER_UNSAFE_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_FUNCTION_CALL_VALUE_SEMANTICS) #if (SOL_FUNCTION_CALL_VALUE_SEMANTICS != 0) #define SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_ SOL_ON #else #define SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_ SOL_OFF #endif #else #define SOL_FUNCTION_CALL_VALUE_SEMANTICS_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_MINGW_CCTYPE_IS_POISONED) #if (SOL_MINGW_CCTYPE_IS_POISONED != 0) #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_ON #else #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_OFF #endif #elif SOL_IS_ON(SOL_COMPILER_MINGW) && defined(__GNUC__) && (__GNUC__ < 6) // MinGW is off its rocker in some places... #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_ON #else #define SOL_MINGW_CCTYPE_IS_POISONED_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_CHAR8_T) #if (SOL_CHAR8_T != 0) #define SOL_CHAR8_T_I_ SOL_ON #else #define SOL_CHAR8_T_I_ SOL_OFF #endif #else #if defined(__cpp_char8_t) #define SOL_CHAR8_T_I_ SOL_DEFAULT_ON #else #define SOL_CHAR8_T_I_ SOL_DEFAULT_OFF #endif #endif #if SOL_IS_ON(SOL_USE_BOOST) #include <boost/version.hpp> #if BOOST_VERSION >= 107500 // Since Boost 1.75.0 boost::none is constexpr #define SOL_BOOST_NONE_CONSTEXPR_I_ constexpr #else #define SOL_BOOST_NONE_CONSTEXPR_I_ const #endif // BOOST_VERSION #else // assume boost isn't using a garbage version #define SOL_BOOST_NONE_CONSTEXPR_I_ constexpr #endif #if defined(SOL2_CI) #if (SOL2_CI != 0) #define SOL2_CI_I_ SOL_ON #else #define SOL2_CI_I_ SOL_OFF #endif #else #define SOL2_CI_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_C_ASSERT) #define SOL_USER_C_ASSERT_I_ SOL_ON #else #define SOL_USER_C_ASSERT_I_ SOL_DEFAULT_OFF #endif #if defined(SOL_M_ASSERT) #define SOL_USER_M_ASSERT_I_ SOL_ON #else #define SOL_USER_M_ASSERT_I_ SOL_DEFAULT_OFF #endif // beginning of sol/prologue.hpp #if defined(SOL_PROLOGUE_I_) #error "[sol2] Library Prologue was already included in translation unit and not properly ended with an epilogue." #endif #define SOL_PROLOGUE_I_ 1 #if SOL_IS_ON(SOL_BUILD_CXX_MODE) #define _FWD(...) static_cast<decltype( __VA_ARGS__ )&&>( __VA_ARGS__ ) #if SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define _MOVE(...) static_cast<__typeof( __VA_ARGS__ )&&>( __VA_ARGS__ ) #else #include <type_traits> #define _MOVE(...) static_cast<::std::remove_reference_t<( __VA_ARGS__ )>&&>( __VA_OPT__(,) ) #endif #endif // end of sol/prologue.hpp // beginning of sol/epilogue.hpp #if !defined(SOL_PROLOGUE_I_) #error "[sol2] Library Prologue is missing from this translation unit." #else #undef SOL_PROLOGUE_I_ #endif #if SOL_IS_ON(SOL_BUILD_CXX_MODE) #undef _FWD #undef _MOVE #endif // end of sol/epilogue.hpp // beginning of sol/detail/build_version.hpp #if defined(SOL_DLL) #if (SOL_DLL != 0) #define SOL_DLL_I_ SOL_ON #else #define SOL_DLL_I_ SOL_OFF #endif #elif SOL_IS_ON(SOL_COMPILER_VCXX) && (defined(DLL_) || defined(_DLL)) #define SOL_DLL_I_ SOL_DEFAULT_ON #else #define SOL_DLL_I_ SOL_DEFAULT_OFF #endif // DLL definition #if defined(SOL_HEADER_ONLY) #if (SOL_HEADER_ONLY != 0) #define SOL_HEADER_ONLY_I_ SOL_ON #else #define SOL_HEADER_ONLY_I_ SOL_OFF #endif #else #define SOL_HEADER_ONLY_I_ SOL_DEFAULT_OFF #endif // Header only library #if defined(SOL_BUILD) #if (SOL_BUILD != 0) #define SOL_BUILD_I_ SOL_ON #else #define SOL_BUILD_I_ SOL_OFF #endif #elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_BUILD_I_ SOL_DEFAULT_OFF #else #define SOL_BUILD_I_ SOL_DEFAULT_ON #endif #if defined(SOL_UNITY_BUILD) #if (SOL_UNITY_BUILD != 0) #define SOL_UNITY_BUILD_I_ SOL_ON #else #define SOL_UNITY_BUILD_I_ SOL_OFF #endif #else #define SOL_UNITY_BUILD_I_ SOL_DEFAULT_OFF #endif // Header only library #if defined(SOL_C_FUNCTION_LINKAGE) #define SOL_C_FUNCTION_LINKAGE_I_ SOL_C_FUNCTION_LINKAGE #else #if SOL_IS_ON(SOL_BUILD_CXX_MODE) // C++ #define SOL_C_FUNCTION_LINKAGE_I_ extern "C" #else // normal #define SOL_C_FUNCTION_LINKAGE_I_ #endif // C++ or not #endif // Linkage specification for C functions #if defined(SOL_API_LINKAGE) #define SOL_API_LINKAGE_I_ SOL_API_LINKAGE #else #if SOL_IS_ON(SOL_DLL) #if SOL_IS_ON(SOL_COMPILER_VCXX) || SOL_IS_ON(SOL_PLATFORM_WINDOWS) || SOL_IS_ON(SOL_PLATFORM_CYGWIN) // MSVC Compiler; or, Windows, or Cygwin platforms #if SOL_IS_ON(SOL_BUILD) // Building the library #if SOL_IS_ON(SOL_COMPILER_GCC) // Using GCC #define SOL_API_LINKAGE_I_ __attribute__((dllexport)) #else // Using Clang, MSVC, etc... #define SOL_API_LINKAGE_I_ __declspec(dllexport) #endif #else #if SOL_IS_ON(SOL_COMPILER_GCC) #define SOL_API_LINKAGE_I_ __attribute__((dllimport)) #else #define SOL_API_LINKAGE_I_ __declspec(dllimport) #endif #endif #else // extern if building normally on non-MSVC #define SOL_API_LINKAGE_I_ extern #endif #elif SOL_IS_ON(SOL_UNITY_BUILD) // Built-in library, like how stb typical works #if SOL_IS_ON(SOL_HEADER_ONLY) // Header only, so functions are defined "inline" #define SOL_API_LINKAGE_I_ inline #else // Not header only, so seperately compiled files #define SOL_API_LINKAGE_I_ extern #endif #else // Normal static library #if SOL_IS_ON(SOL_BUILD_CXX_MODE) #define SOL_API_LINKAGE_I_ #else #define SOL_API_LINKAGE_I_ extern #endif #endif // DLL or not #endif // Build definitions #if defined(SOL_PUBLIC_FUNC_DECL) #define SOL_PUBLIC_FUNC_DECL_I_ SOL_PUBLIC_FUNC_DECL #else #define SOL_PUBLIC_FUNC_DECL_I_ SOL_API_LINKAGE_I_ #endif #if defined(SOL_INTERNAL_FUNC_DECL_) #define SOL_INTERNAL_FUNC_DECL_I_ SOL_INTERNAL_FUNC_DECL_ #else #define SOL_INTERNAL_FUNC_DECL_I_ SOL_API_LINKAGE_I_ #endif #if defined(SOL_PUBLIC_FUNC_DEF) #define SOL_PUBLIC_FUNC_DEF_I_ SOL_PUBLIC_FUNC_DEF #else #define SOL_PUBLIC_FUNC_DEF_I_ SOL_API_LINKAGE_I_ #endif #if defined(SOL_INTERNAL_FUNC_DEF) #define SOL_INTERNAL_FUNC_DEF_I_ SOL_INTERNAL_FUNC_DEF #else #define SOL_INTERNAL_FUNC_DEF_I_ SOL_API_LINKAGE_I_ #endif #if defined(SOL_FUNC_DECL) #define SOL_FUNC_DECL_I_ SOL_FUNC_DECL #elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_FUNC_DECL_I_ #elif SOL_IS_ON(SOL_DLL) #if SOL_IS_ON(SOL_COMPILER_VCXX) #if SOL_IS_ON(SOL_BUILD) #define SOL_FUNC_DECL_I_ extern __declspec(dllexport) #else #define SOL_FUNC_DECL_I_ extern __declspec(dllimport) #endif #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_FUNC_DECL_I_ extern __attribute__((visibility("default"))) #else #define SOL_FUNC_DECL_I_ extern #endif #endif #if defined(SOL_FUNC_DEFN) #define SOL_FUNC_DEFN_I_ SOL_FUNC_DEFN #elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_FUNC_DEFN_I_ inline #elif SOL_IS_ON(SOL_DLL) #if SOL_IS_ON(SOL_COMPILER_VCXX) #if SOL_IS_ON(SOL_BUILD) #define SOL_FUNC_DEFN_I_ __declspec(dllexport) #else #define SOL_FUNC_DEFN_I_ __declspec(dllimport) #endif #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_FUNC_DEFN_I_ __attribute__((visibility("default"))) #else #define SOL_FUNC_DEFN_I_ #endif #endif #if defined(SOL_HIDDEN_FUNC_DECL) #define SOL_HIDDEN_FUNC_DECL_I_ SOL_HIDDEN_FUNC_DECL #elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_HIDDEN_FUNC_DECL_I_ #elif SOL_IS_ON(SOL_DLL) #if SOL_IS_ON(SOL_COMPILER_VCXX) #if SOL_IS_ON(SOL_BUILD) #define SOL_HIDDEN_FUNC_DECL_I_ extern __declspec(dllexport) #else #define SOL_HIDDEN_FUNC_DECL_I_ extern __declspec(dllimport) #endif #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_HIDDEN_FUNC_DECL_I_ extern __attribute__((visibility("default"))) #else #define SOL_HIDDEN_FUNC_DECL_I_ extern #endif #endif #if defined(SOL_HIDDEN_FUNC_DEFN) #define SOL_HIDDEN_FUNC_DEFN_I_ SOL_HIDDEN_FUNC_DEFN #elif SOL_IS_ON(SOL_HEADER_ONLY) #define SOL_HIDDEN_FUNC_DEFN_I_ inline #elif SOL_IS_ON(SOL_DLL) #if SOL_IS_ON(SOL_COMPILER_VCXX) #if SOL_IS_ON(SOL_BUILD) #define SOL_HIDDEN_FUNC_DEFN_I_ #else #define SOL_HIDDEN_FUNC_DEFN_I_ #endif #elif SOL_IS_ON(SOL_COMPILER_GCC) || SOL_IS_ON(SOL_COMPILER_CLANG) #define SOL_HIDDEN_FUNC_DEFN_I_ __attribute__((visibility("hidden"))) #else #define SOL_HIDDEN_FUNC_DEFN_I_ #endif #endif // end of sol/detail/build_version.hpp // end of sol/version.hpp #include <utility> #include <type_traits> #include <string_view> #if SOL_IS_ON(SOL_USE_CXX_LUA) || SOL_IS_ON(SOL_USE_CXX_LUAJIT) struct lua_State; #else extern "C" { struct lua_State; } #endif // C++ Mangling for Lua vs. Not namespace sol { enum class type; class stateless_reference; template <bool b> class basic_reference; using reference = basic_reference<false>; using main_reference = basic_reference<true>; class stateless_stack_reference; class stack_reference; template <typename A> class basic_bytecode; struct lua_value; struct proxy_base_tag; template <typename> struct proxy_base; template <typename, typename> struct table_proxy; template <bool, typename> class basic_table_core; template <bool b> using table_core = basic_table_core<b, reference>; template <bool b> using main_table_core = basic_table_core<b, main_reference>; template <bool b> using stack_table_core = basic_table_core<b, stack_reference>; template <typename base_type> using basic_table = basic_table_core<false, base_type>; using table = table_core<false>; using global_table = table_core<true>; using main_table = main_table_core<false>; using main_global_table = main_table_core<true>; using stack_table = stack_table_core<false>; using stack_global_table = stack_table_core<true>; template <typename> struct basic_lua_table; using lua_table = basic_lua_table<reference>; using stack_lua_table = basic_lua_table<stack_reference>; template <typename T, typename base_type> class basic_usertype; template <typename T> using usertype = basic_usertype<T, reference>; template <typename T> using stack_usertype = basic_usertype<T, stack_reference>; template <typename base_type> class basic_metatable; using metatable = basic_metatable<reference>; using stack_metatable = basic_metatable<stack_reference>; template <typename base_t> struct basic_environment; using environment = basic_environment<reference>; using main_environment = basic_environment<main_reference>; using stack_environment = basic_environment<stack_reference>; template <typename T, bool> class basic_function; template <typename T, bool, typename H> class basic_protected_function; using unsafe_function = basic_function<reference, false>; using safe_function = basic_protected_function<reference, false, reference>; using main_unsafe_function = basic_function<main_reference, false>; using main_safe_function = basic_protected_function<main_reference, false, reference>; using stack_unsafe_function = basic_function<stack_reference, false>; using stack_safe_function = basic_protected_function<stack_reference, false, reference>; using stack_aligned_unsafe_function = basic_function<stack_reference, true>; using stack_aligned_safe_function = basic_protected_function<stack_reference, true, reference>; using protected_function = safe_function; using main_protected_function = main_safe_function; using stack_protected_function = stack_safe_function; using stack_aligned_protected_function = stack_aligned_safe_function; #if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS) using function = protected_function; using main_function = main_protected_function; using stack_function = stack_protected_function; using stack_aligned_function = stack_aligned_safe_function; #else using function = unsafe_function; using main_function = main_unsafe_function; using stack_function = stack_unsafe_function; using stack_aligned_function = stack_aligned_unsafe_function; #endif using stack_aligned_stack_handler_function = basic_protected_function<stack_reference, true, stack_reference>; struct unsafe_function_result; struct protected_function_result; using safe_function_result = protected_function_result; #if SOL_IS_ON(SOL_SAFE_FUNCTION_OBJECTS) using function_result = safe_function_result; #else using function_result = unsafe_function_result; #endif template <typename base_t> class basic_object_base; template <typename base_t> class basic_object; template <typename base_t> class basic_userdata; template <typename base_t> class basic_lightuserdata; template <typename base_t> class basic_coroutine; template <typename base_t> class basic_packaged_coroutine; template <typename base_t> class basic_thread; using object = basic_object<reference>; using userdata = basic_userdata<reference>; using lightuserdata = basic_lightuserdata<reference>; using thread = basic_thread<reference>; using coroutine = basic_coroutine<reference>; using packaged_coroutine = basic_packaged_coroutine<reference>; using main_object = basic_object<main_reference>; using main_userdata = basic_userdata<main_reference>; using main_lightuserdata = basic_lightuserdata<main_reference>; using main_coroutine = basic_coroutine<main_reference>; using stack_object = basic_object<stack_reference>; using stack_userdata = basic_userdata<stack_reference>; using stack_lightuserdata = basic_lightuserdata<stack_reference>; using stack_thread = basic_thread<stack_reference>; using stack_coroutine = basic_coroutine<stack_reference>; struct stack_proxy_base; struct stack_proxy; struct variadic_args; struct variadic_results; struct stack_count; struct this_state; struct this_main_state; struct this_environment; class state_view; class state; template <typename T> struct as_table_t; template <typename T> struct as_container_t; template <typename T> struct nested; template <typename T> struct light; template <typename T> struct user; template <typename T> struct as_args_t; template <typename T> struct protect_t; template <typename F, typename... Policies> struct policy_wrapper; template <typename T> struct usertype_traits; template <typename T> struct unique_usertype_traits; template <typename... Args> struct types { typedef std::make_index_sequence<sizeof...(Args)> indices; static constexpr std::size_t size() { return sizeof...(Args); } }; template <typename T> struct derive : std::false_type { typedef types<> type; }; template <typename T> struct base : std::false_type { typedef types<> type; }; template <typename T> struct weak_derive { static bool value; }; template <typename T> bool weak_derive<T>::value = false; namespace stack { struct record; } #if SOL_IS_OFF(SOL_USE_BOOST) template <class T> class optional; template <class T> class optional<T&>; #endif using check_handler_type = int(lua_State*, int, type, type, const char*); } // namespace sol #define SOL_BASE_CLASSES(T, ...) \ namespace sol { \ template <> \ struct base<T> : std::true_type { \ typedef ::sol::types<__VA_ARGS__> type; \ }; \ } \ void a_sol3_detail_function_decl_please_no_collide() #define SOL_DERIVED_CLASSES(T, ...) \ namespace sol { \ template <> \ struct derive<T> : std::true_type { \ typedef ::sol::types<__VA_ARGS__> type; \ }; \ } \ void a_sol3_detail_function_decl_please_no_collide() #endif // SOL_FORWARD_HPP // end of sol/forward.hpp #endif // SOL_SINGLE_INCLUDE_FORWARD_HPP
[ "guillaume_k@hotmail.fr" ]
guillaume_k@hotmail.fr
0a8cf629b423b5fb91e4a0d566740fed2a2aeca5
22d5d10c1f67efe97b8854760b7934d8e16d269b
/LeetCodeCPP/283. Move Zeroes/main.cpp
0d7db037d5f4149a4afd8f62fc20c6267ab70a22
[ "Apache-2.0" ]
permissive
18600130137/leetcode
42241ece7fce1536255d427a87897015b26fd16d
fd2dc72c0b85da50269732f0fcf91326c4787d3a
refs/heads/master
2020-04-24T01:48:03.049019
2019-10-17T06:02:57
2019-10-17T06:02:57
171,612,908
1
0
null
null
null
null
UTF-8
C++
false
false
1,400
cpp
// // main.cpp // 283. Move Zeroes // // Created by admin on 2019/7/5. // Copyright © 2019年 liu. All rights reserved. // #include <iostream> #include <vector> using namespace std; class Solution { public: void moveZeroes2(vector<int>& nums) { int m=nums.size(); int i=m-1; while(i>=0 && nums[i]==0){ i--; } for(;i>=0;i--){ if(nums[i]==0){ nums.erase(nums.begin()+i); nums.push_back(0); } } } void moveZeroes1(vector<int>& nums) { int m=nums.size(); int count0=0; for(int i=0;i<m;i++){ if(nums[i]==0){ count0++; } } nums.erase(remove(nums.begin(),nums.end(),0),nums.end()); for(int i=0;i<count0;i++){ nums.push_back(0); } } void moveZeroes(vector<int>& nums) { int m=nums.size(); int insertPos=0; for(int i=0;i<m;i++){ if(nums[i]!=0){ nums[insertPos++]=nums[i]; } } while(insertPos<m){ nums[insertPos++]=0; } } }; int main(int argc, const char * argv[]) { vector<int> input={0,1,0,3,12}; Solution so=Solution(); so.moveZeroes(input); for(auto i:input){ cout<<i<<" "; } cout<<endl; return 0; }
[ "guodongliu6@crediteses.cn" ]
guodongliu6@crediteses.cn
b63c02aab9a03a9d47f2c6241ed62216d796b8e7
eb663d5c73c9d74f0b5de618cdb0579587e86928
/test/src/Parameters_test.cpp
d4a673fef6ded3bc6aebdc99d266959f17560d47
[ "MIT" ]
permissive
andrsd/godzilla
e849bf5b66966d017437a2af5cf0dcc11cf543f9
296a10b39603a22a54053b009b3cb1c0b24d2008
refs/heads/main
2023-09-03T20:23:06.445778
2023-08-30T20:23:37
2023-08-30T20:23:37
123,453,473
5
0
MIT
2023-09-06T18:36:27
2018-03-01T15:27:17
C++
UTF-8
C++
false
false
2,158
cpp
#include "gtest/gtest.h" #include "Types.h" #include "Parameters.h" #include "Factory.h" using namespace godzilla; TEST(ParametersTest, get) { Parameters params = Object::parameters(); EXPECT_DEATH(params.get<int>("i"), "No parameter 'i' found."); } TEST(ParametersTest, param_value) { Parameters params; params.add_param<Real>("param", 12.34, "doco"); EXPECT_EQ(params.get<Real>("param"), 12.34); EXPECT_EQ(params.get_doc_string("param"), std::string("doco")); } TEST(ParametersTest, has_value) { Parameters params; params.add_param<Real>("param", 12.34, "doco"); EXPECT_EQ(params.has<Real>("param"), true); params.clear(); EXPECT_EQ(params.has<Real>("param"), false); } TEST(ParametersTest, assign) { Parameters params1; params1.add_param<Real>("param", 12.34, "doco"); Parameters params2 = params1; EXPECT_EQ(params2.has<Real>("param"), true); EXPECT_EQ(params2.get<Real>("param"), 12.34); EXPECT_EQ(params2.get_doc_string("param"), std::string("doco")); } TEST(ParametersTest, add_params) { Parameters params1; params1.add_param<Real>("p1", 12.34, "doco1"); Parameters params2; params1.add_param<Real>("p2", "doco2"); params1 += params2; EXPECT_EQ(params1.has<Real>("p1"), true); EXPECT_EQ(params1.get<Real>("p1"), 12.34); EXPECT_EQ(params1.get_doc_string("p1"), std::string("doco1")); EXPECT_EQ(params1.has<Real>("p2"), true); EXPECT_EQ(params1.get_doc_string("p2"), std::string("doco2")); } Parameters validParams1() { Parameters params; params.add_param<Real>("p", 78.56, "doco p"); return params; } TEST(ParametersTest, valid_params) { Parameters params1 = validParams1(); EXPECT_EQ(params1.get<Real>("p"), 78.56); EXPECT_EQ(params1.get_doc_string("p"), std::string("doco p")); } TEST(ParametersTest, empty_doc_str) { Parameters params = Object::parameters(); EXPECT_EQ(params.get_doc_string("i"), std::string("")); } TEST(ParametersTest, set_non_existing_param) { Parameters params = Object::parameters(); params.set<double>("d") = 1.23; EXPECT_EQ(params.get<double>("d"), 1.23); }
[ "andrsd@gmail.com" ]
andrsd@gmail.com
7f66f3905b062167952f1d32c9138f0f2ffdd969
536c3a571b3056b71fa7156d0a2237b9332317ac
/source/PKB.cpp
daaf35571d25778b13cacc880e8a856dc0599e82
[]
no_license
CS3201-2/EmptyGeneralTesting
896f4f291eeae8fffa26648e0d592bc8c605ba65
3cdb8de54dc324d22fa8cf118d1b7f2b97d85a55
refs/heads/master
2016-09-06T08:15:26.731713
2015-09-18T14:11:07
2015-09-18T14:11:07
42,574,020
0
0
null
null
null
null
UTF-8
C++
false
false
1,024
cpp
#include "PKB.h" #include "AST.h" #include "Modifies.h" #include "Uses.h" #include "ProcTable.h" #include "VarTable.h" #include <string> #include <list> using namespace std; PKB::PKB() { } ProcTable& PKB::getProcTable(void) { return procTable; } VarTable& PKB::getVarTable(void) { return varTable; } Modifies& PKB::getModifies(void) { return modifies; } Uses& PKB::getUses(void) { return uses; } Follows& PKB::getFollows(void) { return follows; } Parent& PKB::getParent(void) { return parent; } AST& PKB::getAST(void) { return ast; } void PKB::addWhileList(int stmtLine) { if (find(whileList.begin(), whileList.end(), stmtLine) == whileList.end()) { whileList.push_back(stmtLine); } } void PKB::addAssignList(int stmtLine) { if (find(assignList.begin(), assignList.end(), stmtLine) == assignList.end()) { assignList.push_back(stmtLine); } } list<int> PKB::getWhileList(void) { return whileList; } list<int> PKB::getAssignList(void) { return assignList; } void PKB::setAST(AST a) { ast = a; }
[ "manika615@gmail.com" ]
manika615@gmail.com
617f5a2954bbdd65ab617dd645eb53f7d306ea36
e363b63383c617acc55c5b43bd0fa524d9e64dff
/game/client/swarm/asw_client_entities.cpp
03159252021e5c19ee06b70c2036b5a1936d67e7
[]
no_license
paralin/hl2sdk-dota
63a17b641e2cc9d6d030df9244c03d60e013737d
e0fe36f0132b36ba9b1ca56aa10f888f66e9b2bf
refs/heads/master
2016-09-09T22:37:57.509357
2014-04-09T13:26:01
2014-04-09T13:26:01
18,719,255
4
2
null
null
null
null
WINDOWS-1252
C++
false
false
950
cpp
//===== Copyright © 1996-2005, Valve Corporation, All rights reserved. ======// // // Purpose : Singleton manager for color correction on the client // // $NoKeywords: $ //===========================================================================// #include "cbase.h" #include "tier0/vprof.h" #include "asw_client_entities.h" #include "c_asw_camera_volume.h" #include "c_asw_snow_volume.h" #include "c_asw_scanner_noise.h" static CASW_Client_Entities s_ASW_Client_Entities; CASW_Client_Entities::CASW_Client_Entities() { } void CASW_Client_Entities::LevelInitPostEntity() { //C_ASW_Camera_Volume::RecreateAll(); C_ASW_Snow_Volume::RecreateAll(); //C_Sprite::RecreateAll(); C_ASW_Scanner_Noise::RecreateAll(); } void CASW_Client_Entities::LevelShutdownPreEntity() { //C_ASW_Camera_Volume::DestroyAll(); C_ASW_Snow_Volume::DestroyAll(); //C_Sprite::DestroyAll(); C_ASW_Scanner_Noise::DestroyAll(); }
[ "ds@alliedmods.net" ]
ds@alliedmods.net
67d4b9692e929bf7f0fe380cc848438a30948ce1
d6720f9cb13c0233b76bc8a81717a83b40ae9830
/open/eMule/eMule/src/SharedFilesCtrl.h
867b39cdc4413bc8b4aae5777b0a5d0257be8f53
[]
no_license
EchoLiao/nalstudy
e4565aadf80ff70388225c4c92eb9bb22d85f384
869288a16e540520cadc28c82702e52f1c8396ac
refs/heads/master
2016-09-05T12:38:06.721690
2013-06-05T08:47:01
2013-06-05T08:47:01
33,391,633
0
0
null
null
null
null
GB18030
C++
false
false
3,098
h
//this file is part of eMule //Copyright (C)2002-2006 Merkur ( strEmail.Format("%s@%s", "devteam", "emule-project.net") / http://www.emule-project.net ) // //This program is free software; you can redistribute it and/or //modify it under the terms of the GNU General Public License //as published by the Free Software Foundation; either //version 2 of the License, or (at your option) any later version. // //This program is distributed in the hope that it will be useful, //but WITHOUT ANY WARRANTY; without even the implied warranty of //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //GNU General Public License for more details. // //You should have received a copy of the GNU General Public License //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. #pragma once #include "MuleListCtrl.h" #include "TitleMenu.h" #include "ListCtrlItemWalk.h" #include "JavaScriptEscape.h" //Added by thilon on 206.08.28, 在线杀毒 class CSharedFileList; class CKnownFile; class CShareableFile; class CDirectoryItem; class CSharedFilesCtrl : public CMuleListCtrl, public CListCtrlItemWalk { friend class CSharedDirsTreeCtrl; DECLARE_DYNAMIC(CSharedFilesCtrl) public: CSharedFilesCtrl(); virtual ~CSharedFilesCtrl(); void Init(); void CreateMenues(); void ReloadFileList(); void AddFile(const CShareableFile* file); void RemoveFile(const CShareableFile* file, bool bDeletedFromDisk); void UpdateFile(const CShareableFile* file, bool bUpdateFileSummary = true); void Localize(); void ShowFilesCount(); void ShowComments(CShareableFile* file); void SetAICHHashing(uint32 nVal) { nAICHHashing = nVal; } void SetDirectoryFilter(CDirectoryItem* pNewFilter, bool bRefresh = true); protected: CTitleMenu m_SharedFilesMenu; CTitleMenu m_CollectionsMenu; CMenu m_PrioMenu; bool sortstat[4]; CImageList m_ImageList; CDirectoryItem* m_pDirectoryFilter; volatile uint32 nAICHHashing; JavaScriptEscape m_JavaScriptEscape; static int CALLBACK SortProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); void OpenFile(const CShareableFile* file); void ShowFileDialog(CTypedPtrList<CPtrList, CShareableFile*>& aFiles, UINT uPshInvokePage = 0); void SetAllIcons(); int FindFile(const CShareableFile* pFile); virtual BOOL OnCommand(WPARAM wParam, LPARAM lParam); virtual void DrawItem(LPDRAWITEMSTRUCT lpDrawItemStruct); DECLARE_MESSAGE_MAP() afx_msg void OnSysColorChange(); afx_msg void OnColumnClick( NMHDR* pNMHDR, LRESULT* pResult); afx_msg void OnContextMenu(CWnd* pWnd, CPoint point); afx_msg void OnNMDblclk(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnGetDispInfo(NMHDR *pNMHDR, LRESULT *pResult); afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags); //VeryCD Start //共享文件列表中的评论,added by Chocobo on 2006.09.01 afx_msg void OnCommentClick(NMHDR *pNMHDR, LRESULT *pResult); public: afx_msg void OnMouseMove(UINT nFlags, CPoint point); //VeryCD End };
[ "nuoerlz@da13e6bb-9c2c-a04c-5f4c-2d7d41371f5f" ]
nuoerlz@da13e6bb-9c2c-a04c-5f4c-2d7d41371f5f
7bf7081bf125a115ba0b367aaa1da675ae7c0313
8635b190093341b7e26b9c81628b36d52f35fb9d
/client/Reaper-Client/GetIP/GetIP.cpp
61929e6049b69e0f5ee24b2311b5110aa4f9657a
[ "WTFPL" ]
permissive
brianSchanbacher/reaper
4022bf5fc0e4b5de203af4a1c74f88667072a331
b429730d93ab27c9c2e2e4e44d4ebeed13a34a54
refs/heads/master
2021-09-13T03:15:51.794651
2018-04-24T12:06:31
2018-04-24T12:06:31
126,014,820
1
0
null
null
null
null
UTF-8
C++
false
false
1,221
cpp
#include "stdafx.h" #define _CRT_SECURE_NO_WARNINGS #define _WINSOCK_DEPRECATED_NO_WARNINGS #include <Windows.h> #include <WinSock2.h> #include <iphlpapi.h> #include <stdio.h> #include <malloc.h> #include <stdlib.h> #include <malloc.h> #include "GetIP.h" struct IPv4 { unsigned char b1, b2, b3, b4; }; char* GetIP(void) { struct IPv4 myIP; char szBuffer[1024]; #ifdef WIN32 WSADATA wsaData; WORD wVersionRequested = MAKEWORD(2, 0); if (::WSAStartup(wVersionRequested, &wsaData) != 0) return false; #endif if (gethostname(szBuffer, sizeof(szBuffer)) == SOCKET_ERROR) { #ifdef WIN32 WSACleanup(); #endif return false; } struct hostent *host = gethostbyname(szBuffer); if (host == NULL) { #ifdef WIN32 WSACleanup(); #endif return false; } //Obtain the computer's IP myIP.b1 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b1; myIP.b2 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b2; myIP.b3 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b3; myIP.b4 = ((struct in_addr *)(host->h_addr))->S_un.S_un_b.s_b4; #ifdef WIN32 WSACleanup(); #endif char* retval = (char*)malloc(16); snprintf(retval, 16, "%d.%d.%d.%d", myIP.b1, myIP.b2, myIP.b3, myIP.b4); return retval; }
[ "bcampbell1120@gmail.com" ]
bcampbell1120@gmail.com
de141e4638135bf0ab6be20b781276e47596313d
41b4adb10cc86338d85db6636900168f55e7ff18
/aws-cpp-sdk-ssm/source/model/ListCommandInvocationsResult.cpp
ef4d4067e166758cc2c069d4721976d0056f1a32
[ "JSON", "MIT", "Apache-2.0" ]
permissive
totalkyos/AWS
1c9ac30206ef6cf8ca38d2c3d1496fa9c15e5e80
7cb444814e938f3df59530ea4ebe8e19b9418793
refs/heads/master
2021-01-20T20:42:09.978428
2016-07-16T00:03:49
2016-07-16T00:03:49
63,465,708
1
1
null
null
null
null
UTF-8
C++
false
false
1,803
cpp
/* * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ #include <aws/ssm/model/ListCommandInvocationsResult.h> #include <aws/core/utils/json/JsonSerializer.h> #include <aws/core/AmazonWebServiceResult.h> #include <aws/core/utils/UnreferencedParam.h> #include <utility> using namespace Aws::SSM::Model; using namespace Aws::Utils::Json; using namespace Aws::Utils; using namespace Aws; ListCommandInvocationsResult::ListCommandInvocationsResult() { } ListCommandInvocationsResult::ListCommandInvocationsResult(const AmazonWebServiceResult<JsonValue>& result) { *this = result; } ListCommandInvocationsResult& ListCommandInvocationsResult::operator =(const AmazonWebServiceResult<JsonValue>& result) { const JsonValue& jsonValue = result.GetPayload(); if(jsonValue.ValueExists("CommandInvocations")) { Array<JsonValue> commandInvocationsJsonList = jsonValue.GetArray("CommandInvocations"); for(unsigned commandInvocationsIndex = 0; commandInvocationsIndex < commandInvocationsJsonList.GetLength(); ++commandInvocationsIndex) { m_commandInvocations.push_back(commandInvocationsJsonList[commandInvocationsIndex].AsObject()); } } if(jsonValue.ValueExists("NextToken")) { m_nextToken = jsonValue.GetString("NextToken"); } return *this; }
[ "henso@amazon.com" ]
henso@amazon.com
9d520ef9f85ccf0cff52a98ddf4280d0fd12d944
2e8b90c136a0c97e1176e11a1297272b9becd78f
/iqapi.h
8042d505d79d5f5f0eb9a0d20a38e027847385db
[]
no_license
thiru-libre/LibreRoot
80819645eafd5d65ed6fc1ede5d60db4dde77233
512c6dcdbb1b06bf3816528a1d26269864482a2d
refs/heads/master
2020-06-05T14:26:46.020977
2014-01-30T07:57:13
2014-01-30T07:57:13
null
0
0
null
null
null
null
WINDOWS-1250
C++
false
false
124,626
h
/*! \file iqapi.h */ #pragma once //#define IQAPI_EXPORTS // **************************************************************** // Version Information // **************************************************************** #define IQAPI_VERSION "1.7.48" #define IQAPI_RELEASE_DATE "(Dec 9, 2009)" // **************************************************************** // DLL Import / Export Defines // **************************************************************** #ifdef IQAPI_EXPORTS #define IQ_API __declspec(dllexport) #else #define IQ_API __declspec(dllimport) #endif // **************************************************************** // Internal Header files // **************************************************************** #ifdef IQAPI_USE_INTERNAL_FILES // #include "iqapi_lp_private.h" #include "A21Control.h" #endif // **************************************************************** // Include Files // **************************************************************** #include <windows.h> #include <stdlib.h> #pragma warning( disable : 4251 ) #include "iqapiDefines.h" #include "iqapiHndlBase.h" #include "iqapiHndlMatlab.h" #include "DualHeadBase.h" enum WHAT_VERSION_TO_CHECK { IQV_LEGACY_VERSION_ONLY // Check version for WIFI/BT/WiMax }; class IQ_API CA21Control; //#include "iqapiExternalDevices.h" // **************************************************************** // Internal define statement // **************************************************************** #define SERIAL_NUMBER_LEN 8 #define NUMBER_OF_FREQ_BAND 8 // **************************************************************** // Global Function Declarations // **************************************************************** //! Poly Fit IQ_API int iqapiGetPolyFitMax(int order, int numElements, double xValues[], double yValues[], double *maxXValue, double *maxYValue); //! Initializes API libraries /*! Initializes the API libraries and Matlab Run Time. Call this function once(and only once) before any other application that uses this API is called. */ IQ_API int iqapiInit(void); //! Terminates API libraries /*! Terminates the API libraries and Matlab Runtime. Call this function once (and only once) after each application that uses the API is run. */ IQ_API int iqapiTerm(void); //! Clear connection status, etc. /*! Causes the API to clear the current state of all IQapi connections. Call this function if you have to call the \c ConInit function for more than once in an application. You must call this function before you call the \c ConInit function for the second time. */ IQ_API int iqapiClearAll(void); //! Plot Data /*! Plots data in a Matlab Figure window. The function takes the following inputs: \param figNum Indicates the non-zero figure number. If the figure number does not exist, it will be created. \param x Indicates the pointer to the data for the x-axis. This value can be set to NULL. If this value is set to NULL, then x will be the index of y. \param y Indicates the pointer to the data for the y-axis. This value cannot be set to NULL. \param length Indicates the length of the data to which the y axis points to. This value also indicates the length of data to which the x axis points to, if the value of x is not NULL. \param title Indicates the NULL-terminated char string that points to the name of the plot. \param xtitle Indicates the NULL-terminated char string that points to the name on the x-axis of the plot. \param ytitle Indicates the NULL-terminated char string that points to the name on the y-axis of the plot. \param plotArgs Indicates the NULL-terminated char string that is created from an element comprised of any or all of the data contained in each of the following three columns, and has a value of NULL for default options: b blue \n g green \n r red \n c cyan \n m magenta \n y yellow \n k black \n . point \n o circle \n x x-mark \n + plus \n * star \n s square \n d diamond \n v triangle (down) \n ^ triangle (up) \n < triangle (left) \n > triangle (right) \n p pentagram \n h hexagram \n - solid \n : dotted \n -. dashdot \n -- dashed \n \param keepPlot It can be 0 or 1. \n For keepPlot =0, it will erase the previous plot before plotting the new data. \n For keepPlot =1, it will plot the new data on the same plot as the previous plot. \n */ IQ_API int iqapiPlot(int figNum, double *x, double *y, int length, char *plotArgs, char *title, char *xtitle, char *ytitle, int keepPlot=0); //! Get Version Information /*! Retrieves version information for various parts of the API. This function copies a maximum of \c nMaxChars into the buffer that the \c versionStr parameter points to. */ IQ_API int iqapiVersion(char *versionStr, int nMaxChars); // **************************************************************** // API Classes // **************************************************************** // //// **************************************************************** //// Modulation Wave Class //// **************************************************************** // ////! Specifies the analysis parameters for modulation wave. ///*! If a call to the \c hndl->GenerateWave() function is successful, the \c hndl->wave parameter will point to an \c iqapiModulationWave object which is used in a call to the \c hndl->SetWave() object. //*/ // //class IQ_API iqapiModulationWave //{ //public: // iqapiModulationWave(void); //!< Constructor // ~iqapiModulationWave(void); //!< Destructor // // int length[N_MAX_TESTERS]; //!< Integer array that represents the length of the \a real and \a imag vectors, with one integer for each VSA in the test systems. // // /*!< \c Length[0] indicates the length of \c real[0] and \c imag[0] vectors, which is the sample data returned from the first VSA (0). // */ // // double *real[N_MAX_TESTERS]; //!< Double pointer array that represents the (real) sample data captured on each VSA. // // /*!<The length of \c real[x] is indicated by \c length[x], where x is the VSA number minus one. For example, the test system 1 uses a value of \c real[0], test system 2 uses a value of \c real[1] etc. // */ // // double *imag[N_MAX_TESTERS]; //!< Double pointer array that represents the (imaginary) sample data captured on each VSA. // // /*!< The length of \c imag[x] is indicated by \c length[x], where x is the VSA number minus one. For example, the test system 1 uses a value of \c imag[0], test system 2 uses a value of \c imag[1] etc. // */ // // double sampleFreqHz[N_MAX_TESTERS]; //!< Double pointer array that represents the sample frequency of \c real and \c imag data. // // /*!<\c sampleFreqHz[x] is the sampling rate of \c real[x] and \c imag[x], where x is the VSA number minus one. For example, the test system 1 uses a value of \c sampleFreqHz[0], test system 2 uses a value of \c sampleFreqHz[1] etc. // */ // // char lastErr[MAX_LEN_ERR_TXT]; //!< Char array (\c hndl->wave->lastErr) that contains an error message if a call to the \c hndl->GenerateWave function fails. // // // //! A copy constructor that can be used to make a deep copy of an \c iqapiModulationWave object. // /*! Use this constructor when you wish to create a copy of an \c iqapiModulationWave object. // */ // iqapiModulationWave(const iqapiModulationWave &src); // // int Save(char *fileName); //!< Saves an \c iqapiModulationWave object to a \c .mod file(set by filename), which can be downloaded to a VSG via this API, or by the VSG panel in the IQsignal for MIMO application. // // /*!< This function returns 0 (\c IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). // */ // //}; //! Specifies the analysis parameters for modulation multi-wave class IQ_API iqapiModulationMultiWave : public iqapiModulationWave { public: iqapiModulationMultiWave() {compensationSinc = IQV_COMPENSATION_SINC; } ; ~iqapiModulationMultiWave() {}; char waveName[256]; // optional: define the name of the wave IQV_MULTI_WAVE_COMPENSATION_SINC compensationSinc; // default is 1 => do compensation sinc int lengthExtraForPadding; // Extra data length for padding }; // **************************************************************** // Spatial Map Matrix Class // **************************************************************** //!Specifies Spatial Mapping in generation of IEEE 802.11n signals. class IQ_API iqapiSpatialMap { public: iqapiSpatialMap(void); //!< Constructor ~iqapiSpatialMap(void); //!< Destructor int m; //!< Defines NTx int n; //!< Defines NStreams double real[16]; //!< Double pointer array that holds the real values for the Spatial Map Matrix. /*!< Values at indexes 0 through ((m*n)-1) must be set. The real values for the MxN dimensional matrix will be built column-wise from this array, i.e., col 1 first, col 2 next and so on, to col n. */ double imag[16]; //!< Double pointer array that holds the imaginary values for the Spatial Map Matrix. /*!< Values at indexes 0 through ((m*n)-1) must be set. The imaginary values for the MxN dimensional matrix will be built column-wise from this array, i.e., col 1 first, col 2 next and so on, to col n. */ }; // **************************************************************** // Wave Generator Parameters Class // **************************************************************** //! Specifies wave generation configuration parameters to be used during a call to the \c hndl->GenerateWave object. class IQ_API iqapiWaveGenParms { public: iqapiWaveGenParms(void); //!< Constructor. ~iqapiWaveGenParms(void); //!< Destructor. int mcsIndex; //!< Sets modulation and coding scheme. /*!< Defines the modulation (BPSK, 64-QAM etc.) and coding rate (1/2, 5/6 etc.) of the generated signal. The options follow the IEEE 802.11n standards specifications. \n \note Currently, the number of streams allowed is restricted to a maximum of four, and the modulation type is set to a maximum of 64-QAM.*/ int bandwidth; //!< Sets the bandwidth of the generated signal. /*!< The bandwidth values are as follows: \n 0=20 MHz \n 1=40 MHz \n The channel mapping follows the IEEE 802.11 standards specification. */ char *PSDU_mode; //!< Represents PSDU mode. /*!< Values for this field are as follows: \n \c random \n \c userdef \n \c userdef_withcrc \n This field is reserved for future use. */ int PSDU_lengthBytes; //!< Sets the length of payload in bytes double *PSDU_bits; //!< Sets the PSDU value /*!< This field is reserved for future use. */ //! Defines Matrix Q for Spatial Mapping /*! Dimension must be NTx x NStreams.*/ iqapiSpatialMap spatialMapMatr; int soundingPacketHTLTF; //!< Defines the sounding packet. /*!< Valid values are as follows: \n 0: no sounding packet (default) \n 2-4: number of HT-LTFs, if sounding packet is present. */ int aggregation; //!< Defines the aggregation bit in HT-SIG. /*!< This field is reserved for future use. */ int advancedCoding; //!< Defines the advanced coding bit in HT-SIG. /*!< This field is reserved for future use. */ int shortGI; //!< Defines the Short Guard Interval bit in HT-SIG. int legacyLength; //!< Defines the legacy length. /*!<-1: Length in legacy SIG is derived from HT-length. Otherwise, use this value for length field in legacy SIG.*/ short scramblerInit; //!< Defines the scrambler initialization value. /*!< Valid values are as follows: \n -1: Random scrambler init value \n 0 to 127: Scrambler init value */ //! Defines the cyclic shift in nanoseconds. /*! Cyclic shift on Tx chains > 1 (in nanoseconds). */ iqapiMeasurement *cyclicShiftnS; // change from double to iqapiMeasurement * double idleTimeuS; //!< Defines the idle time (filled with zeros) between generation of two packets /*!< Specified in microseconds */ char *type; //!< Defines the type of packet to generate. /*!< Currently, only EWC is supported. */ int greenField; //!< Indicates mode of operation /*!< Valid values are as follows: \n 0=mixed mode packet format; this is the default value \n 1=green field packet format. */ int soundingPacket; //!< Indicates that the packet is to be used for channel sounding /*!< Valid values are as follows: \n 0: no sounding packet; this is the default value \n 1-3: number of Extension HT-LTFs */ char *ofdmWindowType; //!< Indicates type of OFDM windowing /*!< Valid values are as follows; \n If the value is set to \c none, the first and last samples are multiplied by 1/2 \n If the value is set to \c raised cosine, the samples use the raised cosine filter \n If the value is set to \c straight line, the samples use the straight line filter */ int ofdmWindowLengthSamples; //!< Indicates length of the OFDM window /*!< Specified in number of samples (80 MHz) */ int stbc; //!< STBC field in HT-SIG field. /*!< Indicates the difference between the number of space-time streams and spatial streams. \n Valid values are as follows: \n 0=non-stbc \n 1=stbc */ int SetDefault(char *type);//!<Resets the parameters of an \c iqapiWaveGenParms object to default parameters. /*!< This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer object). */ private: int UnpackWaveParam(void *mx_result_in); }; // **************************************************************** // Class to use with reference generation functions // **************************************************************** //! Specifies classes that must be used with reference generation functions. class IQ_API iqapiResultFindPsduDataRef { public: int returnCode; char *message; iqapiResultFindPsduDataRef(void) //!< Constructor { returnCode = -99; // Invalid code message = NULL; } ~iqapiResultFindPsduDataRef(void) //!< Destructor { } }; // **************************************************************** // 802.16 (WiMAX) Analysis Parameters Class (Derived from iqapiAnalysis) // // type = '80216-2004' or '80216e-2005' // mode = '80216-2004' or '80216e-2005'or 'powerPacketDetect' // For powerPacketDetect, it will only measure power with packet detect. quicker to get power measurement with packet detect // // **************************************************************** //! Specifies the analysis parameters for testing devices that are compliant with the IEEE 802.16 standards specification. class IQ_API iqapiAnalysis80216 : public iqapiAnalysis { public: iqapiAnalysis80216(void); //!< Constructor ~iqapiAnalysis80216(void); //!< Destructor //! Specifies the required physical layer parameters for signals compliant with the IEEE 802.16 standards specification. struct PHY_80216 { double sigType; //!< Indicates the type of signal. Default: -1 /*!< Valid values are as follows: \n 1=downlink signal \n 2=uplink signal \n -1=auto-detect */ double bandwidthHz; //!< Indicates signal bandwidth. Default: -1 /*!< Valid values for the signal bandwidth are as follows: -1, 1.25, 1.5, 1.75, 2.5, 3, 3.5, 5, 5.5, 6, 7, 8.75, 10, 11, 12, 14, 15, 20 \n \note -1=auto detect */ double cyclicPrefix; //!< Indicates signal cyclic prefix ratio. Default: -1 /*!< Valid values for signal cyclic prefix ratio are as follows: -1, 1/4, 1/8, 1/16, 1/32 \n \note -1=auto detect */ double rateId; //!< Indicates signal modulation rate. Default: -1 /*!< Valid values for signal modulation rate are as follows: 0, 1, 2, 3, 4, 5, 6 and correspond to {BPSK 1/2, QPSK 1/2, QPSK 3/4, 16-QAM 1/2, 16-QAM 3/4, 64-QAM 2/3, 64-QAM 3/4}, respectively \n \note -1=auto detect */ double numSymbols; //!< Number of OFDM symbols in burst. Default: -1 /*!<-1=auto-detect */ } Phy; //! Specifies parameters for the acquisition of signals compliant with the IEEE 802.16 standards specification. struct ACQ_80216 { IQV_PH_CORR_ENUM phaseCorrect; //!< Specifies the phase tracking mode used for the analysis. Default: IQV_PH_CORR_SYM_BY_SYM /*!< Valid values are as follows: \n 1=Phase tracking off \n 2=Symbol by symbol phase tracking (fast){1, 2, 3} \n 3=10-symbol moving average (slow) (NOT supported currently)} */ IQV_CH_EST_ENUM channelCorrect; //!< Specifies the channel estimation and correction mode. Default: IQV_CH_EST_RAW /*!< Valid values are as follows: \n 1=Channel estimate based on long preamble symbol \n 3=Channel estimate based on whole burst */ IQV_FREQ_SYNC_ENUM freqCorrect; //!< Specifies the frequency offset correction mode. Default: IQV_FREQ_SYNC_LONG_TRAIN /*!< Valid values are as follows: \n 1=Does not perform frequency correction \n 2=performs frequency correction by using both coarse and fine frequency estimates \n 3=performs time-domain correction based on full packet measurement. */ IQV_SYM_TIM_ENUM timingCorrect; //!< Specifies the timing offset correction mode. Default: IQV_SYM_TIM_ON /*!< Valid values are as follows: \n 1=Does not perform timing correction \n 2=Correction for symbol clock offset */ IQV_AMPL_TRACK_ENUM amplitudeTrack; //!< Indicates whether symbol to symbol amplitude tracking is enabled. Default: IQV_AMPL_TRACK_OFF /*!<Valid values are as follows: \n 1=Disabled \n 2=Enabled */ } Acq; //! Specifies decoding parameters for the frame structure of signals compliant with the IEEE 802.16 standards specification. /*! This structure contains fields for setting the BSID, IUC, Frame Number and decode option for 802.16d signals. When decode is set to 1 (indicating that the packet should be fully decoded), the BSID, IUC and Frame Number fields are used, otherwise these fields are ignored. */ struct DEC_80216 { double decode; //!< Indicates whether bursts are decoded. Default: 0 /*!< Valid value are as follows: \n 0=disabled \n 1=enabled */ double bsid[4]; //!< Indicates the base station ID. Default: 0001 /*!< The Base Station ID is necessary to derandomize. Most Significant Bit must be represented first; example: [0111] */ double iuc[4]; //!< Indicates downlink or uplink interval usage code. Default: 0111 /*!< This downlink or uplink interval usage code ID is necessary to derandomize. Most Significant Bit must be represented first; example: [0111] */ double frameNum[4]; //!< Indicates frame number. This ID is necessary to derandomize. Default: 0001 /*!< This frame number ID is necessary to derandomize. Most Significant Bit must be represented first; example: [0111] */ } Dec; // Decoding Parameters... not used in this release. //! Used for non-auto-detect operations /*! Decoding parameters are reserved for future use. */ char *mapConfigFile; //!< Map configuration file /*!< \note For 802.16e analysis, a map configuration file (*.mcf) is required for non-auto-detect operation. Map configuration files can be created using the IQsignal for WiMAX GUI. */ int loggingMode; //!< Indicates the verbosity of the WiMAX analysis. Default: 0 (no logging) /*!<Valid values are as follows: \n 0=no logging \n 1=console (text to screen) logging \n 2=file \n 3=console and file logging \n Default value is 1. */ int masterRxSig; //!< Indicates the Rx signal used for detection/acquisition. Default: 1 (detection) /*!< Specifies which VSA signal should be used for detection/acquisition when analyzing MIMO signals. The default value is 1, which indicates that the signal captured by the first VSA is used. \n When MIMO signals are analyzed, this function specifies which signal must be used as the master signal. \n Valid values are as follows: \n 1=detection \n 2=acquisition. This field is reserved for future use \note The default value is 1 and must not be changed. */ int SetDefault(); private: int Unpack80216Analysis(void *mx_result_in); }; // **************************************************************** // Zigbee Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Zigbee analysis parameters. class IQ_API iqapiAnalysisZigbee : public iqapiAnalysis { public: iqapiAnalysisZigbee( void); //!< Constructor ~iqapiAnalysisZigbee( void); //!< Destructor double sigType; //!< Specifies the signal type. Default: 1 (for OQPSK) /*!< Currently, only the default value of 1 (for OQPSK) is supported. Valid values are as follows: \n IQV_FREQ_SYNC_ENUM=Long Training (Signal type is long preamble) \n IQV_FREQ_SYNC_ENUM=Full Packet (Signal type is full packet) \n IQV_AMPL_TRACK_ENUM This function is reserved for future use. */ IQV_ZIGBEE_PH_CORR_ENUM phaseCorrect; // Symbol by Symbol phase correction. Default: IQV_ZIGBEE_PH_CORR_SYM_BY_SYM (only this choice is available) IQV_ZIGBEE_FREQ_SYNC_ENUM freqCorrect; // frequency synchronization on full data packet. Default: IQV_ZIGBEE_FREQ_SYNC_FULL_PACKET (Only this choice is available) IQV_AMPL_TRACK_ENUM amplitudeTrack; //!< Specifies the Amplitude Tracking mode. Default: IQV_AMPL_TRACK_OFF int SetDefault(); private: int UnpackZigbeeAnalysis(void *mx_result_in); }; // **************************************************************** // Generic multi-use MIMO Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies analysis parameters for signals that are compliant with the IEEE 802.11n standards specification. class IQ_API iqapiAnalysisMimo : public iqapiAnalysis { public: iqapiAnalysisMimo(void); //!< Constructor ~iqapiAnalysisMimo(void); //!< Destructor int enablePhaseCorr; //!< Phase Correlation Default: 1 (phase correction is enabled) /*!<Valid values are as follows: \n 0=phase correction is disabled \n 1=phase correction is enabled */ int enableSymTimingCorr; //!< Symbol Timing Error Default: 1 (symbol timing correction is enabled) /*!<Valid values are as follows: \n 0=symbol timing (symbol clock) correction is disabled \n 1=symbol timing (symbol clock) correction is enabled */ int enableAmplitudeTracking; //!< Amplitude Tracking Default: 0 (amplitude tracking is disabled) /*!<Valid values are as follows: \n 0=amplitude tracking is disabled \n 1=amplitude tracking is enabled */ int frequencyCorr; //!< Frequency Correlation Default: 2 (frequency correction on short and long legacy training fields) /*!<Valid values are as follows: \n 2=frequency correction on short and long legacy training fields \n 3=frequency correction based on full packet \n 4=frequency correction on signal fields (legacy and HT) in addition to short and long training fields */ int decodePSDU; //!< Decode PSDU Default: 1 (decode PSDU) /*!<Valid values are as follows: \n 0=skip decoding of PSDU (sufficient for EVM measurements) \n 1=decode PSDU */ int enableFullPacketChannelEst; //!< Full Packet Channel Estimation Default: 0 (channel estimate on long training fields) /*!<Valid values are as follows: \n 0= channel estimate on long training fields \n 1= reestimate channel on full packet before doing EVM calculation */ int enableMultipathEvm; //!< Enable Multipath EVM for MIMO (IQV_MIMO_ENABLE_MULTIPATH_EVM) Default: 0 (multipath) /*!<Valid values are as follows: \n 0=multipath \n 1=standard */ int useAllSignals; //!< Signals for Stream Analysis Default: 0 (use the first NStreams valid input signals for stream analysis) /*!< \n \note This setting is only relevant if more input signals than streams(*) are available. \n (*) To demodulate a MIMO signal with N streams, at least N different input signals are needed. If \c AnalysisParam.useAllSignals is set to 0 (default), the analysis is based on the first N valid input signals only. The order of preference is determined by the parameter \c Analysis.prefOrderSignals. If \c AnalysisParam.useAllSignals is set to 1, all input signals are used. Valid values are as follows: \n 0=use the first NStreams valid input signals for stream analysis \n 1=use all valid input signals for stream analysis */ int prefOrderSignals[N_MAX_TESTERS]; //!< Preference order used to select input signals if the \c useAllSignals parameter is set to a value of 0. Default: 1,2,3,4 (Use any permutation of the numbers 1,2,3, and 4) /*!< Specifies the sequence of input signals that must be used for analysis. If the number of available input signals (captures) are more than that is required to demodulate a MIMO signal, this parameter allows you to specify the sequence of the input signals that must be used for the analysis. \n \note The number of required captures is equal to the number of data streams in a MIMO signal. Valid values are as follows: \n Default: [1 2 3 4] Use any permutation of the numbers 1,2,3, and 4. \n As an example, when you analyze a one-stream signal with the \c useAllSignals parameter set to 0 and the \c prefOrderSignals parameter set to [2 1 3 4], the analysis first checks the capture from VSA 2 (input signal 2) for a valid signal. If the signal is valid, the analysis will be performed on capture from VSA 1 (input signal 1). If it is not valid, the next signal capture will be performed on capture 1. This process is continued until the required number of valid signals has been found or until all available captures have been checked. In this case, the required number of valid signals is one, because this analysis is on a one-stream signal. */ char *referenceFile; //!< Indicates name of the reference sequential_mimo analysis mode /*!< Valid values are as follows: \n \c composite \n \c sequential_mimo \n This parameter is ignored for NxN systems. */ int SetDefault(); //! Specifies fields for performing a MIMO analysis on a sequential MIMO data capture. struct SEQ_MIMO { int numSections; //!< Number of sections in capture Default: 0 /*!< \c numSections specifies the number of chains which are sequentially captured. The capture is then reshaped into dimensions numSections x (sectionLenSec + interSectionGapSec) before it is passed to the MIMO analysis. */ double sectionLenSec; //!< Length of each section Default: 0.0 /*!< Specified in seconds. */ double interSectionGapSec; //!< Spacing between sections Default: 0.0 /*!< Specified in seconds. */ double sectionGainDb[N_MAX_TESTERS]; //!< Gain compensation per section Default: 0,0,0,0 /*!< \note The analysis mode must be set to \c sequential_mimo when using the SEQ_MIMO structure with sequential data captures. */ } SequentialMimo; //!< Specifies fields for performing a MIMO analysis on a sequential MIMO data capture int loggingMode; //!< Indicates the verbosity of the MIMO analysis. Default: 0 (no logging) /*!<Valid values are as follows: \n 0=no logging \n 1=console (text to screen) logging \n 2=file \n 3=console and file logging \n Default value is 1. */ int packetFormat; //!< Indicates format of the MIMO packet Default: 0 (auto-detect mode) /*!< \n IQV_MIMO_PACKET_FORMAT=0 (auto-detect mode) \n IQV_MIMO_PACKET_FORMAT=1 (mixed mode format) \n IQV_MIMO_PACKET_FORMAT=2 (greenfield format) */ private: int UnpackMimoAnalysis(void *mx_result_in); }; // **************************************************************** // 802.11 a/g (OFDM) Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies the analysis parameters for testing devices that are compliant with the IEEE 802.11 a/g (OFDM) standards specification. class IQ_API iqapiAnalysisOFDM : public iqapiAnalysis { public: /*! This class is used to specify OFDM analysis parameters. */ iqapiAnalysisOFDM(void); //!< Constructor ~iqapiAnalysisOFDM(void); //!< Destructor IQV_PH_CORR_ENUM ph_corr_mode; //!< Specifies the Phase Correlation mode. Default: IQV_PH_CORR_SYM_BY_SYM /*!< IQV_PH_CORR_OFF = 1 indicates phase correction off \n IQV_PH_CORR_SYM_BY_SYM = 2 indicates Symbol-by-symbol correction \n IQV_PH_CORR_MOVING_AVG = 3 moving avg. corr, 10 symbols */ IQV_CH_EST_ENUM ch_estimate; //!< Specifies the Channel Estimate mode. Default: IQV_CH_EST_RAW /*!< \n IQV_CH_EST_RAW = 1 Raw Ch Est, long train \n IQV_CH_EST_2ND_ORDER = 2 2nd Order Polyfit \n IQV_CH_EST_RAW_FULL = 3 Raw Ch Est, full packet */ IQV_SYM_TIM_ENUM sym_tim_corr; //!< Specifies the Symbol Timing Correction mode for SISO. Default: IQV_SYM_TIM_ON /*!< \n IQV_SYM_TIM_OFF = 1 Symbol Timing Correction Off \n IQV_SYM_TIM_ON = 2 Symbol Timing Correction On */ IQV_FREQ_SYNC_ENUM freq_sync; //!< Specifies the Frequency Sync mode. Default: IQV_FREQ_SYNC_LONG_TRAIN /*!< \n IQV_FREQ_SYNC_SHORT_TRAIN = 1 Short Training Symbol \n IQV_FREQ_SYNC_LONG_TRAIN = 2 Long Training Symbol \n IQV_FREQ_SYNC_FULL_PACKET = 3 /* Full Data Packet */ IQV_AMPL_TRACK_ENUM ampl_track; //!< Specifies the Amplitude Tracking mode. Default: IQV_AMPL_TRACK_OFF /*!< \n IQV_AMPL_TRACK_OFF = 1 Amplitude tracking off \n IQV_AMPL_TRACK_ON = 2 Amplitude tracking on */ IQV_OFDM_EVM_METHODS ofdmevmmethod; //!< Specifies the OFDM EVM Method. Default: IQV_OFDM_EVM_STANDARD /*!< IQV_OFDM_EVM_MULTIPATH &mdash; More tolerant of notches in the channel response \n IQV_OFDM_EVM_STANDARD &mdash; Standard 802.11 a/g EVM Method */ int OFDM_demod_on; //!< Specifies whether or not full data demodulation is done. Default: 1 /*!< Valid values are as follows: \n \c 0=does not perform demodulation \n \note This option is used for faster analysis performance; however, some of the results will not be available \n \c 1=performs full demodulation */ IQV_OFDM_MODE_ENUM OFDM_mode; //!< Specifies OFDM mode. Default: IQV_OFDM_80211_AG /*!< Valid vaues are as follows: \n IQV_OFDM_80211_AG \n IQV_OFDM_80211_AG_TURBO \n IQV_OFDM_ASTM_DSRC \n IQV_OFDM_QUARTER_RATE */ double frequencyOffsetHz; //!< Specifies Frequency offset. Default: 0 /*!< If the data capture was performed with a frequency offset (i.e., the VSA and DUT are not set to the same frequency), this field may be used to enable the analysis to compensate the signal with the offset by the specified amount, in Hz. */ int manual_pkt_start; //!< Bypasses the burst detection algorithm of the analysis when it is set to 1. Default: 0 /*!< When set to 1, this field can be used (effectively) to bypass the analysis‘ burst detection algorithm. It also indicates that the packet is starting within the first few samples of the data capture. */ IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing FFT analysis. Default data set to be analyzed is IQV_VSA_NUM_1 int SetDefault(); //!< Sets the analysis parameters to their default condition /*!< \note There must be a valid connection in order to use this function. Also, this function is called in the constructor of the class (i.e., \c SetDefault occurs when calling \c new for this object) */ private: int UnpackOFDMAnalysis(void *mx_result_in); }; // **************************************************************** // 802.11 b (DSSS) Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies the analysis parameters for testing devices that are compliant with the IEEE 802.11b standards specification. class IQ_API iqapiAnalysis11b : public iqapiAnalysis { public: iqapiAnalysis11b(void); //!< Constructor. ~iqapiAnalysis11b(void); //!< Destructor. IQV_EQ_ENUM eq_taps; //!< Specifies the number of equalizer taps. Default: IQV_EQ_OFF /*!< \n IQV_EQ_OFF = 1 (Equalizer Off) \n IQV_EQ_5_TAPS = 5 (5 taps equalizer) \n IQV_EQ_7_TAPS = 7 (7 taps equalizer) \n IQV_EQ_9_TAPS = 9 (9 taps equalizer) */ IQV_DC_REMOVAL_ENUM DCremove11b_flag; //!< Specifies the DC removal mode. Default: IQV_DC_REMOVAL_OFF /*!< \n IQV_DC_REMOVAL_OFF = 0 (DC removal is off) \n IQV_DC_REMOVAL_ON = 1 (DC removal is on) */ IQV_11B_METHOD_ENUM method_11b; //!< Specifies the 11b EVM method. Default: IQV_11B_STANDARD_TX_ACC /*!< \n IQV_11B_STANDARD_TX_ACC = 1 (11b Std TX accuracy) \n IQV_11B_RMS_ERROR_VECTOR = 2 (Use 11b RMS error vector) */ double frequencyOffsetHz; //!< Enables analysis to handle frequency offset by a specified amount. Default: 0 /*!< This field enables analysis for preset frequency offsets, i.e., the VSA and DUT are not set to the same frequency. The frequency offset is specified in Hz. */ int manual_pkt_start; //!< Bypasses the burst detection algorithm of the analysis. Default: 0 /*!< If \c manual_pkt_start is set to 1, this field is used to effectively bypass the burst detection algorithm of the analysis and to indicate that the packet is starting within the first few samples of the data capture. */ IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing analysis. Default data set to be analyzed is IQV_VSA_NUM_1 int SetDefault(); private: int Unpack11bAnalysis(void *mx_result_in); }; // **************************************************************** // Bluetooth Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies the analysis parameters for testing devices that are compliant with the bluetooth standards specification. class IQ_API iqapiAnalysisBluetooth : public iqapiAnalysis { public: iqapiAnalysisBluetooth(void); //!< Constructor ~iqapiAnalysisBluetooth(void); //!< Destructor double pwr_detect_gap_time; //!< Specifies the interval that is used to determine if power is present or not (sec). Default: 4e-6 /*!<Specified in seconds. */ double pwr_detect_diff; //!< Specifies the maximum power difference between packets that are expected to be detected. Default: 15 char *analysis_type; //!< Specifies what type of analysis to perform. Default: 'All' /*!<Valid values are as follows: \n \c PowerOnly \n \c 20dbBandwidthOnly \n \c PowerandFreq \n \c All This is the set default value. \n \c ACP only does the new ACP analysis \n \c AllPlus performs all the analyses that are done by ‘All’ plus the ACP analysis */ char syncWord[17]; //!< This field is reserved for future use Default: '0' double dataRate; //!< Sets the signal data rate, and should correspond to the input signal. Default: 0 /*!< Specified in Mbps. Valid values are as follows: 0, 1, 2 or 3 */ double fm_lowpass_F3dbHz; //!< Sets the bandwidth for the FM IF filter Default: 650000 /*!< IF bandwidth = 2 * fm_lowpass_F3dbHz Hz */ int SetDefault(); private: int UnpackBluetoothAnalysis(void *mx_result_in); }; // **************************************************************** // Wave Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Wave analysis parameters. class IQ_API iqapiAnalysisWave : public iqapiAnalysis { public: iqapiAnalysisWave(void); //!< Constructor ~iqapiAnalysisWave(void); //!< Destructor }; // **************************************************************** // Sidelobe Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Sidelobe analysis parameters. class IQ_API iqapiAnalysisSidelobe : public iqapiAnalysis { public: iqapiAnalysisSidelobe(void); //!< Constructor ~iqapiAnalysisSidelobe(void); //!< Destructor }; // **************************************************************** // Power Ramp Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Power Ramp analysis parameters. class IQ_API iqapiAnalysisPowerRamp : public iqapiAnalysis { public: /*! If the overloaded constructor for \c iqapiAnalysisPowerRamp is called with \c doOFDM set to true, then the analysis will be performed for an OFDM signal. Otherwise, the analysis will perform the analysis for an 11b signal. */ iqapiAnalysisPowerRamp(bool doOFDM); iqapiAnalysisPowerRamp(); //!< Constructor ~iqapiAnalysisPowerRamp(void); //!< Destructor }; // **************************************************************** // CW Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Continuous Wave analysis parameters. class IQ_API iqapiAnalysisCW : public iqapiAnalysis { public: iqapiAnalysisCW(void); //!< Constructor ~iqapiAnalysisCW(void); //!< Destructor }; // **************************************************************** // CCDF Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies CCDF analysis parameters. class IQ_API iqapiAnalysisCCDF : public iqapiAnalysis { public: iqapiAnalysisCCDF(void);//!< Constructor ~iqapiAnalysisCCDF(void); //!< Destructor IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing analysis. Default data set to be analyzed is IQV_VSA_NUM_1 }; // **************************************************************** // Generic FFT Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies FFT analysis parameters. class IQ_API iqapiAnalysisFFT : public iqapiAnalysis { public: iqapiAnalysisFFT(void); //!< Constructor ~iqapiAnalysisFFT(void); //!< Destructor double NFFT; //!< Specifies the number of points in FFT. Default: 0 int NFFT_over;//!< Specifies the minimum oversampling factor. Default: 2 double F_sample; //!< Specifies the sample frequency in Hz. Default: 80e6 /*!< \note This field will automatically become updated with the sample frequency in the \c hndl->data object. */ double Freq_start; //!< Specifies start frequency, in Hz, for the x-axis in returned results. Default: -33e6 /*!< If the input is less than minus one-half of the sampling frequency, this input is ignored. The default value is minus one-half of the sampling frequency. For example, if sampling frequency is 80 MHz, then the default value is -40 MHz. */ double Freq_stop; //!< Specifies stop frequency, in Hz, for the x-axis in returned results. Default: +33e6 /*!<If larger than half the input sampling frequency this input is ignored. The default value is equal to (freq_sample / 2) - freq_delta [half of the sampling frequency minus frequency_delta]. */ int Delta_freq; //!< Frequency increment in Hz for x axis in returned results. Default: -1 /*!< If larger than half the resolution bandwidth, this input is ignored. If the output vector would be larger than 2^15 elements, this input is also ignored. If ignored, the frequency increment is determined by internal algorithm on basis of window type, resolution bandwidth, and the \c nfft_over value. */ double res_bw; //!< This field is used to specify the resolution bandwidth in Hz. Default: 100000 char *window_type; //!< This field is used to specify the window type. Default: 'blackmanharris' /*!<Valid options are as follows: \n \li blackmanharris; this is the default value \n \li rectangular \n \li hanning */ double video_bw; //!< This field is used to specify the video bandwidth in Hz. Default: 1000 /*!< This setting is ignored in digital spectrum mode */ char *video_av_method; //!< This field is used to specify the video averaging method. For the digital spectrum mode, this value is "average"; for the classical spectrum mode, this value is either "clear write" or "max hold". Default: 'average' /*!< Description of values: \n average&mdash;digital PSD estimation algorithm based on averaging \n clear write&mdash;trace overwritten in each measurement \n max hold&mdash;maximum value taken over measurements */ IQV_SPECTRUM_ANALYSIS_MODE_ENUM spectrumAnalysisMode; //!< This field is used to specify spectrum analysis mode Default: IQV_DIGITAL_SPECTRUM_ANALYSIS_MODE /*!< Valid values are defined as follows: \n IQV_DIGITAL_SPECTRUM_ANALYSIS_MODE&mdash;FFT in digital mode \n IQV_ CLASSICAL_SPECTRUM_ANALYSIS_MODE&mdash;FFT in classical mode */ IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing FFT analysis. Default: IQV_VSA_NUM_1 virtual int SetDefault(); protected: virtual int UnpackFftAnalysis(void *mx_result_in); }; // **************************************************************** // Power Specific Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies Power analysis parameters. class IQ_API iqapiAnalysisPower : public iqapiAnalysis { public: iqapiAnalysisPower(void); //!< Constructor ~iqapiAnalysisPower(void); //!< Destructor double T_interval; //!< This field is used to specify the interval that is used to determine if power is present or not (sec). Default: 3.2e-6 double max_pow_diff_dB; //!< This filed is used to specify the maximum power difference between packets that are expected to be detected. Default: 15 IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing FFT analysis. Default: IQV_VSA_NUM_1 int SetDefault(); //!< Sets the analysis parameters to their default condition. Note that there must be a valid connection in order to use this function. Also, note that this function is called in the constructor of the class (ie, SetDefault will happen when calling /c new for this object). private: int UnpackPowerAnalysis(void *mx_result_in); }; // **************************************************************** // HT40 Analysis Parameters Class (Derived from iqapiAnalysis) // **************************************************************** //! Specifies parameters for the wideband FFT analysis of 40 MHz 802.11n signals. class IQ_API iqapiAnalysisHT40 : public iqapiAnalysis { friend class iqapiHndl; public: iqapiAnalysisHT40(void); //!< Constructor virtual ~iqapiAnalysisHT40(void); //!< Destructor static const double dbResolutionBWLowerLimit; IQV_WINDOW_TYPE_ENUM windowType; double dbResolutionBW; //!< It has to be greater or equal to 1000, Default: 100000 IQV_VSA_NUM_ENUM vsaNum; //!< For MIMO case, tester can capture more than 1 data set. This parameter specifies which data set to be used for doing FFT analysis. Default: IQV_VSA_NUM_1 int SetDefault(); }; class IQ_API iqapiAnalysisHT40Data3 : public iqapiAnalysisHT40 { public: iqapiAnalysisHT40Data3(void); //!< Constructor virtual ~iqapiAnalysisHT40Data3(void) {}; //!< Destructor }; // **************************************************************** // 80216 Results Class // type = '80216-2004' or '80216e-2005' // mode = '80216-2004' or '80216e-2005'or 'powerPacketDetect' // Note : // (1) If mode is 'powerPacketDetect', only the following result parameters are needed // => acquisition, type, avgPowerNoGapDb and errTxt // **************************************************************** //! Specifies analysis results generated using \c iqapiResult80216 objects. class IQ_API iqapiResult80216 : public iqapiResult { public: iqapiResult80216(void); //!< Constructor ~iqapiResult80216(void); //!< Destructor int packetDetection;//!< Indicates valid packet detection int acquisition; //!< Indicates valid packet acquisition int demodulation; //!< Indicates valid packet demodulation int completePacket; //!< Indicates that at least one complete packet was found by the analysis int fchHcs; //!< Indicates valid fchHcs char *errTxt; //!< Indicates possible warning and error messages. iqapiMeasurement *analyzedRange; //!< Indicates the start/stop pointers and the packet selected for analysis /*!< \c iqapiMeasurement is a data type used to return result values */ // power iqapiMeasurement *rxRmsPowerDb; //!< RMS power in dBm iqapiMeasurement *avgPowerNoGapDb; //!< Average power iqapiMeasurement *rxPreambleRmsPowerDb;//!< Preamble average power // FrameInfo iqapiMeasurement *sigType; //!< Indicates uplink or downlink burst iqapiMeasurement *numSymbols; //!< Indicates the number of symbols in the analyzed packet iqapiMeasurement *modOrder; //!< 802.16-2004 modOrder iqapiMeasurement *rateId; //!< 802.16-2004 rateId iqapiMeasurement *bandwidthHz; //!< 802.16-2004 bandwidth iqapiMeasurement *cyclicPrefix; //!< 802.16-2004 cyclic prefix iqapiMeasurement *numPreambleSymbols; //!< Indicates the number of preamble symbols // FrameInfo.Fch iqapiMeasurement *validHcs; //!< Indicates valid Hcs iqapiMeasurement *bits; //!< Indicates FramInfo.Fch bits iqapiMeasurement *bsid; //!< Base station ID iqapiMeasurement *frameNum; //!< 802.16-2004 frame number iqapiMeasurement *changeCount; //!< 802.16-2004 change count iqapiMeasurement *Bursts; //!< 802.16-2004 bursts // EVM Measurements iqapiMeasurement *evmAvgAll; //!< EVM Average (All) iqapiMeasurement *evmAvgData; //!< EVM Average (Data) iqapiMeasurement *evmAvgPilot; //!< EVM Average (Pilots) iqapiMeasurement *evmTones; //!< EVM per Tone iqapiMeasurement *evmSymbols; //!< EVM per Symbol iqapiMeasurement *evmCinrDb; //!< EVM Carrier to Interference and Carrier Noise Ratio (CINR in Db) iqapiMeasurement *avgUnmodData; //!< EVM of the unmodulated data carrier // Indexes iqapiMeasurement *dataTones; //!< Data tones iqapiMeasurement *pilotTones; //!< Pilot tones // Data iqapiMeasurement *demodSymbols; //!< Demodulated Symbols iqapiMeasurement *slicedSymbols; //!< Sliced Symbols iqapiMeasurement *validFec; //!< Valid Forward Error Correction iqapiMeasurement *MacPdu; //!< MAC PDU iqapiMeasurement *phaseNoiseDegRmsAll; //!< RMS phase noise in degrees iqapiMeasurement *phaseNoiseDegSymbols; //!< Phase noise per symbol iqapiMeasurement *freqOffsetTotalHz; //!< Frequency offset in Hz iqapiMeasurement *freqErrorHz; //!< Frequency error in Hz iqapiMeasurement *symClockErrorPpm; //!< Symbol clock error in PPM iqapiMeasurement *iqImbalAmplDb; //!< IQ Amplitude Imbalance in dB iqapiMeasurement *iqImbalPhaseDeg; //!< IQ Phase Imbalance in degrees iqapiMeasurement *channelEst; //!< Channel Estimate char *type; //!< Signal/analysis type iqapiMeasurement *dcLeakageDbc; //!< DC leakage in dBc per Rx; dimension 1 x NRx int numberOfZone; //!< Number of zones }; // **************************************************************** // Generic multi-use MIMO Results Class // **************************************************************** //! Specifies analysis results generated using \c iqapiAnalysisMimo objects class IQ_API iqapiResultMimo : public iqapiResult { public: iqapiResultMimo(void); //!< Constructor ~iqapiResultMimo(void); //!< Destructor int packetDetection; //!< Indicates valid packet start detected. int acquisition; //!< Indicates valid HT packet start detected. int demodulation; //!< Indicates streams demodulated (packet may be truncated) int completePacket; //!< Indicates a complete packet was demodulated bool htSigFieldCRC; //!< Indicates valid CRC on HT-SIG bool psduCRC; //!< Indicates valid CRC on PSDU char *errTxt; //!< Error messages text string if analysis failed iqapiMeasurement *analyzedRange; //!< Start and end point of signal part that was used to for analysis. The API picks the first packet in the input signal for analysis; following packets are ignored. iqapiMeasurement *idxAnalyzedSigs; //!< Indexes of input signals that were used for analysis. iqapiMeasurement *channelEst; //!< Channel estimate matrix; dimension NStreams x Ntones x NRx iqapiMeasurement *idxDataTones; //!< Index numbers of data tones in the result data (channelEst etc.); DC component is at index 1. iqapiMeasurement *idxPilotTones; //!< Index number of pilot tones in the result data (channel Est etc.); DC component is at index 1. iqapiMeasurement *evmAvgAll; //!< Averaged, per stream; dimension 1 xNStreams iqapiMeasurement *evmSymbols; //!< Per symbol and stream; dimension NStreams x NSymbols iqapiMeasurement *evmTones; //!< Per tone and stream; dimension NStreams x Ntones iqapiMeasurement *freqErrorHz; //!< Frequency error in Hz iqapiMeasurement *symClockErrorPpm; //!< Symbol clock error in ppm iqapiMeasurement *PhaseNoiseDeg_RmsAll; //!< RMS phase noise, over all received signals iqapiMeasurement *PhaseNoiseDeg_Symbols; //!< Per symbol and VSA signal; dimension NRx x Nsymbols iqapiMeasurement *CCDF_xPowerDb; //!< Complementary Cumulative Distribution Function. dB above average power (x-axis) iqapiMeasurement *CCDF_yProb; //!< Complementary Cumulative Distribution Function. Probability (y-axis) iqapiMeasurement *IQImbal_amplDb; //!< IQ gain imbalance in dB, per stream. iqapiMeasurement *IQImbal_phaseDeg; //!< IQ phase imbalance in degree, per stream. iqapiMeasurement *demodSymbols; //!<Complex demodulated symbols; dimension NTones x NSymbols X Nstreams iqapiMeasurement *slicedSymbols; //!< Sliced symbols iqapiMeasurement *psduBits; //!< Decoded PSDU bits iqapiMeasurement *serviceField; //!< Bits of service field iqapiMeasurement *preambleFreqErrorHz; //!< Preamble frequency error, in Hz iqapiMeasurement *preambleFreqErrorTimeUs; //!< Preamble frequency error versus time iqapiMeasurement *legacyBits; //!< Information from the legacy signal field: 24 bits iqapiMeasurement *legacyLength; //!< Information from the legacy signal field: value in length field as decimal number. iqapiMeasurement *legacyRate; //!< Information from the legacy signal field: data rate information. iqapiMeasurement *htSig1_bits; //!< Information from HT-SIG1:24 bits. iqapiMeasurement *htSig1_mcsIndex; //!< Information from HT-SIG1: MCS index as decimal number. iqapiMeasurement *htSig1_bandwidth; //!< Information from HT-SIG1: bandwidth (0) 20 MHz (1) 40 MHz. iqapiMeasurement *htSig1_htLength; //!< Information from HT-SIG1: value in length field as decimal number iqapiMeasurement *htSig2_bits; //!< Information from HT-SIG-2: 24 bits iqapiMeasurement *htSig2_aggregation; //!< Information from HT-SIG-2: aggregation iqapiMeasurement *htSig2_stbc; //!< Information from HT-SIG-2: 2 bits as decimal iqapiMeasurement *htSig2_advancedCoding; //!< Information from HT-SIG-2: advanced coding iqapiMeasurement *htSig2_shortGI; //!< Information from HT-SIG-2: short guard interval iqapiMeasurement *htSig2_numHTLF; //!< Information from HT-SIG-2: 2 bits as decimal number iqapiMeasurement *htSig2_soundingPacket; //!< Information from HT-SIG-2: sounding packet iqapiMeasurement *rateInfo_bandwidthMhz; //!< Bandwidth in MHz iqapiMeasurement *rateInfo_dataRateMbps; //!< Data rate in Mbps iqapiMeasurement *rateInfo_spatialStreams; //!< Number of spatial streams char *rateInfo_modulation; //!< Modulation type, i.e., '64 QAM' char *rateInfo_codingRate; //!< Coding rate, i.e., '3/4' iqapiMeasurement *rateInfo_spaceTimeStreams; //!< Indicates number of spatial streams. iqapiMeasurement *isolationDb; //!< Matrix indicating isolation between streams /*!<Column 1 is for Rx signal containing main power for stream 1, etc.; dimension NStreams x NStreams \n \note Isolation can only be measured with direct-mapping signals. \n Example: isolationDb = [0 -20; -25 0] - Stream 1 leaks into stream 2 signal with -20 dB - Stream 2 leaks into stream 1 signal with -25 dB */ iqapiMeasurement *dcLeakageDbc; //!< DC leakage in dBc per Rx; dimension 1 x NRx iqapiMeasurement *rxRmsPowerDb; //!< RMS power in dBm iqapiMeasurement *mainPathStreamPowerDb; //!< Main path power per stream (maximum element from each row in channel power matrix rxRmsPowerDb); dimension NStreams x 1 }; // **************************************************************** // OFDM Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisOFDM objects. class IQ_API iqapiResultOFDM : public iqapiResult { public: iqapiResultOFDM(void); //!< Constructor ~iqapiResultOFDM(void); //!< Destructor int psduCrcFail; //!< 0 = PLCP CRC Check Failed int plcpCrcPass; //!< 1 = PLCP CRC Check Passed int dataRate; //!< Data rate in Mbps int numSymbols; //!< Number of symbols int numPsduBytes; //!< Number of bytes in PSDU iqapiMeasurement *evmAll; //!< EVM for entire frame iqapiMeasurement *evmData; //!< EVM for data part of frame iqapiMeasurement *evmPilot; //!< EVM for pilot part of frame iqapiMeasurement *psdu; //!< The PSDU data. 0/1 values. Includes the MAC Header and the FCS, if present. iqapiMeasurement *startPointers; //!< Provides the approximate starting locations of each packet detected in the input data. If no packet detected, this is an empty vector. iqapiMeasurement *stopPointers; // Reserved for future use iqapiMeasurement *hhEst; //!< 64 element complex vector that represents the FFT output of the 2 long symbols in the PLCP pre-amble of the OFDM signal. iqapiMeasurement *plcp; //!< PLCP (binary) data as 1/0s iqapiMeasurement *codingRate; //!< Coding rate. iqapiMeasurement *freqErr; //!< Frequency error iqapiMeasurement *clockErr; //!< Symbol Clock Error iqapiMeasurement *ampErr; //!< IQ Match Amplitude Error iqapiMeasurement *ampErrDb; //!< IQ Match Amplitude Error in dB iqapiMeasurement *phaseErr; //!< IQ Match Phase Error iqapiMeasurement *rmsPhaseNoise; //!< Frequency RMS Phase Noise iqapiMeasurement *rmsPowerNoGap; //!< Power RMS No Gap iqapiMeasurement *rmsPower; //!< Power RMS iqapiMeasurement *pkPower; //!< Power Peak iqapiMeasurement *rmsMaxAvgPower; //!< Power RMS Max. Average iqapiMeasurement *freq_vector; //!< Preamble frequency error iqapiMeasurement *freq_vector_time; //!< Preamble frequency error versus time iqapiMeasurement *evmSymbols; //!< the number of actually analyzed symbols }; // **************************************************************** // 802.11 b Results Class // **************************************************************** //! Specifies analysis results generated using \c iqapiAnalysis11b objects. class IQ_API iqapiResult11b : public iqapiResult { public: iqapiResult11b(void); //!< Constructor ~iqapiResult11b(void); //!< Destructor int lockedClock; //!< Locked Clock, see 802.11b standard int plcpCrcFail; //!< 1 = PLCP CRC Check Failed, 0 = PLCP CRC Check Passes int psduCrcFail; //!< 1 = PSDU CRC Check Failed, 0 = PSDU CRC Check Passes int longPreamble; //!< 1 = Long Preamble, 0 = Short Preamble int numPsduBytes; //!< Number of bytes in PSDU double bitRateInMHz; iqapiMeasurement *evmPk; //!< EVM peak value iqapiMeasurement *psdu; //!< The PSDU data. 0/1 values. Includes the MAC Header and the FCS, if present. iqapiMeasurement *startPointers; //!< Provides the approximate starting locations of each packet detected in the input data. If no packet detected, this is an empty vector. iqapiMeasurement *stopPointers; //!< Provides the approximate end location of each packet. iqapiMeasurement *selectedIndex; //!< Provides the start and end pointer for the packet selected by the analysis program for analysis. iqapiMeasurement *eye; //!< Represents the values of the In-phase receiver channel at 19 samples per chip. Can be used to plot the eye-diagram by plotting samples (0:18)+n*19 on the same plot. iqapiMeasurement *scramblerInit; //!< Scrambler Initialization. 7 element (or empty) Real vector is returned. iqapiMeasurement *plcp; //!< PLCP (binary) data as 1/0s iqapiMeasurement *bitRate; //!< Bit Rate, see 802.11b standards specification. iqapiMeasurement *modType; //!< Mod Type, see 802.11b standards specification. iqapiMeasurement *evmAll; //!< EVM for entire frame iqapiMeasurement *freqErr; //!< Frequency Error iqapiMeasurement *clockErr; //!< Symbol Clock Error iqapiMeasurement *ampErr; //!< IQ Match Amplitude Error iqapiMeasurement *ampErrDb; //!< IQ Match Amplitude Error in dB iqapiMeasurement *phaseErr; //!< IQ Match Phase Error iqapiMeasurement *rmsPhaseNoise; //!< Frequency RMS Phase Noise iqapiMeasurement *rmsPowerNoGap; //!< Power RMS No Gap iqapiMeasurement *rmsPower; //!< Power RMS iqapiMeasurement *pkPower; //!< Power Peak iqapiMeasurement *rmsMaxAvgPower; //!< Power RMS Max. Average iqapiMeasurement *freqErrTimeVect; //!< Frequency Error for the the entire packet plotted against time iqapiMeasurement *freqErrVect; //!< Frequency Error for the entire packet iqapiMeasurement *maxFreqErr; //!< The highest Frequency Error value for the entire packet iqapiMeasurement *loLeakageDb; //!< Lo Leakage iqapiMeasurement *evmInPlcp; //!< EVM in PLCP iqapiMeasurement *evmInPreamble; //!< EVM on preamble iqapiMeasurement *evmInPsdu; //!< EVM in PSDU iqapiMeasurement *evmErr; //!< EVM error }; // **************************************************************** // Wave Analysis Results Class // **************************************************************** //! Specifies results generated with \c iqapiResultWave objects. class IQ_API iqapiResultWave : public iqapiResult { public: iqapiResultWave(void); //!< Constructor ~iqapiResultWave(void); //!< Destructor iqapiMeasurement *dcDc; //!< Dc DC value iqapiMeasurement *dcRms; //!< DC RMS value iqapiMeasurement *dcMin; //!< DC Minimum value iqapiMeasurement *dcMax; //!< DC Maximum value iqapiMeasurement *dcPkToPk;//!< DC Peak to Peak value iqapiMeasurement *dcRmsI;//!< DC RMS for I channel iqapiMeasurement *dcRmsQ;//!< DC RMS for Q channel iqapiMeasurement *acDc; //!< AC DC value iqapiMeasurement *acRms; //!< AC RMS value iqapiMeasurement *acMin; //!< AC Minimum value iqapiMeasurement *acMax; //!< AC Maximum value iqapiMeasurement *acPkToPk;//!< AC Peak to Peak value iqapiMeasurement *acRmsI;//!< AC RMS for I Channel iqapiMeasurement *acRmsQ;//!< AC RMS for Q Channel iqapiMeasurement *rmsDb; //!< AC RMS value in dB }; // **************************************************************** // Sidelobe Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisSidelobe objects. class IQ_API iqapiResultSidelobe : public iqapiResult { public: iqapiResultSidelobe(void); //!< Constructor ~iqapiResultSidelobe(void); //!< Destructor iqapiMeasurement *res_bw_Hz; //!< Resolution bandwidth in Hz iqapiMeasurement *fft_bin_size_Hz;//!< FFT Bin Size in Hz iqapiMeasurement *peak_center; //!< Peak Center in dB iqapiMeasurement *peak_1_left; //!< Peak 1st Lower Side Lobe in dB iqapiMeasurement *peak_2_left; //!< Peak 2nd Lower Side Lobe in dB iqapiMeasurement *peak_1_right; //!< Peak 1st Higher Side Lobe in dB iqapiMeasurement *peak_2_right; //!< Peak 2nd Higher Side Lobe in dB iqapiMeasurement *psd_dB; //!< PSD Plot data in dB }; // **************************************************************** // Power Ramp Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisPowerRamp objects. class IQ_API iqapiResultPowerRamp : public iqapiResult { public: iqapiResultPowerRamp(void); //!< Constructor ~iqapiResultPowerRamp(void); //!< Destructor iqapiMeasurement *on_power_inst; //!< Instant power on ramp iqapiMeasurement *off_power_inst; //!< Instant power off ramp iqapiMeasurement *on_power_peak; //!< Power on ramp peak values iqapiMeasurement *off_power_peak; //!< Power off ramp peak values iqapiMeasurement *on_time_vect; //!< Power on ramp time vector iqapiMeasurement *off_time_vect; //!< Power off ramp time vector iqapiMeasurement *on_mask_x; //!< Power on ramp mask x-axis iqapiMeasurement *off_mask_x; //!< Power off ramp mask x-axis iqapiMeasurement *on_mask_y; //!< Power on mask y-axis iqapiMeasurement *off_mask_y; //!< Power off ramp mask y-axis iqapiMeasurement *on_time; //!< Ramp on time iqapiMeasurement *off_time; //!< Ramp off time }; // **************************************************************** // CW Analysis Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisCW objects. class IQ_API iqapiResultCW : public iqapiResult { public: iqapiResultCW(void); //!< Constructor ~iqapiResultCW(void); //!< Destructor double frequency; //!< Frequency result }; // **************************************************************** // CCDF Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisCCDF objects. class IQ_API iqapiResultCCDF : public iqapiResult { public: iqapiResultCCDF(void); //!< Constructor ~iqapiResultCCDF(void); //!< Destructor iqapiMeasurement *prob; //!< Real vector containing CCDF probability values (Y-axis of CCDF plot) iqapiMeasurement *power_rel_dB; //!< Real vector containing CCDF power relative to average power in dB values (X-axis of CCDF plot) iqapiMeasurement *percent_pow; //!< CCDF power percentage }; // **************************************************************** // FFT Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisFFT objects. class IQ_API iqapiResultFFT : public iqapiResult { public: iqapiResultFFT(void); //!< Constructor ~iqapiResultFFT(void); //!< Destructor iqapiMeasurement *x; //!< X-axis values, typically frequency; vector is returned. iqapiMeasurement *y; //!< y-axis values, power in dBm. Vector is returned. char *x_string; //!< X-axis label. String value is returned. char *y_string; //!< Y-axis label. String value is returned. char *title; //!< Text for title. String value is returned. int valid; //!< Returns (value) whether results are valid or not. 1:valid, 0: invalid int warning; //!< Returns (value) that if equal to 1, indicates that the results should be looked at with caution. char *error; //!< Returns a text string that explains the reason for the valid flag being 0 or the warning flag beint 1. iqapiMeasurement *length; //!< Returns length of X and Y vectors above. iqapiMeasurement *res_bw; //!< Resolution bandwidth used in calculations. iqapiMeasurement *noise_bw; //!< Noise bandwidth used in calculations. May be different than resolution bandwidth. iqapiMeasurement *video_bw; //!< Video bandwidth used in calculation. iqapiMeasurement *Freq_start; //!< Start frequency in Hz. iqapiMeasurement *Freq_stop; //!< Stop frequency in Hz. iqapiMeasurement *Delta_freq; //!< Frequency increment in Hz. }; // **************************************************************** // HT40 Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisHT40 objects. class IQ_API iqapiResultHT40 : public iqapiResult { public: int len_of_ffts; //the length of ffts iqapiResultFFT ** ffts; /// iqapiResultFFT *ffts[N_MAX_TESTER]; iqapiResultHT40(); //!< Constructor virtual ~iqapiResultHT40(); //!< Destructor }; // **************************************************************** // Power Analysis Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisPower objects. class IQ_API iqapiResultPower : public iqapiResult { public: iqapiResultPower(void); //!< Constructor ~iqapiResultPower(void); //!< Destructor char *msg; //!< Possible warning and error messages, text string is returned. int valid; //!< Indicates valid results (1 valid, 0 invalid). iqapiMeasurement *start_loc; //!< Start location for each packet detected. iqapiMeasurement *stop_loc; //!< Stop location for each packet detected. iqapiMeasurement *start_sec; //!< Start time, in seconds, for each packet detected. iqapiMeasurement *stop_sec; //!< Stop time, in seconds, for each packet detected iqapiMeasurement *complete_burst; //!< Indicates complete packet (start/stop found). iqapiMeasurement *P_av_each_burst; //!< Average power of each burst iqapiMeasurement *P_pk_each_burst; //!< Peak power of each burst iqapiMeasurement *P_av_all; //!< Average power of whole capture iqapiMeasurement *P_peak_all; //!< Peak power of whole capture iqapiMeasurement *P_av_no_gap_all; //!< Average power, not counting gaps iqapiMeasurement *P_av_each_burst_dBm; //!< Average power of each burst in dBm iqapiMeasurement *P_pk_each_burst_dBm; //!< Peak power of each burst in dBm iqapiMeasurement *P_av_all_dBm; //!< Average power of whole capture in dBm iqapiMeasurement *P_peak_all_dBm; //!< Peak power of whole capture in dBm iqapiMeasurement *P_av_no_gap_all_dBm; //!< Average power, not counting gaps in dBm }; // **************************************************************** // Zigbee Results Class // **************************************************************** //! Specifies Zigbee analysis for the IEEE 802.15.4 standards specification wireless protocol. class IQ_API iqapiResultZigbee : public iqapiResult { public: iqapiResultZigbee( void); //!< Constructor ~iqapiResultZigbee( void); //!< Destructor int bValid; //!< A value of 1 indicates a valid analysis, 0 indicates a failed analysis. char *errTxt; //!< Contains possible error messages and warnings returned from the analysis. // members extracted from the IQsignal for Zigbee GUI iqapiMeasurement *rxPeakPower; //!< Peak linear power iqapiMeasurement *rxRmsPowerAll; //!< Average linear power of the whole signal iqapiMeasurement *rxRmsPowerNoGap; //!< Average linear power, excluding gaps between packets iqapiMeasurement *rxPeakPowerDbm; //!< Peak power in dBm iqapiMeasurement *rxRmsPowerAllDbm; //!< Average power of the whole signal, in dBm iqapiMeasurement *rxRmsPowerNoGapDbm; //!< Average power, excluding gaps between packets, in dBm int numSymbols; //!< Number of symbols in the PSDU // members extracted from the ResDem Structure // FrameInfo iqapiMeasurement *sigType; //!< Indicates the signal type, currently only 1 is returned (for OQPSK). iqapiMeasurement *fsWaveHz; //!< Indicates the sampling rate used in the analysis. iqapiMeasurement *overSampling; //!< Oversampling ratio per symbol. // EVM Measurements iqapiMeasurement *evmAll; //!< Average EVM for all symbols. iqapiMeasurement *evmAllOffset; //!< Average offset EVM for all symbols. iqapiMeasurement *evmSymbols; //!< EVM for each symbol in the PSDU. // Constellation iqapiMeasurement *constData; //!< Demodulated symbols in the PSDU. // Data iqapiMeasurement *phaseNoiseDegRmsAll; //!< RMS phase noise, in degrees. iqapiMeasurement *phaseNoiseDegError; //!< Phase noise in chip duration, in degrees. iqapiMeasurement *freqOffsetFineHz; //!< Frequency offset error, in Hz. iqapiMeasurement *symClockErrorPpm; //!< Symbol clock error in PPM iqapiMeasurement *eyeDiagramData; //!< Complex baseband signal in the form of eye diagram. iqapiMeasurement *eyeDiagramTime; //!< Time points corresponding to eyeDiagramData // Code Domain iqapiMeasurement *codeDomain; //!< Output of received signal matched with spreading sequences. /// iqapiMeasurement *avgPsdu; //!< Average physical service data unit /// iqapiMeasurement *avgShrPhr; //!< Average synchronization header and physical header iqapiMeasurement *evmPsdu; //!< Average physical service data unit iqapiMeasurement *evmShrPhr; //!< Average synchronization header and physical header iqapiMeasurement *evmAllLinear; iqapiMeasurement *evmPsduLinear; //!< Average physical service data unit in linear iqapiMeasurement *evmShrPhrLinear; //!< Average synchronization header and physical header iqapiMeasurement *evmAllOffsetLinear; //!< Average offset EVM in linear iqapiMeasurement *evmPsduOffsetLinear; //!< Average physical service data unit offset in linear iqapiMeasurement *evmShrPhrOffsetLinear; //!< Average synchronization header and physical header offset in linear iqapiMeasurement *demodSymbolsOversamp; char *type; //!< Indicates the type of analysis performed. }; // **************************************************************** // Bluetooth Analysis Results Class // **************************************************************** //! Specifies analysis results generated with \c iqapiAnalysisBluetooth objects. class IQ_API iqapiResultBluetooth : public iqapiResult { public: iqapiResultBluetooth(void); //!< Constructor ~iqapiResultBluetooth(void); //!< Destructor iqapiMeasurement *P_av_each_burst; //!< Average power of each burst detected, in mWatts. iqapiMeasurement *P_pk_each_burst; //!< Peak power of each burst detected, in mWatts. iqapiMeasurement *complete_burst; //!< Vector indicating whether or not each burst is complete. All elements are either (1: beginning and end transitions detected), or (0: burst is missing either beginning or end transition). iqapiMeasurement *start_sec; //!< Starting time of each burst, in seconds iqapiMeasurement *stop_sec; //!< End time of each burst, in seconds iqapiMeasurement *valid; //!< Flag indicating whether or not the power portion of the bluetooth analysis was successful (1), or not (0). iqapiMeasurement *freq_est; //!< Initial freq offset of each burst detected, in Hz. iqapiMeasurement *freqEstPacketPointer; //!< Pointers to which packet is pointed to in each element of freq_est. iqapiMeasurement *freq_drift; //!< Initial freq carrier drift of each burst detected, in Hz. iqapiMeasurement *freqDriftPacketPointer; //!< Pointers to which packet is pointed to in each element of freq_drift. iqapiMeasurement *bandwidth20dB; //!< 20dB bandwidth value Hz. iqapiMeasurement *deltaF1Average; //!< The measurement result for deltaF1Avg as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Requires 00001111 data pattern. Result in Hz. iqapiMeasurement *deltaF2Max; //!< The measurement result for deltaF2Max as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Requires alternating data pattern. Result in Hz. iqapiMeasurement *deltaF2Average; //!< The measurement result for deltaF2Avg as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Requires alternating data pattern. Result in Hz. iqapiMeasurement *deltaF2MaxAccess; //!< Similar to the measurement result for deltaF2Max as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Result measured from Access data. Result in Hz. iqapiMeasurement *deltaF2AvAccess; //!< Similar to the measurement result for deltaF2Avg as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Result measured from Access data. Result in Hz. iqapiMeasurement *EdrEVMAv; //!< RMS Differential EVM value (EDR only). iqapiMeasurement *EdrEVMpk; //!< Peak Differential EVM value (EDR only). iqapiMeasurement *EdrEVMvalid; //!< Indicates validity of EDR EVM Measurements. iqapiMeasurement *EdrPowDiffdB; //!< Relative power of EDR section to FM section of packet, in dB. iqapiMeasurement *freq_deviation; //!< Similar to the measurement result for deltaF1Avg as specified in BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. Result measured from Header data. Result in Hz. iqapiMeasurement *freq_deviationpktopk; //!< Peak to Peak Frequency Deviation, in Hz during header. iqapiMeasurement *freqDeviationPointer; //!< Pointers to which packet is pointed to in each element of the above two measurements. iqapiMeasurement *freq_estHeader; //!< Estimates the Frequency Offset during the Header in Hz. iqapiMeasurement *EdrFreqExtremeEdronly; //!< Reports the extreme value of the frequency variation during DPSK in Hz. Does not include the offset during the header. iqapiMeasurement *EdrprobEVM99pass; //!< The percentage of symbols with EVM below the threshold. Threshold for 2 Mbps is 0.3 for 3 Mbps is 0.2. iqapiMeasurement *EdrEVMvsTime; //!< Max DEVM Average as specified in: BLUETOOTH TEST SPECIFICATION Ver. 1.2/2.0/2.0 + EDR [vol 2] version 2.0.E.2. iqapiMeasurement *validInput; //!< Indicates whether or not the input wave was valid. char *sCaution; //!< Possible error and warning messages. char *analysisType; //!< Indicates which analysis is performed. char *versionString; //!< Indicates the version of the BT analysis module. double dataRateDetect; //!< The detected data rate iqapiMeasurement *EdrFreqvsTime; //!< Enhanced data rate for frequency versus time iqapiMeasurement *maxfreqDriftRate; //!< 1 Mbps only, takes the maximum drift over specified time interval iqapiMeasurement *EdrFreqvsTimeLength; //!< Number of elements in EdrFreqvsTime iqapiMeasurement *EdrOmegaI; //!< \c Omega_i, same as \c freq_estHeader iqapiMeasurement *EdrExtremeOmega0; //!< Extreme value of \c Omega_0, same as \c EdrFreqExtremeEdronly iqapiMeasurement *EdrExtremeOmegaI0; //!< Extreme value of (Omega_0 + Omega_i) iqapiMeasurement *payloadErrors; //!< Reports the number of data errors in Payload. Not counting CRC. If -1, this value has not been calculated. If larger negative number, it reports the length of the payload data vector. This happens when the length of the payload vector is shorter than the length indicated in the payload header. int acpErrValid; //!< 1 if ACP results are valid. Otherwise, it will be 0. char *acpErrMsg; //!< Text string reporting error for ACP calc iqapiMeasurement *maxPowerAcpDbm; //!< Reports max power in 1 MHz bands at specific offsets from center frequency. The offset in MHz is given in sequenceDefinition. Method according to 5.1.8 TRM/CA/06/C iqapiMeasurement *maxPowerEdrDbm; //!< Reports max power in 1 MHz bands at specific offsets from center frequency. The power at 0 MHz offset and +/-1 MHz offset is calculated differently from above. maxPowerEDRdBm follows 5.1.15 TRM/CA/13/C iqapiMeasurement *meanNoGapPowerCenterDbm; //!< Mean power in 1 MHz band. Is no gap power, i.e. only averaged when signal exceeds threshold iqapiMeasurement *sequenceDefinition; //!< Offset in MHz for results in maxPowerACPdBm and maxPowerEDRdBm }; // **************************************************************** // Data Capture Class // **************************************************************** //! Specifies parameters to capture a signal. class IQ_API iqapiCapture : public iqapiSignalData { public: iqapiCapture(void); //!< Constructor ~iqapiCapture(void); //!< Destructor //Copy constructor iqapiCapture(const iqapiCapture &src); //!< A Copy Constructor that can be used to make a deep copy of an iqapiCapture object. Use this constructor when you wish to create a copy of an iqapiCapture object. iqapiCapture & operator = (const iqapiCapture & src); ////int length[N_MAX_TESTERS]; //!< This integer array represents the length of the real and imag vectors described below (one integer for each VSA in the LitePoint Test Instrument(s)). Length[0] indicates the length of \c real[0] and \c imag[0] and is the sample data returned from the first VSA (0). ////double *real[N_MAX_TESTERS]; //!< This double pointer array represents the (real) sample data captured on each VSA. The length of real[x] is indicated by length[x], where x is the VSA number (minus one). ////double *imag[N_MAX_TESTERS]; //!< This double pointer array represents the (imaginary) sample data captured on each VSA. The length of imag[x] is indicated by length[x], where x is the VSA number (minus one). ////double sampleFreqHz[N_MAX_TESTERS]; //!< This double array represents the sample frequency of real and imag. sampleFreqHz[x] is the sampling rate of real[x] and imag[x], where x is the VSA number (minus one). int adc_clip[N_MAX_TESTERS]; //!< This integer array indicates whether or not clipping occurred during the data capture stored in \c real and \c imag. \c adc_clip[x] indicates clipping in \c real[x] and \c imag[x], where x is the VSA number (minus one). // Text of last error char lastErr[MAX_LEN_ERR_TXT]; //!< Saves the iqapiCapture object to a \c .sig file, (set by filename) which can be read and analyzed by IQsignal for MIMO. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). int Save(char *fileName) { return Save(fileName, IQV_DATA_IN_IQAPI); }; int Save(char *fileName, IQV_CAPTURE_DATA_HANDLING_ENUM captureDataHandling); //!< Saves the captured signal in a file (.sig) int SaveNormalize(char *fileName, IQV_CAPTURE_DATA_HANDLING_ENUM captureDataHandling = IQV_DATA_IN_IQAPI, int lengthOfNormFactorDb=0, double *normFactorDb=NULL); //!< Saves normalized captured signal to a file (typically, a \c .mod file); this file can be used as a generator file to download to the VSG. /*! Displays the signal contents of an \c iqapiCapture object during the debug and development phases. The data will first be converted to dBm before plotting. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int PlotPower(int figNum, char *plotArgs, int vsaNum); /// Internal use void SetCaptureType(IQV_CAPTURE_TYPE_ENUM capType); IQV_CAPTURE_TYPE_ENUM GetCaptureType(); double reserved[3]; private: int Save(char *fileName, enum IQV_SAVE_FILE_TYPE_ENUM eFileType, IQV_CAPTURE_DATA_HANDLING_ENUM captureDataHandling = IQV_DATA_IN_IQAPI, int lengthOfNormFactorDb=0, double *normFactorDb = NULL); IQV_CAPTURE_TYPE_ENUM captureType; }; // **************************************************************** // VSG Parameters Class - applies individually to each test system. // **************************************************************** //! Specifies transmitter parameters that are specific for each Vector Signal Generator. class IQ_API iqapiVsg { public: iqapiVsg(void); //!< Constructor ~iqapiVsg(void); //!< Destructor IQV_RF_ENABLE_ENUM enabled; //!< Enables or disables RF /*!< Available options are as follows; IQV_RF_DISABLED indicates that the RF is disabled. IQV_RF_ENABLED indicates that the RF is enabled */ IQV_PORT_ENUM port; //!< Represents RF N-connector port selection /*!< Available options are as follows: IQV_PORT_OFF = 1 indicates that the port is disabled. IQV_PORT_LEFT = 2 indicates that the RF uses the left port. IQV_PORT_RIGHT = 3 indicates that the RF uses the right port. */ IQV_SOURCE_ENUM source; //!< Represents the signal source of all VSGs. /*!< IQV_SOURCE_WAVE represents internal modulation from wave. IQV_SOURCE_SIGNAL_GENERATOR represents internal modulation from CW signal generator. IQV_SOURCE_UNDEFINED represents undefined default modulation source. */ double sineFreqHz;//!< This field represents the VSG signal generator's sine wave frequency. Only applies if source is set to IQV_SOURCE_SIGNAL_GENERATOR. double rfGainDb; //!< Represents RF gain in dB. double bbGainDb; //!< Represents BB gain in dB. double dcErrI; //!< Represents signal modulation DC offset (I Channel) double dcErrQ; //!< Represents signal modulation DC offset (Q Channel) double phaseErr; //!< Represents signal generator's phase error double gainErr; //!< Represents signal generator's gain error double delayErr; //!< Represents signal generator's delay error double cmvI; //!< Represents common mode voltage setting for the I channel double cmvQ; //!< Represents common mode voltage setting for the Q channel int powerOutOfRange;//!< Flag that indicates if VSG power level set by user is outside of valid range double fpgaLoadCalTable; //!< Specifies values for loading FPGA calibration table /*!< This parameter applies to the LitePoint test system hardware versions 1.6.x version or higher. \param[in] 0=Uses middleware compensation method; calibration is always available \param[in] 1=Uses FPGA real-time compensation; calibration may not be available \return 0=Tables have been downloaded \return -1=Tables are not available */ iqapiMeasurement *timeGapUpSec; //!< Position(s) in downloaded waveform where power should be turned on (in seconds) /*!< This is typically at the beginning of a packet; applies only if \c tx.gapPowerOff is true */ iqapiMeasurement *timeGapDnSec; //!< Position(s) in downloaded waveform where power should be turned off (in seconds) /*!< This is typically at the end of a packet; applies only if \c tx.gapPowerOff is true */ IQV_MIRROR_FREQ_ENUM mirrorFreq; // Added for 1.3.2.3 }; // **************************************************************** // Tx Parameters Class - applies to all test systems (except member vsg) // **************************************************************** //! Specifies parameters for transmitting signals. class IQ_API iqapiTx { public: iqapiTx(void); //!< Constructor ~iqapiTx(void); //!< Destructor IQV_INPUT_MOD_ENUM txMode; //!< Represents the VSG signal transmission mode /*!< Available options are as follows: IQV_INPUT_MOD_DAC_RF indicates RF transmit mode IQV_INPUT_MOD_DAC_BB indicates BB transmit mode IQV_INPUT_MOD_UNDEFINED indicates an undefined default value */ double rfFreqHz; //!< This field represents the RF frequency for the VSGs,in Hz. /*!< For IQview/flex/nxn systems valid values are in the 2.4 and 4.9-6.0 GHz ranges, in increments of 1 MHz. */ double sampleFreqHz; IQV_MODULATION_CONTROL_ENUM modulationMode; //!< Represents VSG modulation mode. /*!<Available options are as follows: IQV_WAVE_DL_MOD_DISABLE indicates that the modulation is halted after the wave file is downloaded unless it is in continuous Tx mode. IQV_WAVE_DL_MOD_ENABLE indicates that modulation is continued after the wav file is downloaded */ iqapiVsg *vsg[N_MAX_TESTERS]; //!< Represents individual VSG parameters IQV_GAP_POWER gapPowerOff; //!< Controls VSG power during signal gaps (idle time) /*!< Used for backward compatibility */ IQV_ALC_MODES alcMode; //!< Automatic level control IQV_VSG_TRIG triggerType;//!< VSG trigger IQV_VSG_TRIG_REARM triggerReArm; //!< Indicates if VSG needs to be re-armed after the trigger event double freqShiftHz; //!< Tx IF Frequency in Hz /*!< Before downloading to the VSG, the waveform is shifted by the indicated value in Hz; this can be used to get higher resolution on systems that support only 1 MHz resolution */ IQV_LO_PORT_ENUM c_loRfPort; //!< Indicates ENUM value for RF LO port /*!<RF LO is available for hardware versions 1.6.2 and higher */ IQV_LO_PORT_ENUM c_loIfPort; //!< Indicates ENUM value for IF LO port double waveIntervalSecs; //!< Used for padding the wave with zero by the \c waveIntervalSecs time; /*!<The default value is 0 */ }; // **************************************************************** // VSA Parameters Class - applies to each test system individually // **************************************************************** //! Specifies receiver parameters that are specific for each Vector Signal Analyzer. class IQ_API iqapiVsa { public: iqapiVsa(void); //!< Constructor ~iqapiVsa(void); //!< Destructor IQV_RF_ENABLE_ENUM enabled; //!< Specifies whether VSA RF input is enabled or disabled /*!< Available options are as follows: IQV_RF_DISABLED indicates that RF is disabled. IQV_RF_ENABLED indicates that RF is enabled. */ IQV_PORT_ENUM port; //!< Represents RF N-connector port selection /*!< Available options are as follows: IQV_PORT_OFF = 1 indicates that the port is disabled. IQV_PORT_LEFT = 2 indicates that the RF uses the left port. IQV_PORT_RIGHT = 3 indicates that the RF uses the right port. */ double rfAmplDb; //!< Represents the RF amplitude in dBm /*!< \note This parameter replaces the \a rfGainDb; parameter. */ double bbAmplDbv; //!< Represents the Baseband amplitude in dBV double bbGainDb; //!< Represents baseband gain in dB. IQV_MIRROR_FREQ_ENUM mirrorFreq; //!< Mirrors the center frequency in the frequency spectrum of the captured signal. Calculates the complex conjugate of the signal /*!< Available options are as follows: IQV_MIRROR_FREQ_DISABLED indicates that mirror frequency spectrum is disabled. IQV_MIRROR_FREQ_ENABLED indicates that mirror frequency spectrum is enabled. */ double extAttenDb; //!< Represents external attenuation in dB. }; // **************************************************************** // Rx Parameters Class - applies to all test system (except member vsa) // **************************************************************** //! Specifies parameters for receiving the signal. class IQ_API iqapiRx { public: iqapiRx(void); //!< Constructor ~iqapiRx(void); //!< Destructor IQV_INPUT_ADC_ENUM rxMode; //!< Capture mode for the VSAs. /*!< This field represents the capture mode for the VSAs. Available options are as follows: IQV_INPUT_ADC_RF, which represenst data captured from RF IQV_INPUT_ADC_BB, which represents data captured from base band IQV_INPUT_ADC_UNDEFINED, which represents undefined default value IQV_GET_RAW_DATA = -2, which represents getting the raw data with no compensation */ double rfFreqHz; //!< This field represents the RF Frequency for the VSAs,in Hz. /*!< For IQview/flex/nxn systems valid values are in the 2.4 and 4.9-6.0 GHz ranges, in increments of 1 MHz. */ double freqShiftHz; //!< This field represents the Rx IF frequency in Hz /*!< After capturing by the VSA(s), the signal is shifted by the indicated value; this can be used to analyze signals at intermediate frequencies not directly supported by the instrument */ /*Rx Intermediate Frequency for all VSAs*/ double samplingTimeSecs; //!< Sampling time, in seconds, for all VSAs. double sampleFreqHz; //!< ADC sampling frequency in Hz, for all VSAs. Recommended frequency is 80 MHz. IQV_TRIG_TYPE_ENUM triggerType; //!< This field represents the trigger type used for the VSA master. /*!<The VSA slaves (including the VSG master), are always triggered by the VSA master. */ double triggerLevelDb; //!< Signal (IF) trigger level in dB, relative to VSA master's \c rfAmplDb setting. double triggerPreTime; //!< Amount of data to capture before the trigger point, in seconds. double triggerTimeOut; //!< Trigger timeout in seconds. iqapiVsa *vsa[N_MAX_TESTERS]; //!< Parameters unique to each vsa IQV_RX_POWER_MODES powerMode; //!< Represents the AGC power mode. /*!< IQV_VSA_TYPE_0, where VSA Type 0 is the default value and represents RMS Power Mode. IQV_VSA_TYPE_1, where VSA Type 1 is the recommended value and represents Peak Power Mode. */ }; //! Specifies parameters for the signal frequency range. struct IQ_API iqapiFreqBands { double freqMin; //!< Indicates minimum signal frequency double freqMax; //!< Indicates maximum signal frequency }; //! Specifies parameters for VSA and VSG calibration; middleware table. class IQ_API mwTable { private: double *table; int numberOfRow; int numberOfCol; public: mwTable(); //!< Constructor ~mwTable(); //!< Destructor void SetTable(double *tbl); void SetNumberOfRow(int numOfRow) { numberOfRow = numOfRow; }; void SetNumberOfCol(int numOfCol) { numberOfCol = numOfCol; }; const double *GetTable() { return table; }; int GetNumberOfRow() { return numberOfRow;}; int GetNumberOfCol() { return numberOfCol;}; }; class IQ_API DualHead : public DualHeadBase { public: DualHead(iqapiHndlBase *hndl); ~DualHead(); bool SetToken (unsigned int token, unsigned int value); unsigned int GetToken (unsigned int token); void DoTesterExtraSetting(); }; // **************************************************************** // iqapi API Handle Class - Main Object // **************************************************************** //! Specifies parameters to control the test system hardware, perform signal analysis and generate waveform data. class IQ_API iqapiHndl : public iqapiHndlBase { private: int A21SequenceLimitation; public: iqapiHndl(void); //!< Constructor ~iqapiHndl(void); //!< Destructor // **************************************************************** // Connection Handling Functions // **************************************************************** int ConInit(char *ip1, IQV_CONNECTION_TYPE connectionType = IQV_CONNECTION_OTHER); //!< Connects to and initializes a single test system. /*!<Initializes a connection to a test system. The input must be a valid IP address, such as 192.168.100.254. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int ConInit(char *ip1, char *ip2); //!< Connects to and initializes two test systems. /*!<Initializes a connection to a test system unit that contains two IQnxn test systems. The input must be a valid IP address such as 192.168.100.254. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int ConInit(char *ip1, char *ip2, char *ip3);//!< Connects to and initializes three test systems. /*!< Initializes a connection to a test system unit that contains three IQnxn test systems. The input must be a valid IP address such as 192.168.100.254. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int ConInit(char *ip1, char *ip2, char *ip3, char *ip4); //!< Connects to and initializes four test systems. /*!< Initializes a connection to a test system unit that contains four IQnxn Test Instruments. The input must be a valid IP addresses such as 192.168.100.254. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int ConOpen(char *ip1=NULL, char *ip2=NULL, char *ip3=NULL, char *ip4=NULL, IQV_CONNECTION_TYPE connectionType = IQV_CONNECTION_OTHER); //!< Connects to or reconnects to the test systems. /*!< Reopens a connection to a test system which was previously established using the \c ConInit() function. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). \note Entering IP addresses is optional. If the IP address has been provided previously by the \c ConInit() function, then you do not have to enter the IP address. */ int ConClose(); //!< Closes one or more connections to the test systems. /*!< Closes a connection to a test system which was previously established with the \c ConInit function or opened with the \c ConOpen() function. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ bool ConValid(); //!< Indicates valid, open connection. /*!< Checks the validity of a connection to a test system. This function returns a value of true if the connection is open and valid, or false if the connection is closed or invalid. */ // Reserved for future use - DO NOT USE int ConInit2(char *ip1); //!< Connects to and initializes a single test system. This function is reserved for internal use. int ConInit2(char *ip1, char *ip2); //!< Connects to and initializes two test systems. This function is reserved for internal use. int ConInit2(char *ip1, char *ip2, char *ip3); //!< Connects to and initializes three test systems. This function is reserved for internal use. int ConInit2(char *ip1, char *ip2, char *ip3, char *ip4); //!< Connects to and initializes four test systems. This function is reserved for internal use. // End Reserved int GetAllVersions(char *version, int versionSize); //!< Gets all versions related to software and hardware of the test system int GetIqapiVersion(char *version, int versionSize); int GetHardwareVersion(char *buff, int bufflen); //!< Gets the hardware version of the test system. int GetFirmwareVersion(char *buff, int bufflen);//!< Gets the firmware version of the test system. int GetCalibrationDate(char *buff, int bufflen);//!< Gets the calibration date of the test system. int GetSerialNumber(char *buff, int bufflen); //!< Gets the serial number of the tester. buffer length has to be at least 9 in length. ex.: IQP00100 int IsAppLicSupported(char *AppLicNameToCheck, int *iSupport); //!< Checks if application license is valid /*!< The description of parameters is as follows: \n \c AppLicNameToCheck&mdash; checks the documentation for the name of an application license. \c WIMAX_CPP_API is an example of a name of an application license \n \c iSupport&mdash; indicates whether or not license is available \n 0=License is available \n 1=License is not available */ // **************************************************************** // Set-up and Configuration Functions // **************************************************************** int SetDefault();//!< Resets and initializes test systems /*!< Resets a test system, and initializes the associated objects in an \c iqapiHndl object. The test system and software are set to default conditions. \note This function does not have to be called after calling the \c ConInit() function. The \c ConInit() function resets and initializes the test system and therefore the SetDefault() function does not have to be called after calling the SetInit() function. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int SetTx(); //!< Sets Tx configuration /*!< Applies Tx settings to a test system, as configured in the \c iqapiTx object in \c iqapiHndl (\c hndl->tx). This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int SetRx(); //!< Sets Rx configuration /*!< Applies Rx settings to a test system, as configured in the \c iqapiRx object in \c iqapiHndl (\c hndl->rx). This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int FrameTx(int numFrames); //!< Starts frame Tx mode for the number of frames indicated in the \c numFrames parameter /*!< Transmits the number of frames indicated in the \c numFrames parameter from the test system VSG. \n The \c numFrames parameter can have an integer value between 1 and 65534. \n If \c numFrames=0, then the VSG resumes continuous transmission. \n This function returns a value of 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int GetStatus(); //!< Retrieves hardware status from the test system. /*!< Retrieves the current hardware status of a test system. The hardware-related objects in \c iqapiHndl will become updated with the current settings on the hardware. This could be used, for instance, to detect if another application has changed some settings on the system. This function returns a value of 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ bool TxDone(int *errCode); //!< Indicates if the frame Tx mode is complete /*!< Retrieves the current Tx status of the VSGs in the test systems. This function returns true if a \c FrameTx() operation is done, or false if the VSGs are still transmitting (which will be the case during continuous Tx). The integer pointed to by \c errCode will become updated with the current error level, 0, (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int Agc(bool AgcAll); //!< Performs autorange, optionally, individually for all test systems. /*!< Performs automatic gain control (AGC) on the VSAs in a test system. The \c iqapiRx objects of an \c iqapiHndl will get updated with the new settings, if successful. Setting the \c AgcAll value to \c TRUE causes an AGC to be performed on all the VSAs in the system; a value of \c FALSE causes an AGC to be performed only on the VSA Master. The remaining IQnxn Test Instrument VSAs will be set to the same value as the VSA Master. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer) */ int SetTxRx(); //!< Sets Tx and Rx configurations /*!< Applies Tx and Rx settings to a test system, as configured in the \c iqapiTx and \c iqapiRx objects in \c iqapiHndl (\c hndl->tx and \c hndl->rx). This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ // **************************************************************** // Wave Generation and Downloading Functions // **************************************************************** int GenerateWave(iqapiWaveGenParms *waveGen); //!< Generates Tx modulation waveform /*!< Generates modulation data to be downloaded to the VSGs in a test system. If successful, the \c iqapiModulationWave object in \c iqapiHndl (hndl->wave) gets updated with the waveform data specified by the configuration in the \c waveGen parameter. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int SetWave(iqapiModulationWave *modWave = NULL); //!< Downloads waveform to the VSG using data generated by the GenerateWave() function /*!< Downloads the \c iqapiModulationWave object currently pointed to by the \c hndl->wave object, to the VSGs in a test system. \note If the number of streams is less than the number of test systems, zeros will be downloaded to the remaining VSG test system. Also, if the number of streams is greater than the number of test systems, the remaining streams will be ignored in the download. This function supports legacy IQview software \c .mod files as well as the IQapi software \c .mod files. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int SetWave(char *fileName); //!< Downloads waveform data to VSG loaded from a file /*!< Performs the same operations as \c SetWave, and additionally sets marker information in the VSG. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int SetWaveWithSegments(char *fileName); // **************************************************************** // Multi-wave add, download, select Functions // **************************************************************** int MultiWaveAddByFile(char *fileName, int *index); //!< Adds a waveform from a modulation file to cache int MultiWaveAddCw(double frequency, int *index, double*frequencyActual);//!< Adds a continuous waveform to cache int MultiWaveAddByWave(iqapiModulationMultiWave *multiwave, int *indexWave);//!< Adds a waveform from RAM to cache int MultiWaveDownload(); //!< Downloads a multi-waves from cache to active memory int MultiWaveSelect(int index); //!< Selects a waveform by index int MultiWaveClear(); //!< Clears all the cached waveforms; does not clear the waveform running on the VSG int MultiWaveGetDescription(); //!< Gets the description of the multiwave waveform int mulWaveDescNumOfWave; //!< Indicates description of the number of multiwaves double *mulWaveDescMenuIndexes; //!<Indicates the description of the menu indexes char mulWaveDescFull[32][256]; //!< Indicates description of the multiwave waveform char mulWaveDescMenuTxt[32][256]; //!< Indicates description of the menu text char mulWaveDescWaveName[32][256]; //!< Indicates description of the name of the multiwave waveform // **************************************************************** // Data Capture and Analysis Functions // **************************************************************** int Capture(); //!< Performs a data capture /*!< Performs a data capture using the current settings applied in \c hndl->rx. If successful, \c hndl->data will point to an \c iqapiCapture object which contains the sample data. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int Capture(int vsaNum); //!< Performs a data capture on a single VSA in an IQnxn test system configuration /*!< In an IQnxn configuration, this function performs a data capture using the current settings applied in a \c hndl->rx object, on only the requested VSA (as specified by \c vsaNum). If successful, the \c hndl->data object will point to an \c iqapiCapture object which contains the sample data. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int Capture(double sampleTimeSecs) //!< Performs a data capture of length indicated in the \c sampleTimeSecs parameter /*!< This function is implemented in the header file, and calls \c Capture(), but sets the sampling time first. */ { rx->samplingTimeSecs = sampleTimeSecs; SetRx(); return (Capture()); } // int Capture(iqapiCapture *userData); //!< Performs a data capture using the current settings applied to the \c hndl->rx object /*!< Performs a data capture using the current settings applied in \c hndl->rx. If successful, userData will point to an iqapiCapture object which contains the sample data. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer) \note \c userData must be created before calling this function. */ int ContCapture(IQV_DC_CONT_ENUM mode, int vsaNum = 1); //!< Performs continuous data capture modes; this function is reserved for future use int Analyze(iqapiSignalData *userData); //!< Analyzes the data from the user using the current settings /*!< Performs analysis on the \c iqapiCapture object pointed to by \c userData, using the analysis parameters pointed to by the \c hndl->analysis object. If successful, the \c hndl->results object will point to a result object (derived from iqapiResult) of the type specified by the \c hndl->analysis object. For instance, if after a data capture \c hndl-analysis points to an \c iqapiAnalysisOFDM object, \c hndl->analyze object will cause \c hndl->results object to point to an object of type \c iqapiResultOFDM. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int Analyze(); //!< Analyzes the current capture buffer using the current settings /*!< Performs analysis on the \c iqapiCapture object pointed to by the \c hndl->data object, using the analysis parameters pointed to by the \c hndl->analysis object. If successful, the \c hndl->results object will point to a result object (derived from the \c iqapiResult object) of the type specified by the \c hndl->analysis object. For instance, if after a data capture the \c hndl-analysis object points to an \c iqapiAnalysisOFDM object, the \c hndl->analyze object will cause the \c hndl->results object to point to an object of type \c iqapiResultOFDM. This function returns 0 (IQAPI_ERR_OK) if successful; if it returns a value that is less than 0, then it indicates a warning and if it returns a value that is greater than 0, then it indicates an error (see IQAPI_ERR_CODES, or the \c hndl->lastErr buffer). */ int LoadSignalFile(char *fileName); //!< Loads a signal file int AnalyzeFftWide(double centerFrequency, double dbResolutionBW = 1e5, char *pcWindowType = "hanning", double offsetFreq = 50e6); //!< Performs a 120 MHz wide FFT measurement using three captures. The frequency of the middle capture is the value of the \c centerFrequency parameter /*!< The \c hndl->results object points to the \c analysisFFT object if successful */ // **************************************************************** // Multiport Test Adaptor Functions // **************************************************************** int MptaEnable(void); //!< Enables MPTA control int MptaDisable(void); //!< Disables MPTA control int MptaSetupSwitchCapture(MPTA_TX_TEST *tx_test); //!< Performs Sequential MIMO setup and capture int MptaSwitchCapture(void); //!< Performs Sequential MIMO capture only int MptaSetAttn(int port, double attn_dB, double freq_Hz, double *attnError = NULL); //!< Sets attenuation value to individual ports (0-3), and returns attenuation error int MptaSetAttn(double attn_dB, double freq_Hz, double *attnErrors = NULL ); //!< Sets attenuation value to all ports and returns attenuation error double MptaRxPer(MPTA_RX_TEST *rx_test); //!< Performs Rx PER test at specified signal level and returns a PER % value (0-100) double MptaRxSens(MPTA_RX_TEST *rx_test); //!< Performs sensitivity level test and returns sensitivity value (dBm) void MptaPrintDebug(bool bEnable); void MptaExtTrigger(double fTriggerLevel, double fFreq); bool MptaGetSerialNumber(char *serialNumber, int bufSize); //!< Gets serial number for all the connected devices int MptaGetNumberOfDevice(); //!< Gets number of devices (reserved for future use) bool MptaGetSettings(int port, double *attn_dB, double *freq_Hz, double *attnError); //!< Gets setting (attenuation, frequency and attenuation error) for the active device bool MptaSetActiveA21(const char *serialNumber); //!< Sets active A21 bool MptaAvailable(); //!< Checks if MPTA is available or not void MptaInit(bool createA21); //!< Initializes a flag that controls if the A21 control should be created or not during the connection initialization using \c ConInit /*!< \note If this function is not called, the default value of \c createA21Flag is true => A21 control will be created during ConInit(...) */ // **************************************************************** // iqapiHndl Misc Functions // **************************************************************** int MiscReqParm(char *parm, char *buff, unsigned int buff_len, int *ack = NULL, int testerNumber = 1);//!< This function is reserved for internal use int MiscSendCmd(char *cmd, int testerNumber = 1); //!< This function is reserved for internal use int MiscCmd(char *cmd, double input, double *output); //!< This function is reserved for internal use int MiscCmdLocalStatus(char *cmd, double input, double *output); //!< This function is reserved for internal use int MiscCmdNoStatus(char *cmd, char *input, char *output, unsigned int outputSize); //!< This function is reserved for internal use int MiscMwCmd(char *cmd, int index=-1, double value=-1); //!< This function is reserved for internal use bool IsHardwareVersion(IQV_HARDWARE_VERSION_ENUM hardwareVersion); //!< Check hardware version int CleanWave(double frameLenSec); //!< Saves clean \c *.mod file for WiMAX /*!< Saves the signal that was generated from the analysis results of a previously run Analyze() function call. This function works for WiMAX only. The \c frameLenSec &mdash; parameter specifies frame length of the generated waveform. */ int ExportPayload(char *fileName, char *type); //!< Exports pay load for different wireless standards. The \c Analyze() function must be called before calling this function. /*!< The parameter values are as follows: \n \c fileName &mdash; indicates the name of the file the user wants the payload to be written to. \n \c type &mdash; indicates the type of wireless standard. Supported wireless standards are as follows: \n OFDM (for 802.11 a/g) \n 802.11 n \n 802.11 b \n 80216-2004 \n 80216e-2005 \n Bluetooth */ int ExportSymbolData(char *fileName, bool binaryFormat); //!< Exports symbol data per subcarrier for WiMAX. The \c analysis function must be called before calling this function /*!< The parameter values are as follows: \n \c fileName &mdash; indicates the name of the file the user wants the symbol data to be written to. \n \c binaryFormat &mdash; indicates a value of "TRUE" or "FALSE" */ // **************************************************************** // iqapiHndl Firmware server // **************************************************************** // char serialNumber[SERIAL_NUMBER_LEN +1]; char pbPort[6]; int DeviceDiscover(char *SerialNumbers, int bufLen); // **************************************************************** // iqapiHndl Member Variables // **************************************************************** iqapiRx *rx; //!< Indicates test system Rx and VSA settings /*!< Represents the Rx settings in test system. The top level members represent parameters that apply to all VSAs in a test system. Members of the VSA object array apply uniquely to each test unit within a test system. */ iqapiTx *tx; //!< Indicates test system Tx and VSG settings /*!< Represents the Tx settings in a test system. The top level members represent parameters that apply to all VSGs in a LitePoint Test Instrument. Members of the vsg object array apply uniquely to each test unit within a test system. */ iqapiCapture *data; //!< Indicates local data capture storage /*!< Stores captured sample data and is used as input to the analysis functions. */ iqapiAnalysis *analysis; //!< Indicates local analysis parameters /*!< Performs a specific type of analysis and returns a specific type of analysis result; used by \c hndl->Analyze(). \note The \c iqapiAnalysis is a base class for the various Analysis classes and should NOT be used directly. */ iqapiResult *results; //!< Indicates local measurement results. /*!< If a call to \c hndl->Analyze() function is successful, the \c hndl->result object will point to a derived \c iqapiResult class. \note the \c iqapiResult object is a base class for the various Result classes and should NOT be used directly. */ iqapiModulationWave *wave; //!< Indicates local modulation wave for the VSG. /*!< If a call to a \c hndl->GenerateWave() function is successful, the \c hndl->wave object will point to an \c iqapiModulationWave object which will be used in a call to the \c hndl->SetWave() function. */ int nTesters; //!< Indicates number of connected test systems. /*!< This field indicates the number of test systems to which a connection is open. This field should not be changed by the user. */ // Defined in iqapiHndlBase: char lastErr[MAX_LEN_ERR_TXT]; //!< Indicates the last error message text. /*!< This field acts as an error buffer, containing the last error message generated by the API. It is useful during debug, when the error code does not (by itself) give enough information. The exact error is often described in this field. */ int connectionNumber; //!< Indicates connection number IQV_CAPTURE_DATA_HANDLING_ENUM captureDataHandling; //!< Indicates captured data. /*!< IQV_DATA_IN_MATLAB&mdash;In some cases, the user does not have to pass the data back from MATLAB to the \c iqapi function to test the application. To save time, the captured data is stored in MATLAB. All subsequent operations will be carried out on the captured data in MATLAB. \n IQV_DATA_IN_IQAPI&mdash;After data capture, a copy of the captured data can be obtained from the \c iqapi function in the object \c data */ int UnpackMeasurements(void *mx_result_in, bool skipCreateResult = false); //!< This function is reserved for internal use int SetApiMode(const char *key); //!< Internal use // Use with MiscMwCmd. mwTable calVsaTable; mwTable calVsgTable; char hwVersion[4]; //!< Hardware version number ///HT40Capture private: //Perform HT40 analysis: int AnalyzeHT40(); // available vsa frequency band from test system iqapiFreqBands vsaFreqBands[NUMBER_OF_FREQ_BAND]; public: //Perform combined data capture (HT40 capture): int Capture(IQV_CAPTURE_TYPE_ENUM captureType); //!< Use to capture HT40 int IsUsbConnected(); //!< Indicates that test system is connected via USB int IsLicenseAvailable(IQV_LICENSE_TYPE licenseType, bool *returnResult); //!< Checks if license is available int GetTesterFreqBand(IQV_FREQUENCY_BAND whichFreqBand, iqapiFreqBands *freqBands, unsigned int numberOfFreqBand); //!< Gets frequency band of the test system void SetLpcPath(char *litePointConnectionPath); //!< Set the path that is used to invoke LitePoint Connectivity server. Note: this LPC server is used to invoke fw_server.exe and GF_fwserver.exe for IQ201x in the same folder as LPC server char *GetLpcPath(); //!< Get the path that is used to invoke LitePoint Connectivity Server. int GetTemperature(IQV_VSA_NUM_ENUM vsaNum, double *paTemperature, double *ifTemperature, double *swTemperature, double *vsaGainTemperature, double *vsgGainOffsetTemperature); int UnpackTemperature(void *mx_result_in, double *paTemperature, double *ifTemperature, double *swTemperature, double *vsaGainTemperature, double *vsgGainOffsetTemperature); public: // **************************************************************** // Internal use functions // **************************************************************** int GetTxRfFreqHz(double *txRfFreqHz); //!< Get the current transmiter frequency // **************************************************************** // Private iqapiHndl Members // **************************************************************** private: bool connected; int DoConInit(char *ip1, char *ip2, char *ip3, char *ip4); int UnpackVsaVsg(void *mx_result); int PackVsaVsg(void **mx_input_in, void **mx_tx_in, void **mx_rx_in, void **mx_vsg_in, void **mx_vsa_in); int UnpackCapture(void *mx_result_in, bool UnpackCon = true, bool fromCapture = true, IQV_CAPTURE_DATA_HANDLING_ENUM captureDataHandling = IQV_DATA_IN_IQAPI, iqapiCapture *userData = NULL); int UnpackSingleCapture(void *mx_result_in); int PackCaptureAndAnalysis(void **mx_input_in, void **mx_dataCapture_in, void **mx_analysis_in, iqapiSignalData *userData = NULL); int PackWaveParams(void **mx_input_in, void **mx_params_in, void **mx_psdu_in, iqapiWaveGenParms *params); int UnpackModulationData(void *mx_result_in, iqapiModulationWave *wave); char *masterIP; int DoConInit2(char *ip1, char *ip2, char *ip3, char *ip4); int InvokeFWServerAndGetLocalIP(const char *ip1, char *LocalIPWithPort); int InvokeLPCServerAndGetLocalIP(char *ip1, char *sn1, char *ipWithPort, int sizeIpWithPort); int PrecheckTxRx(); int GetTesterInfo(char *testerCommand, char **unscrambleData); int Unscramble(char *scrambleData, char* unscambleData, unsigned int bufSize); int CreateFreqBand(const char *const unscrambleData, iqapiFreqBands *freqBands); void ResetLastErr(); int CheckVersion(WHAT_VERSION_TO_CHECK versionToCheck); int CheckVersionFw(WHAT_VERSION_TO_CHECK fwVersionToCheck); int CheckVersionFpga(WHAT_VERSION_TO_CHECK fwVersionToCheck); CA21Control *a21; bool createA21Flag; char *lpcPath; public: DualHead *pDualHead; //!< Dual head object for Wifi/BT/Wimax }; // Composite Reference Generation Function IQ_API int iqapiFindPsduDataRef(iqapiResultMimo *SigData, iqapiResultFindPsduDataRef *resultFindPsduDataRef, bool init); //!< Finds PSDU of data reference of composite MIMO // Composite Reference Generation Function IQ_API int iqapiWritePsduDataRef(char *txtFileName); //!< Exports PSDU data reference // Composite Reference Generation Function IQ_API int iqapiWriteDataRef(char *txtFileName, char *refFileName, char *type, int mcsIndex, IQV_MIMO_BANDWIDTH_MODES bw); //!< Exports data reference IQ_API int iqapiSaveMapConfigFile(char *mcfFileName); //!< Saves map configuration file
[ "thiru@thiru-desktop.(none)" ]
thiru@thiru-desktop.(none)
9d51be50491d58849dd72b38789d470293d13d74
c2a55f3b93300b99181a5aa29b2dfad2f2de701e
/Neural Network/src/facedetection.cpp
f75b252f3464fbd2de3c98e90ea2194b777ee4f4
[]
no_license
someideal/smartshoot
26c4c35f836919121ec907e8f27772a7226a0068
a83af09cd640ab58f98b5781918cb9afb751f764
refs/heads/master
2020-05-17T05:38:10.277125
2015-01-20T12:07:24
2015-01-20T12:07:24
25,111,221
0
0
null
null
null
null
UTF-8
C++
false
false
2,749
cpp
#include "../include/facedetection.h" using namespace cv; Mat facedetection::getFace(int index) { if(index>=0 &&index <catchedNum) {return reSize(_img_grey(faceRect[index]));} else{ return porkerFace; } } DETECT_RESULT facedetection::run(Mat *input,Mat *output) { vector<Rect> faceRectLocal; if (input==NULL ) { if(!input->data) { return ERROR;} return ERROR; } switch(mode){ case SUSPEND_MODE: return ERROR; case IMG_MODE: break; case VIDEO_MODE:break; default: ; } cvtColor(*input,_img_grey,CV_RGB2GRAY); equalizeHist(_img_grey,_img_grey); /* imshow("face",_img_grey); waitKey(0);//*/ //double scaleFactor=1.1;int minNeighbors=3;int flags=0; if(faceCascade.empty()){ return ERROR; } Size minSize(30,30) ;Size maxSize(3,3); // faceCascade.detectMultiScale(_img_grey,faceRectLocal, 1.1, 2, 0 |CASCADE_SCALE_IMAGE,Size(0, 0) ,Size(1, 1) ,); faceCascade.detectMultiScale(_img_grey,faceRectLocal, 1.1, 2, 0 |CASCADE_SCALE_IMAGE ,minSize); //|CASCADE_FIND_BIGGEST_OBJECT //|CASCADE_DO_ROUGH_SEARCH faceRect = faceRectLocal; catchedNum=faceRect.size(); if(catchedNum != 0 ) { if(output!=NULL) { *output=reSize(_img_grey(faceRect[0]),125); } return CATCHED; } else{ return NONE; } } Mat facedetection::reSize(Mat img,size_t sz) { Mat output; if(img.data && sz >0 && sz<=2048){ resize( img, output, Size(sz, sz), 0, 0, INTER_LINEAR); return output; }else{ return porkerFace; } } facedetection::facedetection() { catchedNum=0; cascadeFacePath="/root/downloads/opencv-3.0.0-beta/data/haarcascades/haarcascade_frontalface_alt.xml"; mode=SUSPEND_MODE; init(); } facedetection::~facedetection() { } bool facedetection::init() { if(!faceCascade.load(cascadeFacePath)){ mode=SUSPEND_MODE; return false; } else{ mode=IMG_MODE; return true; } }
[ "anywriting@163.com" ]
anywriting@163.com
a717cabb75c5a5d9671f11a523b565710362ad6e
1bbfeca83bac53d22b1110ca7f6c9a28bc46c22e
/ru-olymp-train-winter-2007/Submits/070119p/18_42_20_08_B_6120.CPP
c5bc5a8ed0127c6fd96630c371291b1bc2527189
[]
no_license
stden/olymp
a633c1dfb1dd8d184a123d6da89f46163d5fad93
d85a4bb0b88797ec878b64db86ad8ec8854a63cd
refs/heads/master
2016-09-06T06:30:56.466755
2013-07-13T08:48:16
2013-07-13T08:48:16
5,158,472
1
0
null
null
null
null
UTF-8
C++
false
false
2,408
cpp
#include <algorithm> #include <cstdio> #include <cstdlib> #include <set> #include <utility> #include <vector> using namespace std; #define PB push_back #define MP make_pair #define FI first #define SE second #define maxn 125010 int N, X1[maxn], Y1[maxn], X2[maxn], Y2[maxn]; pair <int, int> Time; int Sign( long long X ) { return X > 0 ? 1 : X < 0 ? -1 : 0; } void Try( int i, int j ) { long long A1 = Y1[i] - Y2[i]; long long B1 = X2[i] - X1[i]; long long C1 = -(A1 * X1[i] + B1 * Y1[i]); long long A2 = Y1[j] - Y2[j]; long long B2 = X2[j] - X1[j]; long long C2 = -(A1 * X1[j] + B1 * Y1[j]); if (Sign(A1 * X1[j] + B1 * Y1[j] + C1) * Sign(A1 * X1[j] + B1 * Y2[j] + C1) <= 0 && Sign(A2 * X1[i] + B2 * Y1[i] + C2) * Sign(A2 * X1[i] + B2 * Y2[i] + C2) <= 0) { printf("YES\n"); printf("%d %d\n", i + 1, j + 1); exit(0); } } bool Func( int i, int j ) { double y1, y2; if (X1[i] != X2[i]) y1 = X1[i] + 1.0 * (Time.FI - X1[i]) * (Y2[i] - Y1[i]) / (X2[i] - X1[i]); else y1 = Y1[i]; if (X1[j] != X2[j]) y2 = X1[j] + 1.0 * (Time.FI - X1[j]) * (Y2[j] - Y1[j]) / (X2[j] - X1[j]); else y2 = Y1[j]; return y1 > y2; } class CCL { public: int i; CCL( int a ) { i = a; } }; bool operator < ( CCL i, CCL j ) { return Func(i.i, j.i); } int main( void ) { freopen("segments.in", "rt", stdin); freopen("segments.out", "wt", stdout); vector <pair<pair<int, int>, pair<int, int> > > Event; scanf("%d", &N); for (int i = 0; i < N; i++) { scanf("%d%d%d%d", &X1[i], &Y1[i], &X2[i], &Y2[i]); if (X1[i] > X2[i] || X1[i] == X2[i] && Y1[i] > Y2[i]) swap(X1[i], X2[i]), swap(Y1[i], Y2[i]); Event.PB(MP(MP(X1[i], Y1[i]), MP(-1, i))); Event.PB(MP(MP(X2[i], Y2[i]), MP(+1, i))); } sort(Event.begin(), Event.end()); set <CCL> Set; for (int i = 0; i < Event.size(); i++) { Time = Event[i].FI; if (Event[i].SE.FI == -1) Set.insert(CCL(Event[i].SE.SE)); else { set <CCL> :: iterator T = Set.find(CCL(Event[i].SE.SE)), T1 = T, T2 = T; int P1 = -1, P2 = -1; if (T1 != Set.begin()) P1 = (--T1)->i; if (++T2 != Set.end()) P2 = T2->i; if (P1 != -1) Try(P1, T->i); if (P2 != -1) Try(T->i, P2); if (P1 != -1 && P2 != -1) Try(P1, P2); Set.erase(T); } } printf("NO\n"); return 0; }
[ "super.denis@gmail.com" ]
super.denis@gmail.com
d1fa81f1cffd793de4a4a602ad7d1ba5367bba9c
7b250f1864ba6f9c0a2e89651df08986b3f68aac
/Bucket.h
d651772a0a03e9a9774d7cdc4c7d936f21f8740d
[]
no_license
schoettl/algodat2_2
4a25569561cc6dd30b46a5f950964d3b72e468a6
6d49f3e1ab429e7ea1991143d0b53cfdc3c13044
refs/heads/master
2020-06-06T18:44:59.696170
2014-12-25T10:02:25
2014-12-25T10:02:25
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,815
h
/* * Bucket.h * * Created on: 28.11.2014 * Author: jakob */ #ifndef BUCKET_H_ #define BUCKET_H_ #include <fstream> using namespace std; #include "Kunde.h" #define BUCKET_SIZE_IN_BYTES sizeof (Bucket<bucketSize>) template <unsigned bucketSize> class Bucket { public: Bucket(); // iterator zum zugriff auf slots oder so? fstream& read(fstream& istream, unsigned position); fstream& write(fstream& ostream, unsigned position) const; void clear(); friend class HashDat<bucketSize>; // C++11 class keyword is optional private: Kunde slots[bucketSize]; // array<Kunde, bucketSize> wäre besser, ist aber C++11 }; template <unsigned bucketSize> Bucket<bucketSize>::Bucket() { } template <unsigned bucketSize> fstream& Bucket<bucketSize>::read(fstream& istream, unsigned position) { istream.seekg(position); // cout << "reading at position " << position << endl; if (!istream) cout << "stream is not ok" << endl; for (int i = 0; i < bucketSize; i++) { slots[i].read(istream); } // istream.read((char*) this, BUCKET_SIZE_IN_BYTES); // geht auch, ist aber evtl. nicht portable. // Wenn ich gewusst hätte, dass bei C++ jedes Objekt auch Verwalungsinfos enthält, // haette ich statt `Kunde slots[]` `vector<Kunde> slots` verwendet. return istream; } template <unsigned bucketSize> fstream& Bucket<bucketSize>::write(fstream& ostream, unsigned position) const { ostream.seekp(position); // cout << "writing at position " << position << endl; for (int i = 0; i < bucketSize; i++) { slots[i].write(ostream); } // ostream.write((char*) this, BUCKET_SIZE_IN_BYTES); // geht auch, ist aber evtl. nicht portable return ostream; } template <unsigned bucketSize> void Bucket<bucketSize>::clear() { for (int i = 0; i < bucketSize; i++) { slots[i] = Kunde(); } } #endif /* BUCKET_H_ */
[ "jschoett@gmail.com" ]
jschoett@gmail.com
fad6539f09f6f2fceb90f6edd5846bce7f0f7893
85d205d5dcd2465f3edc2e22caf86b8cce58cab0
/6_week/partition3.cpp
570ac60b969c16715e5af18f39064b1496d8dc04
[]
no_license
Mikefopf/Coursera-Algorithms_Data_Structures-course_1
971c00ebfebc5c5e3f5faa3339750d3825a4007b
140ca52b2c17cd5a66fb5d71e2c99b8f20007380
refs/heads/main
2023-02-28T13:29:16.580260
2021-02-14T11:53:28
2021-02-14T11:53:28
338,775,542
0
0
null
null
null
null
UTF-8
C++
false
false
1,801
cpp
#include <iostream> #include <vector> #include <algorithm> using namespace std; int partition3(vector<int> &A) { //write your code here int sum = 0; vector<int> to_maximise = vector<int>(4, 0); for (int i = 0; i < A.size(); ++i) { sum += A[i]; } if (sum % 3 != 0) { return 0; } sum /= 3; vector<vector<vector<vector<int>>>> opt_sol = vector<vector<vector<vector<int>>>>(A.size() + 1, vector<vector<vector<int>>>(sum + 1, vector<vector<int>>(sum + 1, vector<int>(sum + 1, 0)))); for (int j = 1; j < A.size() + 1; ++j) { for (int i1 = 0; i1 < sum + 1; ++i1) { for (int i2 = 0; i2 < sum + 1; ++i2) { for (int i3 = 0; i3 < sum + 1; ++i3) { to_maximise[0] = opt_sol[j - 1][i1][i2][i3]; to_maximise[1] = 0; to_maximise[2] = 0; to_maximise[3] = 0; if (i1 >= A[j - 1]) { to_maximise[1] = opt_sol[j - 1][i1 - A[j - 1]][i2][i3] + A[j - 1]; } if (i2 >= A[j - 1]) { to_maximise[2] = opt_sol[j - 1][i1][i2 - A[j - 1]][i3] + A[j - 1]; } if (i3 >= A[j - 1]) { to_maximise[3] = opt_sol[j - 1][i1][i2][i3 - A[j - 1]] + A[j - 1]; } opt_sol[j][i1][i2][i3] = *max_element(to_maximise.begin(), to_maximise.end()); } } } } if (opt_sol[A.size()][sum][sum][sum] == 3 * sum) { return 1; } return 0; } int main() { int n; std::cin >> n; vector<int> A(n); for (size_t i = 0; i < A.size(); ++i) { std::cin >> A[i]; } std::cout << partition3(A) << '\n'; }
[ "talmike@mail.ru" ]
talmike@mail.ru
4861f142bb70ded6943255f8adc5a82f1135fd64
fe1fccfa1b240ae63129390fe3809a4620fcab50
/Win32++/samples/Notepad/src/Mainfrm.cpp
38dae7e226e8791637e0c25c6ca5d2fd4faeeda6
[]
no_license
wyrover/win32pp
d1f4e897818447ad101ce1fb5b61d0cbb591d421
750346ec826e75b26a7640b4632d04d0006f6d6a
refs/heads/master
2021-01-18T08:39:40.095782
2013-09-11T15:40:17
2013-09-11T15:40:17
31,368,732
1
0
null
2015-02-26T13:40:07
2015-02-26T13:40:07
null
UTF-8
C++
false
false
10,752
cpp
///////////////////////////////////////////////// // Mainfrm.cpp #include "stdafx.h" #include "mainfrm.h" #include <richedit.h> #include "resource.h" //For Visual C++ 6 and without a modern SDK #ifndef DWORD_PTR #define DWORD_PTR DWORD #endif // definitions for the CMainFrame class CMainFrame::CMainFrame() { m_strPathName = _T(""); SetView(m_RichView); // Set the registry key name, and load the initial window position // Use a registry key name like "CompanyName\\Application" LoadRegistrySettings(_T("Win32++\\Notepad Sample")); // Load the settings from the registry with 5 MRU entries LoadRegistryMRUSettings(5); } CMainFrame::~CMainFrame() { } void CMainFrame::OnInitialUpdate() { DragAcceptFiles(TRUE); SetWindowTitle(); m_RichView.SetFocus(); } LRESULT CMainFrame::OnNotify(WPARAM wParam, LPARAM lParam) { NMHDR* pNMH; pNMH = (LPNMHDR) lParam; switch (pNMH->code) { case EN_DROPFILES: { ENDROPFILES* ENDrop = (ENDROPFILES*)lParam; HDROP hDropInfo = (HDROP) ENDrop->hDrop; OnDropFiles(hDropInfo); } return TRUE; } return CFrame::OnNotify(wParam, lParam); } BOOL CMainFrame::OnCommand(WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (LOWORD(wParam)) { case IDM_FILE_NEW: OnFileNew(); return TRUE; case IDM_FILE_OPEN: OnFileOpen(); return TRUE; case IDM_FILE_SAVE: OnFileSave(); return TRUE; case IDM_FILE_SAVEAS: OnFileSaveAs(); return TRUE; case IDM_FILE_PRINT: OnFilePrint(); return TRUE; case IDM_EDIT_COPY: OnEditCopy(); return TRUE; case IDM_EDIT_PASTE: OnEditPaste(); return TRUE; case IDM_EDIT_CUT: OnEditCut(); return TRUE; case IDM_EDIT_DELETE: OnEditDelete(); return TRUE; case IDM_EDIT_REDO: OnEditRedo(); return TRUE; case IDM_EDIT_UNDO: OnEditUndo(); return TRUE; case IDM_FILE_EXIT: ::PostMessage(m_hWnd, WM_CLOSE, 0, 0); return TRUE; case IDW_VIEW_STATUSBAR: OnViewStatusBar(); return TRUE; case IDW_VIEW_TOOLBAR: OnViewToolBar(); return TRUE; case IDM_HELP_ABOUT: OnHelp(); return TRUE; case IDW_FILE_MRU_FILE1: case IDW_FILE_MRU_FILE2: case IDW_FILE_MRU_FILE3: case IDW_FILE_MRU_FILE4: case IDW_FILE_MRU_FILE5: { UINT nMRUIndex = LOWORD(wParam) - IDW_FILE_MRU_FILE1; CString strMRUText = GetMRUEntry(nMRUIndex); if (ReadFile(strMRUText)) m_strPathName = strMRUText; else RemoveMRUEntry(strMRUText); SetWindowTitle(); return TRUE; } } // switch cmd return FALSE; } // CMainFrame::OnCommand(...) void CMainFrame::OnFileNew() { m_RichView.SetWindowText(_T("")); m_strPathName = _T(""); SetWindowTitle(); m_RichView.SetFontDefaults(); m_RichView.SendMessage(EM_SETMODIFY, FALSE, 0); } void CMainFrame::OnFilePrint() { PRINTDLG pd; // Initialize PRINTDLG ZeroMemory(&pd, sizeof(pd)); pd.lStructSize = sizeof(pd); pd.hwndOwner = m_hWnd; pd.hDevMode = NULL; // Don't forget to free or store hDevMode pd.hDevNames = NULL; // Don't forget to free or store hDevNames pd.Flags = PD_USEDEVMODECOPIESANDCOLLATE | PD_RETURNDC; pd.nCopies = 1; pd.nFromPage = 0xFFFF; pd.nToPage = 0xFFFF; pd.nMinPage = 1; pd.nMaxPage = 0xFFFF; pd.hwndOwner = m_hWnd; if (PrintDlg(&pd)==TRUE) { HDC hPrinterDC = pd.hDC; // This code basically taken from MS KB article Q129860 FORMATRANGE fr; int nHorizRes = ::GetDeviceCaps(hPrinterDC, HORZRES); int nVertRes = ::GetDeviceCaps(hPrinterDC, VERTRES); int nLogPixelsX = ::GetDeviceCaps(hPrinterDC, LOGPIXELSX); int nLogPixelsY = ::GetDeviceCaps(hPrinterDC, LOGPIXELSY); LONG lTextLength; // Length of document. LONG lTextPrinted; // Amount of document printed. // Ensure the printer DC is in MM_TEXT mode. ::SetMapMode ( hPrinterDC, MM_TEXT ); // Rendering to the same DC we are measuring. ZeroMemory(&fr, sizeof(fr)); fr.hdc = hPrinterDC; fr.hdcTarget = hPrinterDC; // Set up the page. int margin = 200; // 1440 TWIPS = 1 inch. fr.rcPage.left = fr.rcPage.top = margin; fr.rcPage.right = (nHorizRes/nLogPixelsX) * 1440 - margin; fr.rcPage.bottom = (nVertRes/nLogPixelsY) * 1440 - margin; // Set up margins all around. fr.rc.left = fr.rcPage.left ;//+ 1440; fr.rc.top = fr.rcPage.top ;//+ 1440; fr.rc.right = fr.rcPage.right ;//- 1440; fr.rc.bottom = fr.rcPage.bottom ;//- 1440; // Default the range of text to print as the entire document. fr.chrg.cpMin = 0; fr.chrg.cpMax = -1; m_RichView.SendMessage(EM_FORMATRANGE, true, (LPARAM)&fr); // Set up the print job (standard printing stuff here). DOCINFO di; ZeroMemory(&di, sizeof(di)); di.cbSize = sizeof(DOCINFO); di.lpszDocName = m_strPathName; // Do not print to file. di.lpszOutput = NULL; // Start the document. ::StartDoc(hPrinterDC, &di); GETTEXTLENGTHEX tl; tl.flags = GTL_NUMCHARS; // Find out real size of document in characters. lTextLength = (LONG)m_RichView.SendMessage(EM_GETTEXTLENGTHEX, (WPARAM)&tl, 0L); do { // Start the page. ::StartPage(hPrinterDC); // Print as much text as can fit on a page. The return value is // the index of the first character on the next page. Using TRUE // for the wParam parameter causes the text to be printed. lTextPrinted = (LONG)::SendMessage(m_RichView.GetHwnd(), EM_FORMATRANGE, true, (LPARAM)&fr); m_RichView.SendMessage(EM_DISPLAYBAND, 0, (LPARAM)&fr.rc); // Print last page. ::EndPage(hPrinterDC); // If there is more text to print, adjust the range of characters // to start printing at the first character of the next page. if (lTextPrinted < lTextLength) { fr.chrg.cpMin = (LONG)lTextPrinted; fr.chrg.cpMax = -1; } } while (lTextPrinted < lTextLength); // Tell the control to release cached information. m_RichView.SendMessage(EM_FORMATRANGE, false, 0L); ::EndDoc (hPrinterDC); // Delete DC when done. ::DeleteDC(hPrinterDC); } } void CMainFrame::OnEditCut() { m_RichView.SendMessage(WM_CUT, 0, 0); } void CMainFrame::OnEditCopy() { m_RichView.SendMessage(WM_COPY, 0, 0); } void CMainFrame::OnEditPaste() { m_RichView.SendMessage(EM_PASTESPECIAL, CF_TEXT, 0); } void CMainFrame::OnEditDelete() { m_RichView.SendMessage(WM_CLEAR, 0, 0); } void CMainFrame::OnEditRedo() { m_RichView.SendMessage(EM_REDO, 0, 0); } void CMainFrame::OnEditUndo() { m_RichView.SendMessage(EM_UNDO, 0, 0); } void CMainFrame::OnClose() { //Check for unsaved text BOOL bChanged = (BOOL)m_RichView.SendMessage(EM_GETMODIFY, 0, 0); if (bChanged) if (::MessageBox(NULL, _T("Save changes to this document"), _T("TextEdit"), MB_YESNO | MB_ICONWARNING) == IDYES) OnFileSave(); CFrame::OnClose(); } void CMainFrame::OnDropFiles(HDROP hDropInfo) { TCHAR szFileName[_MAX_PATH]; ::DragQueryFile((HDROP)hDropInfo, 0, (LPTSTR)szFileName, _MAX_PATH); ReadFile(szFileName); } BOOL CMainFrame::ReadFile(LPCTSTR szFileName) { // Open the file for reading CFile File; if (!File.Open(szFileName, OPEN_EXISTING)) { CString str = _T("Failed to load: "); str += szFileName; ::MessageBox(NULL, str, _T("Warning"), MB_ICONWARNING); return FALSE; } //Set default font and color m_RichView.SetFontDefaults(); EDITSTREAM es; es.dwCookie = (DWORD_PTR) File.GetHandle(); es.pfnCallback = (EDITSTREAMCALLBACK) MyStreamInCallback; m_RichView.SendMessage(EM_STREAMIN, SF_TEXT, (LPARAM)&es); //Clear the modified text flag m_RichView.SendMessage(EM_SETMODIFY, FALSE, 0); return TRUE; } BOOL CMainFrame::WriteFile(LPCTSTR szFileName) { // Open the file for writing CFile File; if (!File.Open(szFileName, CREATE_ALWAYS)) { CString str = _T("Failed to write: "); str += szFileName; ::MessageBox(NULL, str, _T("Warning"), MB_ICONWARNING); return FALSE; } EDITSTREAM es; es.dwCookie = (DWORD_PTR) File.GetHandle(); es.dwError = 0; es.pfnCallback = (EDITSTREAMCALLBACK) MyStreamOutCallback; m_RichView.SendMessage(EM_STREAMOUT, SF_TEXT, (LPARAM)&es); //Clear the modified text flag m_RichView.SendMessage(EM_SETMODIFY, FALSE, 0); return TRUE; } void CMainFrame::OnFileOpen() { // szFilters is a text string that includes two file name filters: // "*.my" for "MyType Files" and "*.*' for "All Files." CString Filters( _T("Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"), 46); CFile File; CString str = File.OpenFileDialog(0, OFN_FILEMUSTEXIST, Filters, this); if (!str.IsEmpty()) { ReadFile(str); SetFileName(str); AddMRUEntry(str); SetWindowTitle(); } } void CMainFrame::OnFileSave() { if (m_strPathName == _T("")) OnFileSaveAs(); else WriteFile(m_strPathName); } void CMainFrame::OnFileSaveAs() { // szFilters is a text string that includes two file name filters: // "*.my" for "MyType Files" and "*.*' for "All Files." CString Filters(_T("Text Files (*.txt)\0*.txt\0All Files (*.*)\0*.*\0\0"), 46); CFile File; CString str = File.SaveFileDialog(0, OFN_OVERWRITEPROMPT, Filters, _T("txt"), this); if (!str.IsEmpty()) { WriteFile(str); SetFileName(str); AddMRUEntry(str); SetWindowTitle(); } } void CMainFrame::SetFileName(LPCTSTR szFilePathName) { //Truncate and save file name int i = lstrlen(szFilePathName)+1; while ((--i > 0) && (szFilePathName[i-1] != _T('\\'))); m_strPathName = szFilePathName+i; } void CMainFrame::SetWindowTitle() { CString Title; if (m_strPathName == _T("")) Title = _T("TextEdit - Untitled"); else Title = _T("TextEdit - ") + m_strPathName; SetWindowText(Title); } void CMainFrame::SetupToolBar() { // Define the resource IDs for the toolbar AddToolBarButton( IDM_FILE_NEW ); AddToolBarButton( IDM_FILE_OPEN ); AddToolBarButton( IDM_FILE_SAVE ); AddToolBarButton( 0 ); // Separator AddToolBarButton( IDM_EDIT_CUT ); AddToolBarButton( IDM_EDIT_COPY ); AddToolBarButton( IDM_EDIT_PASTE ); AddToolBarButton( 0 ); // Separator AddToolBarButton( IDM_FILE_PRINT ); AddToolBarButton( 0 ); // Separator AddToolBarButton( IDM_HELP_ABOUT ); } LRESULT CMainFrame::WndProc(UINT uMsg, WPARAM wParam, LPARAM lParam) { // switch (uMsg) // { // // } return WndProcDefault(uMsg, wParam, lParam); } DWORD CALLBACK CMainFrame::MyStreamInCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { // Required for StreamIn if (!cb) return (1); *pcb = 0; if (!::ReadFile((HANDLE)(DWORD_PTR) dwCookie, pbBuff, cb, (LPDWORD)pcb, NULL)) ::MessageBox(NULL, _T("ReadFile Failed"), _T(""), MB_OK); return 0; } DWORD CALLBACK CMainFrame::MyStreamOutCallback(DWORD dwCookie, LPBYTE pbBuff, LONG cb, LONG *pcb) { // Required for StreamOut if(!cb) return (1); *pcb = 0; if (!::WriteFile((HANDLE)(DWORD_PTR)dwCookie, pbBuff, cb, (LPDWORD)pcb, NULL)) ::MessageBox(NULL, _T("WriteFile Failed"), _T(""), MB_OK); return 0; }
[ "saybooboo@gmail.com" ]
saybooboo@gmail.com
d5f9d23da98ac7ed37b8473e3df00de30b8df8ad
a4b1600ab4e757a253678f4587e39f22f75f1265
/cast/const.cpp
cc73f70ac5cc654d74dde9d907d630d662c11cf2
[]
no_license
chenchukun/CPP
44d8fb93b4fc54ac3c64394b2161044920e18117
bfb5074d8d777e04738451af798085a4437ab420
refs/heads/master
2021-09-09T17:24:43.410927
2018-03-18T13:34:40
2018-03-18T13:34:40
109,701,817
0
0
null
null
null
null
UTF-8
C++
false
false
430
cpp
// // Created by chenchukun on 18/2/2. // #include <iostream> using namespace std; int main() { int x = 10; const int *cpx = &x; // const_cast 可以去掉指向const的指针的const属性 int *px = const_cast<int*>(cpx); *px = 20; cout << x << endl; // 将const引用转为非const引用 const int &cx = x; int &xx = const_cast<int&>(cx); xx = 30; cout << x << endl; return 0; }
[ "916347678@qq.com" ]
916347678@qq.com
888df86931863c9ba65d1632ee03af45498da523
24244185d57d9bfe928d2acf5ad202be210d0686
/TankWar/include/MiniMap.h
e6ac4d5ed74a01ca6bc9557fabc094807bfa7b0a
[]
no_license
AlexSunChen/The_Tank_Game
39aba453d07987981251aa1c5f38426568ceac42
023c332159763788a448b514886fd505ae846f15
refs/heads/master
2021-01-10T18:30:24.968882
2014-10-31T13:16:26
2014-10-31T13:16:26
21,394,674
0
0
null
null
null
null
UTF-8
C++
false
false
2,821
h
/* ----------------------------------------------------------------------------- *********************************************************************** filename: MiniMap.h created: 6/28/2014 author: Sun Chen ************************************************************************ ************************************************************************ ----------------------------------------------------------------------------- */ #pragma once #include <Ogre.h> #include "GUIManager.h" namespace Tank { // Rader size MINI_MAP_SIZE * MINI_MAP_SIZE const static float RADAR_SIZE = 145; // The initial X coordinate pixel radar screen const static float RADAR_POS_X = 10; // The initial Y coordinate pixel radar screen const static float RADAR_POS_Y = 10; // Size enemy in radar const static float RADAR_ENMEY_SIZE = 15; // The maximum range of the radar can detect const static float RADAR_MAX_RADIUS = 50; // Radar display radius const static float RADAR_RADIUS = RADAR_SIZE / 2; // Radar display radius squared const static float RADAR_RADIUS_POW_2 = RADAR_RADIUS * RADAR_RADIUS; // Rader mode enum MINIMAP_MODE { MINIMAP_OVERLOOK, // Bird view display MINIMAP_RADAR, // Radar Display }; class MiniMap { public: MiniMap(Ogre::SceneManager *sceneMgr, Ogre::SceneNode *baseNode, const Ogre::Vector3 &heightOffset); ~MiniMap(); void update(float timeSinceLastFrame); // Add the enemy's radar node void addPoint(const std::string &name); // Remove the enemy's radar node void removePoint(const std::string &name); // With a new enemy in the radar coordinates void updatePoint(const std::string &name, const Ogre::Vector3& pos); // Small map is visible void setVisible(bool visible); private: // Small Scale Map bool onZoomIn(const CEGUI::EventArgs& e) ; // Enlarge map bool onZoomOut(const CEGUI::EventArgs& e) ; // Small map display mode change bool onChangeMode(const CEGUI::EventArgs& e) ; // Overlook mode void createOverLookMode(const std::string &windowName); // Rader mode void createRadarMode(); void updateOverLook(float timeSinceLastFrame); void subscribeEvents(); void setBaseNode(Ogre::SceneNode *baseNode, const Ogre::Vector3 &heightOffset); void showOverLookMode(bool show); void showRadarMode(bool show); private: Ogre::SceneManager *mSceneMgr; Ogre::SceneNode *mBaseNode; Ogre::SceneNode *mCameraNode; Ogre::Camera *mCamera; Ogre::Vector3 mHeightOffset; float mZoomFactor; Ogre::Overlay *mOverlays; Ogre::OverlayContainer *mOverlayRadar; std::map<std::string, Ogre::OverlayElement*> mEnemys; MINIMAP_MODE mMode; }; }
[ "MacForCode" ]
MacForCode
20232bbea14e7a2bd136edf8cfb7b16c3d20f2ef
86f288b8f540b9e0e1d73b3893ae16ab04b37d80
/4.34/main.cpp
26a52f91bd791d0036973424e25ec0e0c00e326f
[]
no_license
jyfhbc/jiao_yufeng
2308415f4f2774e5592e800dcd242e337b7948c8
cc47f8338cfbb49ce760c734e34af1f5bbe83e21
refs/heads/master
2021-07-07T13:24:25.127585
2019-04-21T10:31:26
2019-04-21T10:31:26
154,145,711
0
0
null
null
null
null
GB18030
C++
false
false
234
cpp
#include <iostream> using namespace std; int main() { double a; double n=1; cout<<"输入非负整数:"; cin>>a; while(a!=0) { n=n*a; a=a-1; } cout<<"n!="<<n<<endl; return 0; }
[ "jiaoyufeng@outlook.com" ]
jiaoyufeng@outlook.com
29992dd3d1e48d0518639530a6d1926683435d0f
4118f8eba9c1073074087cdaffebb95e0c1166cb
/src/exception.cpp
48afc096092d6e06ca81a139a66edef13462294e
[]
no_license
rajtyagi2718/tetris
08a402462dd06b070edc80e231b95df559a404e0
362c66473d9724662efecd98190159879cba9a6e
refs/heads/main
2023-07-14T17:24:50.175357
2021-08-31T16:51:28
2021-08-31T16:51:28
336,360,820
0
0
null
null
null
null
UTF-8
C++
false
false
460
cpp
#include "../include/exception.h" // BoardIndexException #include <sstream> // ostringstream #include <string> // to_string GameActionIndexException::GameActionIndexException(int index) : message{"agent action must be integer between [0, 4]."}, index{index} { message += " given action of " + std::to_string(index) + '.'; } const char* GameActionIndexException::what() const noexcept { return message.c_str(); }
[ "rajtyagi2718@gmail.com" ]
rajtyagi2718@gmail.com
134fa46ced2cca3da32a1083ea8b7b140636eae0
4c23be1a0ca76f68e7146f7d098e26c2bbfb2650
/ic8h18/0.006/FC6H12OOH-HO2
9fa129a765b1b6040941e70db2bf398b6230e0e7
[]
no_license
labsandy/OpenFOAM_workspace
a74b473903ddbd34b31dc93917e3719bc051e379
6e0193ad9dabd613acf40d6b3ec4c0536c90aed4
refs/heads/master
2022-02-25T02:36:04.164324
2019-08-23T02:27:16
2019-08-23T02:27:16
null
0
0
null
null
null
null
UTF-8
C++
false
false
835
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 6 \\/ M anipulation | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volScalarField; location "0.006"; object FC6H12OOH-HO2; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { boundary { type empty; } } // ************************************************************************* //
[ "jfeatherstone123@gmail.com" ]
jfeatherstone123@gmail.com
59bbfc9e49df44cdf812230663fd3a4ec430b0bc
1cfd3b99b898520bd8352fa5bd490207b5d2f2e8
/ProjetHorloge/ProjetHorloge/clavier.cpp
6ef1ac372828aecdc322bf3cac8375cc5950a39c
[]
no_license
Ahmed-Ysf/cpp_2
6e6aae09c39e4b0faf857aeb4707f79d83d1599e
9d8574cc0fb049d029b2aef4183337d31c04e9a9
refs/heads/master
2022-12-24T17:50:15.087615
2020-10-02T10:57:04
2020-10-02T10:57:04
300,584,719
0
0
null
null
null
null
UTF-8
C++
false
false
1,500
cpp
/* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /* * File: Clavier.cpp * Author: philippe * * Created on 31 décembre 2018, 17:11 */ #include <cstdio> #include "clavier.h" Clavier::Clavier() { struct termios etatCourant; tcgetattr(STDIN_FILENO, &etatInitial); etatCourant = etatInitial; etatCourant.c_lflag &= ~ICANON; etatCourant.c_lflag &= ~ECHO; etatCourant.c_lflag &= ~ISIG; etatCourant.c_oflag &= ~NL0; etatCourant.c_oflag &= ~CR0; etatCourant.c_oflag &= ~TAB0; etatCourant.c_oflag &= ~BS0; etatCourant.c_cc[VMIN] = 0; etatCourant.c_cc[VTIME] = 0; tcsetattr(STDIN_FILENO, TCSANOW, &etatCourant); read(STDIN_FILENO, &toucheAvant, 1); touche = toucheAvant; } Clavier::~Clavier() { tcsetattr(STDIN_FILENO, TCSANOW, &etatInitial); } TOUCHES_CLAVIER Clavier::ScruterClavier() { TOUCHES_CLAVIER retour = AUCUNE; char touche = 0; int test = read(STDIN_FILENO, &touche, 1); if (test != -1) { switch (touche) { case ' ': retour = MODE; break; case '+': retour = PLUS; break; case '-': retour = MOINS; break; case '\n': case '\r': retour = FIN; break; default: retour = AUCUNE; } } return retour; }
[ "ahmed683@hotmail.fr" ]
ahmed683@hotmail.fr
b3f7e74e8fc82cc5c8cfb7adbc146ecf9e9fa7e4
cfd74a0d1f76dcba890d13b639c5e767249ae05e
/tests/testRobotModule.cpp
75ff448b405d4af9e8fe030d053d85cf15fd9298
[ "Qhull", "MIT", "BSD-3-Clause", "BSD-2-Clause" ]
permissive
jrl-umi3218/mc_rtc
4b2f640f439cf766a6d8c224fb803fecc2932c5a
59d714f2598393c5f94ae5395c26c834d2688a76
refs/heads/master
2023-08-31T16:02:25.586881
2023-08-30T11:40:46
2023-08-30T11:40:46
227,037,645
77
30
BSD-2-Clause
2023-09-14T12:04:18
2019-12-10T05:39:23
C++
UTF-8
C++
false
false
3,391
cpp
/* * Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL */ #include "utils.h" #include <mc_rbdyn/Robots.h> #include <boost/filesystem.hpp> namespace bfs = boost::filesystem; #include <boost/test/unit_test.hpp> #ifndef JVRC_DESCRIPTION_PATH # error "JVRC_DESCRIPTION_PATH must be defined to build this RobotModule" #endif #define JVRC_VAL(x) #x #define JVRC_VAL_VAL(x) JVRC_VAL(x) static std::string JVRC1_DATA = fmt::format(R"( path: "{}" name: jvrc1 fixed: false default_attitude: [1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.8275] forceSensors: - name: RightFootForceSensor parentBody: R_ANKLE_P_S X_p_f: rotation: [0, 0, 0] translation: [0, 0, 0] - name: LeftFootForceSensor parentBody: L_ANKLE_P_S X_p_f: rotation: [0, 0, 0] translation: [0, 0, 0] - name: RightHandForceSensor parentBody: R_WRIST_Y_S X_p_f: rotation: [0, 0, 0] translation: [0, 0, 0] - name: LeftHandForceSensor parentBody: L_WRIST_Y_S X_p_f: rotation: [0, 0, 0] translation: [0, 0, 0] bodySensors: - name: Accelerometer parentBody: PELVIS_S X_b_s: rotation: [0, 0, 0] translation: [0, 0, 0] - name: FloatingBase parentBody: PELVIS_S X_b_s: rotation: [0, 0, 0] translation: [0, 0, 0] grippers: - name: l_gripper joints: [L_UTHUMB] reverse_limits: true - name: r_gripper joints: [R_UTHUMB] reverse_limits: false frames: - name: Camera parent: NECK_P_S X_p_f: translation: [0, 0, 0.1] rotation: [3.14, 0, 3.14] - name: Camera_RGB parent: Camera_Depth X_p_f: translation: [-0.2, 0, 0] - name: Camera_Depth parent: Camera X_p_f: translation: [0.1, 0, 0] )", JVRC_VAL_VAL(JVRC_DESCRIPTION_PATH)); BOOST_AUTO_TEST_CASE(TestRobotModule) { auto config = makeConfigFile(JVRC1_DATA, ".yaml"); configureRobotLoader(); auto rm = mc_rbdyn::RobotLoader::get_robot_module("json", config); bfs::remove(config); auto robots = mc_rbdyn::loadRobot(*rm); const auto & robot = robots->robot(); // Check frames loading for(const auto & b : robot.mb().bodies()) { BOOST_REQUIRE(robot.hasFrame(b.name())); } for(const auto & s : robot.surfaces()) { BOOST_REQUIRE(robot.hasFrame(s.first)); } for(const auto & f : {"Camera", "Camera_RGB", "Camera_Depth"}) { BOOST_REQUIRE(robot.hasFrame(f)); } BOOST_REQUIRE(robot.frame("Camera").body() == "NECK_P_S"); BOOST_REQUIRE(robot.frame("Camera").parent()); BOOST_REQUIRE(robot.frame("Camera").parent()->name() == "NECK_P_S"); BOOST_REQUIRE(robot.frame("Camera_Depth").body() == "NECK_P_S"); BOOST_REQUIRE(robot.frame("Camera_Depth").parent()); BOOST_REQUIRE(robot.frame("Camera_Depth").parent()->name() == "Camera"); BOOST_REQUIRE(robot.frame("Camera_RGB").body() == "NECK_P_S"); BOOST_REQUIRE(robot.frame("Camera_RGB").parent()); BOOST_REQUIRE(robot.frame("Camera_RGB").parent()->name() == "Camera_Depth"); // Check grippers BOOST_REQUIRE(robot.module().grippers().size() == 2); // Check force sensors BOOST_REQUIRE(robot.forceSensors().size() == 4); for(const auto & fs : {"RightFootForceSensor", "LeftFootForceSensor", "RightHandForceSensor", "LeftHandForceSensor"}) { BOOST_REQUIRE(robot.hasForceSensor(fs)); } // Check body sensors BOOST_REQUIRE(robot.bodySensors().size() == 2); for(const auto & bs : {"Accelerometer", "FloatingBase"}) { BOOST_REQUIRE(robot.hasBodySensor(bs)); } }
[ "pierre.gergondet@gmail.com" ]
pierre.gergondet@gmail.com
9c28c82df92235b5594801d33c420300c9bcaa66
102611a4bb51d9b932d70dec95895ba6569b1a31
/Source/MeshGen/Public/MeshGenerator.h
f8ef0351c33d7179012f223bc88b5c84a2d2c4ad
[]
no_license
msb336/MeshGen
32bea9492e5edec8f6db5af7ddcbe62551287abb
44fa31d74c44623312da5d58340e37225d4d74ec
refs/heads/master
2020-05-17T03:32:40.208680
2019-06-17T18:54:45
2019-06-17T18:54:45
183,483,459
0
1
null
null
null
null
UTF-8
C++
false
false
1,538
h
// Fill out your copyright notice in the Description page of Project Settings. #pragma once #include "GeneratorBase.h" #include "GeneratorFactory.h" #include "CoreMinimal.h" #include "GameFramework/Actor.h" #include "MeshGenerator.generated.h" UCLASS() class MESHGEN_API AMeshGenerator : public AActor { GENERATED_BODY() public: // Sets default values for this actor's properties AMeshGenerator(); private: protected: // Called when the game starts or when spawned virtual void BeginPlay() override; public: // Called every frame virtual void Tick(float DeltaTime) override; private: void update(); void loadFromConfig(); void getPlayerLocation(); void findAdjacentTiles(TileList& adjacent_tiles, const int& level_of_adjacency); RenderingActions getRenderingActions(); void renderTilesAsync(const TileList& tiles_to_render); void derenderTilesAsync(const TileList& tiles_to_derender); void inverseIntersection(const TileList& a, const TileList& b, TileList& unique_to_a, TileList& unique_to_b); //temporary void addWater(const FVector& location); private: std::unique_ptr<GeneratorBase> generator_; GeneratorFactory* generator_factory_ = new GeneratorFactory; std::string configuration_file_ = "MeshGen.ini"; GeneratorBase::ConfigurationSettings* configuration_settings_; Position player_location_; Tile2d player_tile_; TileList loaded_tiles_; TileList rendered_tiles_; private: UPROPERTY() UProceduralMeshComponent* procedural_mesh_component_; UPROPERTY() UMaterialInterface* material_; };
[ "v-mattbr@microsoft.com" ]
v-mattbr@microsoft.com
5b203d9629654c156c70803e004ff6196cb848a5
ea138111941b791b5174f2a5065aa448507a8c1e
/M5StickC-master/src/AXP192.h
22f2441ab3233decfb0b8137313e7dfca5bf9ac4
[]
no_license
wasawas/MyM5StickC
ffa53a1131b4db31ea088616ba939982f3d1279c
69db20561d7874cf86f6ebee02cbec40c3df067d
refs/heads/master
2022-12-04T03:31:35.193818
2020-08-12T14:04:18
2020-08-12T14:04:18
285,023,331
2
0
null
null
null
null
UTF-8
C++
false
false
4,301
h
#ifndef __AXP192_H__ #define __AXP192_H__ #include <Wire.h> #include <Arduino.h> #define SLEEP_MSEC(us) (((uint64_t)us) * 1000L) #define SLEEP_SEC(us) (((uint64_t)us) * 1000000L) #define SLEEP_MIN(us) (((uint64_t)us) * 60L * 1000000L) #define SLEEP_HR(us) (((uint64_t)us) * 60L * 60L * 1000000L) #define ADC_RATE_025HZ (0b00 << 6) #define ADC_RATE_050HZ (0b01 << 6) #define ADC_RATE_100HZ (0b10 << 6) #define ADC_RATE_200HZ (0b11 << 6) #define CURRENT_100MA (0b0000) #define CURRENT_190MA (0b0001) #define CURRENT_280MA (0b0010) #define CURRENT_360MA (0b0011) #define CURRENT_450MA (0b0100) #define CURRENT_550MA (0b0101) #define CURRENT_630MA (0b0110) #define CURRENT_700MA (0b0111) #define VOLTAGE_4100MV (0b00 << 5) #define VOLTAGE_4150MV (0b01 << 5) #define VOLTAGE_4200MV (0b10 << 5) #define VOLTAGE_4360MV (0b11 << 5) #define VOLTAGE_OFF_2600MV (0b000) #define VOLTAGE_OFF_2700MV (0b001) #define VOLTAGE_OFF_2800MV (0b010) #define VOLTAGE_OFF_2900MV (0b011) #define VOLTAGE_OFF_3000MV (0b100) #define VOLTAGE_OFF_3100MV (0b101) #define VOLTAGE_OFF_3200MV (0b110) #define VOLTAGE_OFF_3300MV (0b111) class AXP192 { public: AXP192(); /** * LDO2: Display backlight * LDO3: Display Control * RTC: Always ON, Switch RTC charging. * DCDC1: Main rail. When not set the controller shuts down. * DCDC3: Use unknown * LDO0: MIC */ void begin(bool disableLDO2 = false, bool disableLDO3 = false, bool disableRTC = false, bool disableDCDC1 = false, bool disableDCDC3 = false, bool disableLDO0 = false); void ScreenBreath(uint8_t brightness); bool GetBatState(); uint8_t GetInputPowerStatus(); uint8_t GetBatteryChargingStatus(); void EnableCoulombcounter(void); void DisableCoulombcounter(void); void StopCoulombcounter(void); void ClearCoulombcounter(void); uint32_t GetCoulombchargeData(void); // Raw Data for Charge uint32_t GetCoulombdischargeData(void); // Raw Data for Discharge float GetCoulombData(void); // total in - total out and calc uint16_t GetVbatData(void) __attribute__((deprecated)); uint16_t GetIchargeData(void) __attribute__((deprecated)); uint16_t GetIdischargeData(void) __attribute__((deprecated)); uint16_t GetTempData(void) __attribute__((deprecated)); uint32_t GetPowerbatData(void) __attribute__((deprecated)); uint16_t GetVinData(void) __attribute__((deprecated)); uint16_t GetIinData(void) __attribute__((deprecated)); uint16_t GetVusbinData(void) __attribute__((deprecated)); uint16_t GetIusbinData(void) __attribute__((deprecated)); uint16_t GetVapsData(void) __attribute__((deprecated)); uint8_t GetBtnPress(void); // -- sleep void SetSleep(void); void DeepSleep(uint64_t time_in_us = 0); void LightSleep(uint64_t time_in_us = 0); uint8_t GetWarningLeve(void) __attribute__((deprecated)); public: void SetChargeVoltage( uint8_t ); void SetChargeCurrent( uint8_t ); void SetVOff( uint8_t voltage ); float GetBatVoltage(); float GetBatCurrent(); float GetVinVoltage(); float GetVinCurrent(); float GetVBusVoltage(); float GetVBusCurrent(); float GetTempInAXP192(); float GetBatPower(); float GetBatChargeCurrent(); float GetAPSVoltage(); float GetBatCoulombInput(); float GetBatCoulombOut(); uint8_t GetWarningLevel(void); void SetCoulombClear() __attribute__((deprecated)); // use ClearCoulombcounter instead void SetLDO2( bool State ); // Can turn LCD Backlight OFF for power saving void SetLDO3( bool State ); void SetGPIO0( bool State ); void SetAdcState(bool State); void SetAdcRate( uint8_t rate ); // -- Power Off void PowerOff(); // Power Maintained Storage void Read6BytesStorage( uint8_t *bufPtr ); void Write6BytesStorage( uint8_t *bufPtr ); private: void Write1Byte( uint8_t Addr , uint8_t Data ); uint8_t Read8bit( uint8_t Addr ); uint16_t Read12Bit( uint8_t Addr); uint16_t Read13Bit( uint8_t Addr); uint16_t Read16bit( uint8_t Addr ); uint32_t Read24bit( uint8_t Addr ); uint32_t Read32bit( uint8_t Addr ); void ReadBuff( uint8_t Addr , uint8_t Size , uint8_t *Buff ); }; #endif
[ "wasawas@Kids-Mac-6.local" ]
wasawas@Kids-Mac-6.local
f836e32141c155dcdc70e38ac626b2e7adbe46e6
127c53f4e7e220f44dc82d910a5eed9ae8974997
/EngineSDK/kylinengine/ModelEditor/src/TerrainLayerOneEraserAction.cpp
ce66c9bd5530beefb374b9374bd78133a9648abe
[]
no_license
zhangf911/wxsj2
253e16265224b85cc6800176a435deaa219ffc48
c8e5f538c7beeaa945ed2a9b5a9b04edeb12c3bd
refs/heads/master
2020-06-11T16:44:14.179685
2013-03-03T08:47:18
2013-03-03T08:47:18
null
0
0
null
null
null
null
UTF-8
C++
false
false
4,302
cpp
#include "TerrainLayerOneEraserAction.h" #include "SceneManipulator.h" #include "HitIndicator.h" #include "TerrainSelections.h" namespace Fairy{ TerrainLayerOneEraserAction::TerrainLayerOneEraserAction(SceneManipulator* sceneManipulator) : PaintAction(sceneManipulator) { mCurrentGrids = new GridSelection(getTerrain(),sceneManipulator); mHintModified = new GridSelection(getTerrain(),sceneManipulator); mModifiedGrids = new GridSelection(getTerrain(),sceneManipulator); } //----------------------------------------------------------------------- TerrainLayerOneEraserAction::~TerrainLayerOneEraserAction() { delete mCurrentGrids; delete mHintModified; delete mModifiedGrids; } //----------------------------------------------------------------------- const String& TerrainLayerOneEraserAction::getName(void) const { static const String name = "TerrainLayerOneEraserAction"; return name; } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_buildHitIndicator(const Point& pt) { getSceneManipulator()->getHitIndicator("IntersectGrids")->setHitPoint(pt); getSceneManipulator()->getHitIndicator("IntersectPoint")->setHitPoint(pt); Ogre::Vector3 position; bool intersected = getSceneManipulator()->getTerrainIntersects(pt, position); if (!intersected) { mCurrentGrids->reset(); return; } getSceneManipulator()->_buildSelection(mCurrentGrids, position.x, position.z); } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_onActive(bool active) { if (!active) { mHintModified->apply(); mHintModified->reset(); } } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_onMove(const Point& pt) { mHintModified->apply(); mHintModified->reset(); _buildHitIndicator(pt); _doErase(mHintModified); } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_onBegin(const Point& pt) { mHintModified->apply(); mHintModified->reset(); mModifiedGrids->reset(); _buildHitIndicator(pt); _doErase(mModifiedGrids); } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_onDrag(const Point& pt) { _buildHitIndicator(pt); _doErase(mModifiedGrids); } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_onEnd(const Point& pt, bool canceled) { /*if (canceled) { mModifiedGrids->apply(); }*/ doFinish(mModifiedGrids, canceled); mModifiedGrids->reset(); _buildHitIndicator(pt); } //----------------------------------------------------------------------- void TerrainLayerOneEraserAction::_doErase(GridSelection* modified) { const GridSelection::GridMap& grids = mCurrentGrids->getGrids(); bool anyModified = false; if (!grids.empty()) { for (GridSelection::GridMap::const_iterator it = grids.begin(); it != grids.end(); ++it) { const GridSelection::Grid& grid = it->second; TerrainData::GridInfo info = grid.info; if ( info.layers[1].pixmapId ) { info.layers[1].pixmapId = 0; info.layers[1].orientation = 0; } if (info == grid.info) continue; anyModified = true; modified->add(grid.x, grid.z); getTerrainData()->setGridInfo(grid.x, grid.z, info); } if (anyModified) { mCurrentGrids->notifyModified(); } } } }
[ "amwfhv@163.com" ]
amwfhv@163.com
9a5fe809c9b77ac5a8f52f6ab32ee2da33ec9cb8
1f40e2b0f2ed7041a271108a3cb560029ce651cc
/src/libcaf_core/response_promise.cpp
8802617239a485db3f26e30dad9628558d3a1d13
[]
no_license
grantbrown/actor-framework-minimal
d47235cc55a5d888f9e885a1b1c0674cf6f17999
b55457f4b60db3a0667c866faa57f878810dd32d
refs/heads/master
2021-01-16T18:06:35.361320
2015-08-03T20:41:06
2015-08-03T20:41:06
40,146,615
0
1
null
null
null
null
UTF-8
C++
false
false
2,038
cpp
/****************************************************************************** * ____ _ _____ * * / ___| / \ | ___| C++ * * | | / _ \ | |_ Actor * * | |___ / ___ \| _| Framework * * \____/_/ \_|_| * * * * Copyright (C) 2011 - 2015 * * Dominik Charousset <dominik.charousset (at) haw-hamburg.de> * * * * Distributed under the terms and conditions of the BSD 3-Clause License or * * (at your option) under the terms and conditions of the Boost Software * * License 1.0. See accompanying files LICENSE and LICENSE_ALTERNATIVE. * * * * If you did not receive a copy of the license files, see * * http://opensource.org/licenses/BSD-3-Clause and * * http://www.boost.org/LICENSE_1_0.txt. * ******************************************************************************/ #include <utility> #include "caf/local_actor.hpp" #include "caf/response_promise.hpp" namespace caf { response_promise::response_promise(const actor_addr& from, const actor_addr& to, const message_id& id) : from_(from), to_(to), id_(id) { CAF_ASSERT(id.is_response() || ! id.valid()); } void response_promise::deliver(message msg) const { if (! to_) { return; } auto to = actor_cast<abstract_actor_ptr>(to_); auto from = actor_cast<abstract_actor_ptr>(from_); to->enqueue(from_, id_, std::move(msg), from->host()); } } // namespace caf
[ "grant.brown73@gmail.com" ]
grant.brown73@gmail.com
2c89f38f66c2167e1ff24648707499ae926a44c1
bdc41588737dc4ba34ef625e86d8807e7b04e631
/Source/basic.cpp
88988fe59905a421749afb623212df570d2016aa
[]
no_license
firodj/wxOgl
23a25c9856acf500cc35db00a35adbab614a0f5d
ffd8b9b16a072ebc5e767e6fb4996d50a0ebe7e8
refs/heads/master
2020-05-14T10:29:43.503698
2019-04-16T20:37:36
2019-04-16T20:37:36
181,762,806
2
0
null
null
null
null
UTF-8
C++
false
false
89,128
cpp
///////////////////////////////////////////////////////////////////////////// // Name: basic.cpp // Purpose: Basic OGL classes // Author: Julian Smart // Modified by: // Created: 12/07/98 // RCS-ID: $Id: basic.cpp,v 1.1 2007/03/28 15:15:56 frm Exp $ // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" #ifdef __BORLANDC__ #pragma hdrstop #endif #ifndef WX_PRECOMP #include "wx/wx.h" #endif #if wxUSE_PROLOGIO #include "wx/deprecated/wxexpr.h" #endif #ifdef new #undef new #endif #include <stdio.h> #include <ctype.h> #include "wx/ogl/ogl.h" // Control point types // Rectangle and most other shapes #define CONTROL_POINT_VERTICAL 1 #define CONTROL_POINT_HORIZONTAL 2 #define CONTROL_POINT_DIAGONAL 3 // Line #define CONTROL_POINT_ENDPOINT_TO 4 #define CONTROL_POINT_ENDPOINT_FROM 5 #define CONTROL_POINT_LINE 6 IMPLEMENT_DYNAMIC_CLASS(wxShapeTextLine, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxAttachmentPoint, wxObject) wxShapeTextLine::wxShapeTextLine(double the_x, double the_y, const wxString& the_line) { m_x = the_x; m_y = the_y; m_line = the_line; } wxShapeTextLine::~wxShapeTextLine() { } IMPLEMENT_ABSTRACT_CLASS(wxShapeEvtHandler, wxObject) wxShapeEvtHandler::wxShapeEvtHandler(wxShapeEvtHandler *prev, wxShape *shape) { m_previousHandler = prev; m_handlerShape = shape; } wxShapeEvtHandler::~wxShapeEvtHandler() { } // Creates a copy of this event handler. wxShapeEvtHandler* wxShapeEvtHandler::CreateNewCopy() { wxShapeEvtHandler* newObject = (wxShapeEvtHandler*) GetClassInfo()->CreateObject(); wxASSERT( (newObject != NULL) ); wxASSERT( (newObject->IsKindOf(CLASSINFO(wxShapeEvtHandler))) ); newObject->m_previousHandler = newObject; CopyData(*newObject); return newObject; } void wxShapeEvtHandler::OnDelete() { if (this != GetShape()) delete this; } void wxShapeEvtHandler::OnDraw(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnDraw(dc); } void wxShapeEvtHandler::OnMoveLinks(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnMoveLinks(dc); } void wxShapeEvtHandler::OnMoveLink(wxDC& dc, bool moveControlPoints) { if (m_previousHandler) m_previousHandler->OnMoveLink(dc, moveControlPoints); } void wxShapeEvtHandler::OnDrawContents(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnDrawContents(dc); } void wxShapeEvtHandler::OnDrawBranches(wxDC& dc, bool erase) { if (m_previousHandler) m_previousHandler->OnDrawBranches(dc, erase); } void wxShapeEvtHandler::OnSize(double x, double y) { if (m_previousHandler) m_previousHandler->OnSize(x, y); } bool wxShapeEvtHandler::OnMovePre(wxDC& dc, double x, double y, double old_x, double old_y, bool display) { if (m_previousHandler) return m_previousHandler->OnMovePre(dc, x, y, old_x, old_y, display); else return true; } void wxShapeEvtHandler::OnMovePost(wxDC& dc, double x, double y, double old_x, double old_y, bool display) { if (m_previousHandler) m_previousHandler->OnMovePost(dc, x, y, old_x, old_y, display); } void wxShapeEvtHandler::OnErase(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnErase(dc); } void wxShapeEvtHandler::OnEraseContents(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnEraseContents(dc); } void wxShapeEvtHandler::OnHighlight(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnHighlight(dc); } void wxShapeEvtHandler::OnLeftClick(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnLeftClick(x, y, keys, attachment); } void wxShapeEvtHandler::OnLeftDoubleClick(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnLeftDoubleClick(x, y, keys, attachment); } void wxShapeEvtHandler::OnRightClick(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnRightClick(x, y, keys, attachment); } void wxShapeEvtHandler::OnDragLeft(bool draw, double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnDragLeft(draw, x, y, keys, attachment); } void wxShapeEvtHandler::OnBeginDragLeft(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnBeginDragLeft(x, y, keys, attachment); } void wxShapeEvtHandler::OnEndDragLeft(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnEndDragLeft(x, y, keys, attachment); } void wxShapeEvtHandler::OnDragRight(bool draw, double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnDragRight(draw, x, y, keys, attachment); } void wxShapeEvtHandler::OnBeginDragRight(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnBeginDragRight(x, y, keys, attachment); } void wxShapeEvtHandler::OnEndDragRight(double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnEndDragRight(x, y, keys, attachment); } // Control points ('handles') redirect control to the actual shape, to make it easier // to override sizing behaviour. void wxShapeEvtHandler::OnSizingDragLeft(wxControlPoint* pt, bool draw, double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnSizingDragLeft(pt, draw, x, y, keys, attachment); } void wxShapeEvtHandler::OnSizingBeginDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnSizingBeginDragLeft(pt, x, y, keys, attachment); } void wxShapeEvtHandler::OnSizingEndDragLeft(wxControlPoint* pt, double x, double y, int keys, int attachment) { if (m_previousHandler) m_previousHandler->OnSizingEndDragLeft(pt, x, y, keys, attachment); } void wxShapeEvtHandler::OnDrawOutline(wxDC& dc, double x, double y, double w, double h) { if (m_previousHandler) m_previousHandler->OnDrawOutline(dc, x, y, w, h); } void wxShapeEvtHandler::OnDrawControlPoints(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnDrawControlPoints(dc); } void wxShapeEvtHandler::OnEraseControlPoints(wxDC& dc) { if (m_previousHandler) m_previousHandler->OnEraseControlPoints(dc); } // Can override this to prevent or intercept line reordering. void wxShapeEvtHandler::OnChangeAttachment(int attachment, wxLineShape* line, wxList& ordering) { if (m_previousHandler) m_previousHandler->OnChangeAttachment(attachment, line, ordering); } IMPLEMENT_ABSTRACT_CLASS(wxShape, wxShapeEvtHandler) wxShape::wxShape(wxShapeCanvas *can) { m_eventHandler = this; SetShape(this); m_id = 0; m_formatted = false; m_canvas = can; m_xpos = 0.0; m_ypos = 0.0; m_pen = g_oglBlackPen; m_brush = wxWHITE_BRUSH; m_font = g_oglNormalFont; m_textColour = wxT("BLACK"); m_textColourName = wxT("BLACK"); m_visible = false; m_selected = false; m_attachmentMode = ATTACHMENT_MODE_NONE; m_spaceAttachments = true; m_disableLabel = false; m_fixedWidth = false; m_fixedHeight = false; m_drawHandles = true; m_sensitivity = OP_ALL; m_draggable = true; m_parent = NULL; m_formatMode = FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT; m_shadowMode = SHADOW_NONE; m_shadowOffsetX = 6; m_shadowOffsetY = 6; m_shadowBrush = wxBLACK_BRUSH; m_textMarginX = 5; m_textMarginY = 5; m_regionName = wxT("0"); m_centreResize = true; m_maintainAspectRatio = false; m_highlighted = false; m_rotation = 0.0; m_branchNeckLength = 10; m_branchStemLength = 10; m_branchSpacing = 10; m_branchStyle = BRANCHING_ATTACHMENT_NORMAL; // Set up a default region. Much of the above will be put into // the region eventually (the duplication is for compatibility) wxShapeRegion *region = new wxShapeRegion; m_regions.Append(region); region->SetName(wxT("0")); region->SetFont(g_oglNormalFont); region->SetFormatMode(FORMAT_CENTRE_HORIZ | FORMAT_CENTRE_VERT); region->SetColour(wxT("BLACK")); } wxShape::~wxShape() { if (m_parent) m_parent->GetChildren().DeleteObject(this); ClearText(); ClearRegions(); ClearAttachments(); if (m_canvas) m_canvas->RemoveShape(this); GetEventHandler()->OnDelete(); } void wxShape::SetHighlight(bool hi, bool recurse) { m_highlighted = hi; if (recurse) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->SetHighlight(hi, recurse); node = node->GetNext(); } } } void wxShape::SetSensitivityFilter(int sens, bool recursive) { if (sens & OP_DRAG_LEFT) m_draggable = true; else m_draggable = false; m_sensitivity = sens; if (recursive) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *obj = (wxShape *)node->GetData(); obj->SetSensitivityFilter(sens, true); node = node->GetNext(); } } } void wxShape::SetDraggable(bool drag, bool recursive) { m_draggable = drag; if (m_draggable) m_sensitivity |= OP_DRAG_LEFT; else if (m_sensitivity & OP_DRAG_LEFT) m_sensitivity = m_sensitivity - OP_DRAG_LEFT; if (recursive) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *obj = (wxShape *)node->GetData(); obj->SetDraggable(drag, true); node = node->GetNext(); } } } void wxShape::SetDrawHandles(bool drawH) { m_drawHandles = drawH; wxNode *node = m_children.GetFirst(); while (node) { wxShape *obj = (wxShape *)node->GetData(); obj->SetDrawHandles(drawH); node = node->GetNext(); } } void wxShape::SetShadowMode(int mode, bool redraw) { if (redraw && GetCanvas()) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); Erase(dc); m_shadowMode = mode; Draw(dc); } else { m_shadowMode = mode; } } void wxShape::SetCanvas(wxShapeCanvas *theCanvas) { m_canvas = theCanvas; wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->SetCanvas(theCanvas); node = node->GetNext(); } } void wxShape::AddToCanvas(wxShapeCanvas *theCanvas, wxShape *addAfter) { theCanvas->AddShape(this, addAfter); wxNode *node = m_children.GetFirst(); wxShape *lastImage = this; while (node) { wxShape *object = (wxShape *)node->GetData(); object->AddToCanvas(theCanvas, lastImage); lastImage = object; node = node->GetNext(); } } // Insert at front of canvas void wxShape::InsertInCanvas(wxShapeCanvas *theCanvas) { theCanvas->InsertShape(this); wxNode *node = m_children.GetFirst(); wxShape *lastImage = this; while (node) { wxShape *object = (wxShape *)node->GetData(); object->AddToCanvas(theCanvas, lastImage); lastImage = object; node = node->GetNext(); } } void wxShape::RemoveFromCanvas(wxShapeCanvas *theCanvas) { if (Selected()) Select(false); theCanvas->RemoveShape(this); wxNode *node = m_children.GetFirst(); while (node) { wxShape *object = (wxShape *)node->GetData(); object->RemoveFromCanvas(theCanvas); node = node->GetNext(); } } void wxShape::ClearAttachments() { wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); delete point; node = node->GetNext(); } m_attachmentPoints.Clear(); } void wxShape::ClearText(int regionId) { if (regionId == 0) { m_text.DeleteContents(true); m_text.Clear(); m_text.DeleteContents(false); } wxNode *node = m_regions.Item(regionId); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->ClearText(); } void wxShape::ClearRegions() { wxNode *node = m_regions.GetFirst(); while (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); wxNode *next = node->GetNext(); delete region; delete node; node = next; } } void wxShape::AddRegion(wxShapeRegion *region) { m_regions.Append(region); } void wxShape::SetDefaultRegionSize() { wxNode *node = m_regions.GetFirst(); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); double w, h; GetBoundingBoxMin(&w, &h); region->SetSize(w, h); } bool wxShape::HitTest(double x, double y, int *attachment, double *distance) { // if (!sensitive) // return false; double width = 0.0, height = 0.0; GetBoundingBoxMin(&width, &height); if (fabs(width) < 4.0) width = 4.0; if (fabs(height) < 4.0) height = 4.0; width += (double)4.0; height += (double)4.0; // Allowance for inaccurate mousing double left = (double)(m_xpos - (width/2.0)); double top = (double)(m_ypos - (height/2.0)); double right = (double)(m_xpos + (width/2.0)); double bottom = (double)(m_ypos + (height/2.0)); int nearest_attachment = 0; // If within the bounding box, check the attachment points // within the object. if (x >= left && x <= right && y >= top && y <= bottom) { int n = GetNumberOfAttachments(); double nearest = 999999.0; // GetAttachmentPosition[Edge] takes a logical attachment position, // i.e. if it's rotated through 90%, position 0 is East-facing. for (int i = 0; i < n; i++) { double xp, yp; if (GetAttachmentPositionEdge(i, &xp, &yp)) { double l = (double)sqrt(((xp - x) * (xp - x)) + ((yp - y) * (yp - y))); if (l < nearest) { nearest = l; nearest_attachment = i; } } } *attachment = nearest_attachment; *distance = nearest; return true; } else return false; } // Format a text string according to the region size, adding // strings with positions to region text list static bool GraphicsInSizeToContents = false; // Infinite recursion elimination void wxShape::FormatText(wxDC& dc, const wxString& s, int i) { double w, h; ClearText(i); if (m_regions.GetCount() < 1) return; wxNode *node = m_regions.Item(i); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); // region->SetText(s); // don't set the formatted text yet, it will be done below region->m_regionText = s; dc.SetFont(* region->GetFont()); region->GetSize(&w, &h); wxStringList *stringList = oglFormatText(dc, s, (w-2*m_textMarginX), (h-2*m_textMarginY), region->GetFormatMode()); node = (wxNode*)stringList->GetFirst(); while (node) { wxChar *s = (wxChar *)node->GetData(); wxShapeTextLine *line = new wxShapeTextLine(0.0, 0.0, s); region->GetFormattedText().Append((wxObject *)line); node = node->GetNext(); } delete stringList; double actualW = w; double actualH = h; // Don't try to resize an object with more than one image (this case should be dealt // with by overriden handlers) if ((region->GetFormatMode() & FORMAT_SIZE_TO_CONTENTS) && (region->GetFormattedText().GetCount() > 0) && (m_regions.GetCount() == 1) && !GraphicsInSizeToContents) { oglGetCentredTextExtent(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w, h, &actualW, &actualH); if ((actualW+2*m_textMarginX != w ) || (actualH+2*m_textMarginY != h)) { // If we are a descendant of a composite, must make sure the composite gets // resized properly wxShape *topAncestor = GetTopAncestor(); if (topAncestor != this) { // Make sure we don't recurse infinitely GraphicsInSizeToContents = true; wxCompositeShape *composite = (wxCompositeShape *)topAncestor; composite->Erase(dc); SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY); Move(dc, m_xpos, m_ypos); composite->CalculateSize(); if (composite->Selected()) { composite->DeleteControlPoints(& dc); composite->MakeControlPoints(); composite->MakeMandatoryControlPoints(); } // Where infinite recursion might happen if we didn't stop it composite->Draw(dc); GraphicsInSizeToContents = false; } else { Erase(dc); SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY); Move(dc, m_xpos, m_ypos); } SetSize(actualW+2*m_textMarginX, actualH+2*m_textMarginY); Move(dc, m_xpos, m_ypos); EraseContents(dc); } } oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, actualW-2*m_textMarginX, actualH-2*m_textMarginY, region->GetFormatMode()); m_formatted = true; } void wxShape::Recentre(wxDC& dc) { double w, h; GetBoundingBoxMin(&w, &h); int noRegions = m_regions.GetCount(); for (int i = 0; i < noRegions; i++) { wxNode *node = m_regions.Item(i); if (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, w-2*m_textMarginX, h-2*m_textMarginY, region->GetFormatMode()); } } } bool wxShape::GetPerimeterPoint(double WXUNUSED(x1), double WXUNUSED(y1), double WXUNUSED(x2), double WXUNUSED(y2), double *WXUNUSED(x3), double *WXUNUSED(y3)) { return false; } void wxShape::SetPen(const wxPen *the_pen) { m_pen = the_pen; } void wxShape::SetBrush(const wxBrush *the_brush) { m_brush = the_brush; } // Get the top-most (non-division) ancestor, or self wxShape *wxShape::GetTopAncestor() { if (!GetParent()) return this; if (GetParent()->IsKindOf(CLASSINFO(wxDivisionShape))) return this; else return GetParent()->GetTopAncestor(); } /* * Region functions * */ void wxShape::SetFont(wxFont *the_font, int regionId) { m_font = the_font; wxNode *node = m_regions.Item(regionId); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetFont(the_font); } wxFont *wxShape::GetFont(int n) const { wxNode *node = m_regions.Item(n); if (!node) return NULL; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetFont(); } void wxShape::SetFormatMode(int mode, int regionId) { wxNode *node = m_regions.Item(regionId); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetFormatMode(mode); } int wxShape::GetFormatMode(int regionId) const { wxNode *node = m_regions.Item(regionId); if (!node) return 0; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetFormatMode(); } void wxShape::SetTextColour(const wxString& the_colour, int regionId) { m_textColour = wxTheColourDatabase->Find(the_colour); m_textColourName = the_colour; wxNode *node = m_regions.Item(regionId); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetColour(the_colour); } wxString wxShape::GetTextColour(int regionId) const { wxNode *node = m_regions.Item(regionId); if (!node) return wxEmptyString; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetColour(); } void wxShape::SetRegionName(const wxString& name, int regionId) { wxNode *node = m_regions.Item(regionId); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->SetName(name); } wxString wxShape::GetRegionName(int regionId) { wxNode *node = m_regions.Item(regionId); if (!node) return wxEmptyString; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); return region->GetName(); } int wxShape::GetRegionId(const wxString& name) { wxNode *node = m_regions.GetFirst(); int i = 0; while (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); if (region->GetName() == name) return i; node = node->GetNext(); i ++; } return -1; } // Name all m_regions in all subimages recursively. void wxShape::NameRegions(const wxString& parentName) { int n = GetNumberOfTextRegions(); wxString buff; for (int i = 0; i < n; i++) { if (parentName.Length() > 0) buff << parentName << wxT(".") << i; else buff << i; SetRegionName(buff, i); } wxNode *node = m_children.GetFirst(); int j = 0; while (node) { buff.Empty(); wxShape *child = (wxShape *)node->GetData(); if (parentName.Length() > 0) buff << parentName << wxT(".") << j; else buff << j; child->NameRegions(buff); node = node->GetNext(); j ++; } } // Get a region by name, possibly looking recursively into composites. wxShape *wxShape::FindRegion(const wxString& name, int *regionId) { int id = GetRegionId(name); if (id > -1) { *regionId = id; return this; } wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); wxShape *actualImage = child->FindRegion(name, regionId); if (actualImage) return actualImage; node = node->GetNext(); } return NULL; } // Finds all region names for this image (composite or simple). // Supply empty string list. void wxShape::FindRegionNames(wxStringList& list) { int n = GetNumberOfTextRegions(); for (int i = 0; i < n; i++) { wxString name(GetRegionName(i)); list.Add(name); } wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->FindRegionNames(list); node = node->GetNext(); } } void wxShape::AssignNewIds() { // if (m_id == 0) m_id = wxNewId(); wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->AssignNewIds(); node = node->GetNext(); } } void wxShape::OnDraw(wxDC& WXUNUSED(dc)) { } void wxShape::OnMoveLinks(wxDC& dc) { // Want to set the ends of all attached links // to point to/from this object wxNode *current = m_lines.GetFirst(); while (current) { wxLineShape *line = (wxLineShape *)current->GetData(); line->GetEventHandler()->OnMoveLink(dc); current = current->GetNext(); } } void wxShape::OnDrawContents(wxDC& dc) { double bound_x, bound_y; GetBoundingBoxMin(&bound_x, &bound_y); if (m_regions.GetCount() < 1) return; if (m_pen) dc.SetPen(* m_pen); wxShapeRegion *region = (wxShapeRegion *)m_regions.GetFirst()->GetData(); if (region->GetFont()) dc.SetFont(* region->GetFont()); dc.SetTextForeground(region->GetActualColourObject()); dc.SetBackgroundMode(wxTRANSPARENT); if (!m_formatted) { oglCentreText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode()); m_formatted = true; } if (!GetDisableLabel()) { oglDrawFormattedText(dc, &(region->GetFormattedText()), m_xpos, m_ypos, bound_x-2*m_textMarginX, bound_y-2*m_textMarginY, region->GetFormatMode()); } } void wxShape::DrawContents(wxDC& dc) { GetEventHandler()->OnDrawContents(dc); } void wxShape::OnSize(double WXUNUSED(x), double WXUNUSED(y)) { } bool wxShape::OnMovePre(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { return true; } void wxShape::OnMovePost(wxDC& WXUNUSED(dc), double WXUNUSED(x), double WXUNUSED(y), double WXUNUSED(old_x), double WXUNUSED(old_y), bool WXUNUSED(display)) { } void wxShape::OnErase(wxDC& dc) { if (!m_visible) return; // Erase links wxNode *current = m_lines.GetFirst(); while (current) { wxLineShape *line = (wxLineShape *)current->GetData(); line->GetEventHandler()->OnErase(dc); current = current->GetNext(); } GetEventHandler()->OnEraseContents(dc); } void wxShape::OnEraseContents(wxDC& dc) { if (!m_visible) return; double maxX, maxY, minX, minY; double xp = GetX(); double yp = GetY(); GetBoundingBoxMin(&minX, &minY); GetBoundingBoxMax(&maxX, &maxY); double topLeftX = (double)(xp - (maxX / 2.0) - 2.0); double topLeftY = (double)(yp - (maxY / 2.0) - 2.0); int penWidth = 0; if (m_pen) penWidth = m_pen->GetWidth(); dc.SetPen(GetBackgroundPen()); dc.SetBrush(GetBackgroundBrush()); dc.DrawRectangle(WXROUND(topLeftX - penWidth), WXROUND(topLeftY - penWidth), WXROUND(maxX + penWidth*2.0 + 4.0), WXROUND(maxY + penWidth*2.0 + 4.0)); } void wxShape::EraseLinks(wxDC& dc, int attachment, bool recurse) { if (!m_visible) return; wxNode *current = m_lines.GetFirst(); while (current) { wxLineShape *line = (wxLineShape *)current->GetData(); if (attachment == -1 || ((line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment))) line->GetEventHandler()->OnErase(dc); current = current->GetNext(); } if (recurse) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->EraseLinks(dc, attachment, recurse); node = node->GetNext(); } } } void wxShape::DrawLinks(wxDC& dc, int attachment, bool recurse) { if (!m_visible) return; wxNode *current = m_lines.GetFirst(); while (current) { wxLineShape *line = (wxLineShape *)current->GetData(); if (attachment == -1 || (line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment)) line->Draw(dc); current = current->GetNext(); } if (recurse) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->DrawLinks(dc, attachment, recurse); node = node->GetNext(); } } } // Returns true if pt1 <= pt2 in the sense that one point comes before another on an // edge of the shape. // attachmentPoint is the attachment point (= side) in question. // This is the default, rectangular implementation. bool wxShape::AttachmentSortTest(int attachmentPoint, const wxRealPoint& pt1, const wxRealPoint& pt2) { int physicalAttachment = LogicalToPhysicalAttachment(attachmentPoint); switch (physicalAttachment) { case 0: case 2: { return (pt1.x <= pt2.x) ; } case 1: case 3: { return (pt1.y <= pt2.y) ; } } return false; } bool wxShape::MoveLineToNewAttachment(wxDC& dc, wxLineShape *to_move, double x, double y) { if (GetAttachmentMode() == ATTACHMENT_MODE_NONE) return false; int newAttachment, oldAttachment; double distance; // Is (x, y) on this object? If so, find the new attachment point // the user has moved the point to bool hit = HitTest(x, y, &newAttachment, &distance); if (!hit) return false; EraseLinks(dc); if (to_move->GetTo() == this) oldAttachment = to_move->GetAttachmentTo(); else oldAttachment = to_move->GetAttachmentFrom(); // The links in a new ordering. wxList newOrdering; // First, add all links to the new list. wxNode *node = m_lines.GetFirst(); while (node) { newOrdering.Append(node->GetData()); node = node->GetNext(); } // Delete the line object from the list of links; we're going to move // it to another position in the list newOrdering.DeleteObject(to_move); double old_x = (double) -99999.9; double old_y = (double) -99999.9; node = newOrdering.GetFirst(); bool found = false; while (!found && node) { wxLineShape *line = (wxLineShape *)node->GetData(); if ((line->GetTo() == this && oldAttachment == line->GetAttachmentTo()) || (line->GetFrom() == this && oldAttachment == line->GetAttachmentFrom())) { double startX, startY, endX, endY; double xp, yp; line->GetEnds(&startX, &startY, &endX, &endY); if (line->GetTo() == this) { xp = endX; yp = endY; } else { xp = startX; yp = startY; } wxRealPoint thisPoint(xp, yp); wxRealPoint lastPoint(old_x, old_y); wxRealPoint newPoint(x, y); if (AttachmentSortTest(newAttachment, newPoint, thisPoint) && AttachmentSortTest(newAttachment, lastPoint, newPoint)) { found = true; newOrdering.Insert(node, to_move); } old_x = xp; old_y = yp; } node = node->GetNext(); } if (!found) newOrdering.Append(to_move); GetEventHandler()->OnChangeAttachment(newAttachment, to_move, newOrdering); return true; } void wxShape::OnChangeAttachment(int attachment, wxLineShape* line, wxList& ordering) { if (line->GetTo() == this) line->SetAttachmentTo(attachment); else line->SetAttachmentFrom(attachment); ApplyAttachmentOrdering(ordering); wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); MoveLinks(dc); if (!GetCanvas()->GetQuickEditMode()) GetCanvas()->Redraw(dc); } // Reorders the lines according to the given list. void wxShape::ApplyAttachmentOrdering(wxList& linesToSort) { // This is a temporary store of all the lines. wxList linesStore; wxNode *node = m_lines.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); linesStore.Append(line); node = node->GetNext();; } m_lines.Clear(); node = linesToSort.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); if (linesStore.Member(line)) { // Done this one linesStore.DeleteObject(line); m_lines.Append(line); } node = node->GetNext(); } // Now add any lines that haven't been listed in linesToSort. node = linesStore.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); m_lines.Append(line); node = node->GetNext(); } } // Reorders the lines coming into the node image at this attachment // position, in the order in which they appear in linesToSort. // Any remaining lines not in the list will be added to the end. void wxShape::SortLines(int attachment, wxList& linesToSort) { // This is a temporary store of all the lines at this attachment // point. We'll tick them off as we've processed them. wxList linesAtThisAttachment; wxNode *node = m_lines.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); wxNode *next = node->GetNext(); if ((line->GetTo() == this && line->GetAttachmentTo() == attachment) || (line->GetFrom() == this && line->GetAttachmentFrom() == attachment)) { linesAtThisAttachment.Append(line); delete node; node = next; } else node = node->GetNext(); } node = linesToSort.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); if (linesAtThisAttachment.Member(line)) { // Done this one linesAtThisAttachment.DeleteObject(line); m_lines.Append(line); } node = node->GetNext(); } // Now add any lines that haven't been listed in linesToSort. node = linesAtThisAttachment.GetFirst(); while (node) { wxLineShape *line = (wxLineShape *)node->GetData(); m_lines.Append(line); node = node->GetNext(); } } void wxShape::OnHighlight(wxDC& WXUNUSED(dc)) { } void wxShape::OnLeftClick(double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_CLICK_LEFT) != OP_CLICK_LEFT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnLeftClick(x, y, keys, attachment); } return; } } void wxShape::OnRightClick(double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_CLICK_RIGHT) != OP_CLICK_RIGHT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnRightClick(x, y, keys, attachment); } return; } } double DragOffsetX = 0.0; double DragOffsetY = 0.0; void wxShape::OnDragLeft(bool draw, double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_DRAG_LEFT) != OP_DRAG_LEFT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnDragLeft(draw, x, y, keys, attachment); } return; } wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); wxPen dottedPen(*wxBLACK, 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush(* wxTRANSPARENT_BRUSH); double xx, yy; xx = x + DragOffsetX; yy = y + DragOffsetY; m_canvas->Snap(&xx, &yy); // m_xpos = xx; m_ypos = yy; double w, h; GetBoundingBoxMax(&w, &h); GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); } void wxShape::OnBeginDragLeft(double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_DRAG_LEFT) != OP_DRAG_LEFT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnBeginDragLeft(x, y, keys, attachment); } return; } DragOffsetX = m_xpos - x; DragOffsetY = m_ypos - y; wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); // New policy: don't erase shape until end of drag. // Erase(dc); double xx, yy; xx = x + DragOffsetX; yy = y + DragOffsetY; m_canvas->Snap(&xx, &yy); // m_xpos = xx; m_ypos = yy; dc.SetLogicalFunction(OGLRBLF); wxPen dottedPen(*wxBLACK, 1, wxPENSTYLE_DOT); dc.SetPen(dottedPen); dc.SetBrush((* wxTRANSPARENT_BRUSH)); double w, h; GetBoundingBoxMax(&w, &h); GetEventHandler()->OnDrawOutline(dc, xx, yy, w, h); m_canvas->CaptureMouse(); } void wxShape::OnEndDragLeft(double x, double y, int keys, int attachment) { if (!m_draggable) return; m_canvas->ReleaseMouse(); if ((m_sensitivity & OP_DRAG_LEFT) != OP_DRAG_LEFT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnEndDragLeft(x, y, keys, attachment); } return; } wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(wxCOPY); double xx = x + DragOffsetX; double yy = y + DragOffsetY; m_canvas->Snap(&xx, &yy); // canvas->Snap(&m_xpos, &m_ypos); // New policy: erase shape at end of drag. Erase(dc); Move(dc, xx, yy); if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc); } void wxShape::OnDragRight(bool draw, double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_DRAG_RIGHT) != OP_DRAG_RIGHT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnDragRight(draw, x, y, keys, attachment); } return; } } void wxShape::OnBeginDragRight(double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_DRAG_RIGHT) != OP_DRAG_RIGHT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnBeginDragRight(x, y, keys, attachment); } return; } } void wxShape::OnEndDragRight(double x, double y, int keys, int attachment) { if ((m_sensitivity & OP_DRAG_RIGHT) != OP_DRAG_RIGHT) { attachment = 0; double dist; if (m_parent) { m_parent->HitTest(x, y, &attachment, &dist); m_parent->GetEventHandler()->OnEndDragRight(x, y, keys, attachment); } return; } } void wxShape::OnDrawOutline(wxDC& dc, double x, double y, double w, double h) { double top_left_x = (double)(x - w/2.0); double top_left_y = (double)(y - h/2.0); double top_right_x = (double)(top_left_x + w); double top_right_y = (double)top_left_y; double bottom_left_x = (double)top_left_x; double bottom_left_y = (double)(top_left_y + h); double bottom_right_x = (double)top_right_x; double bottom_right_y = (double)bottom_left_y; wxPoint points[5]; points[0].x = WXROUND(top_left_x); points[0].y = WXROUND(top_left_y); points[1].x = WXROUND(top_right_x); points[1].y = WXROUND(top_right_y); points[2].x = WXROUND(bottom_right_x); points[2].y = WXROUND(bottom_right_y); points[3].x = WXROUND(bottom_left_x); points[3].y = WXROUND(bottom_left_y); points[4].x = WXROUND(top_left_x); points[4].y = WXROUND(top_left_y); dc.DrawLines(5, points); } void wxShape::Attach(wxShapeCanvas *can) { m_canvas = can; } void wxShape::Detach() { m_canvas = NULL; } void wxShape::Move(wxDC& dc, double x, double y, bool display) { double old_x = m_xpos; double old_y = m_ypos; if (!GetEventHandler()->OnMovePre(dc, x, y, old_x, old_y, display)) { // m_xpos = old_x; // m_ypos = old_y; return; } m_xpos = x; m_ypos = y; ResetControlPoints(); if (display) Draw(dc); MoveLinks(dc); GetEventHandler()->OnMovePost(dc, x, y, old_x, old_y, display); } void wxShape::MoveLinks(wxDC& dc) { GetEventHandler()->OnMoveLinks(dc); } void wxShape::Draw(wxDC& dc) { if (m_visible) { GetEventHandler()->OnDraw(dc); GetEventHandler()->OnDrawContents(dc); GetEventHandler()->OnDrawControlPoints(dc); GetEventHandler()->OnDrawBranches(dc); } } void wxShape::Flash() { if (GetCanvas()) { wxClientDC dc(GetCanvas()); GetCanvas()->PrepareDC(dc); dc.SetLogicalFunction(OGLRBLF); Draw(dc); dc.SetLogicalFunction(wxCOPY); Draw(dc); } } void wxShape::Show(bool show) { m_visible = show; wxNode *node = m_children.GetFirst(); while (node) { wxShape *image = (wxShape *)node->GetData(); image->Show(show); node = node->GetNext(); } } void wxShape::Erase(wxDC& dc) { GetEventHandler()->OnErase(dc); GetEventHandler()->OnEraseControlPoints(dc); GetEventHandler()->OnDrawBranches(dc, true); } void wxShape::EraseContents(wxDC& dc) { GetEventHandler()->OnEraseContents(dc); } void wxShape::AddText(const wxString& string) { wxNode *node = m_regions.GetFirst(); if (!node) return; wxShapeRegion *region = (wxShapeRegion *)node->GetData(); region->ClearText(); wxShapeTextLine *new_line = new wxShapeTextLine(0.0, 0.0, string); region->GetFormattedText().Append(new_line); m_formatted = false; } void wxShape::SetSize(double x, double y, bool WXUNUSED(recursive)) { SetAttachmentSize(x, y); SetDefaultRegionSize(); } void wxShape::SetAttachmentSize(double w, double h) { double scaleX; double scaleY; double width, height; GetBoundingBoxMin(&width, &height); if (width == 0.0) scaleX = 1.0; else scaleX = w/width; if (height == 0.0) scaleY = 1.0; else scaleY = h/height; wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); point->m_x = (double)(point->m_x * scaleX); point->m_y = (double)(point->m_y * scaleY); node = node->GetNext(); } } // Add line FROM this object void wxShape::AddLine(wxLineShape *line, wxShape *other, int attachFrom, int attachTo, // The line ordering int positionFrom, int positionTo) { if (positionFrom == -1) { if (!m_lines.Member(line)) m_lines.Append(line); } else { // Don't preserve old ordering if we have new ordering instructions m_lines.DeleteObject(line); if (positionFrom < (int) m_lines.GetCount()) { wxNode* node = m_lines.Item(positionFrom); m_lines.Insert(node, line); } else m_lines.Append(line); } if (positionTo == -1) { if (!other->m_lines.Member(line)) other->m_lines.Append(line); } else { // Don't preserve old ordering if we have new ordering instructions other->m_lines.DeleteObject(line); if (positionTo < (int) other->m_lines.GetCount()) { wxNode* node = other->m_lines.Item(positionTo); other->m_lines.Insert(node, line); } else other->m_lines.Append(line); } #if 0 // Wrong: doesn't preserve ordering of shape already linked m_lines.DeleteObject(line); other->m_lines.DeleteObject(line); if (positionFrom == -1) m_lines.Append(line); else { if (positionFrom < m_lines.GetCount()) { wxNode* node = m_lines.Item(positionFrom); m_lines.Insert(node, line); } else m_lines.Append(line); } if (positionTo == -1) other->m_lines.Append(line); else { if (positionTo < other->m_lines.GetCount()) { wxNode* node = other->m_lines.Item(positionTo); other->m_lines.Insert(node, line); } else other->m_lines.Append(line); } #endif line->SetFrom(this); line->SetTo(other); line->SetAttachments(attachFrom, attachTo); } void wxShape::RemoveLine(wxLineShape *line) { if (line->GetFrom() == this) line->GetTo()->m_lines.DeleteObject(line); else line->GetFrom()->m_lines.DeleteObject(line); m_lines.DeleteObject(line); } #if wxUSE_PROLOGIO void wxShape::WriteAttributes(wxExpr *clause) { clause->AddAttributeValueString(_T("type"), GetClassInfo()->GetClassName()); clause->AddAttributeValue(_T("id"), m_id); if (m_pen) { int penWidth = m_pen->GetWidth(); int penStyle = m_pen->GetStyle(); if (penWidth != 1) clause->AddAttributeValue(_T("pen_width"), (long)penWidth); if (penStyle != wxPENSTYLE_SOLID) clause->AddAttributeValue(_T("pen_style"), (long)penStyle); wxString penColour = wxTheColourDatabase->FindName(m_pen->GetColour()); if (penColour == wxEmptyString) { wxString hex(oglColourToHex(m_pen->GetColour())); hex = wxString(_T("#")) + hex; clause->AddAttributeValueString(_T("pen_colour"), hex); } else if (penColour != _T("BLACK")) clause->AddAttributeValueString(_T("pen_colour"), penColour); } if (m_brush) { wxString brushColour = wxTheColourDatabase->FindName(m_brush->GetColour()); if (brushColour == wxEmptyString) { wxString hex(oglColourToHex(m_brush->GetColour())); hex = wxString(_T("#")) + hex; clause->AddAttributeValueString(_T("brush_colour"), hex); } else if (brushColour != _T("WHITE")) clause->AddAttributeValueString(_T("brush_colour"), brushColour); if (m_brush->GetStyle() != wxBRUSHSTYLE_SOLID) clause->AddAttributeValue(_T("brush_style"), (long)m_brush->GetStyle()); } // Output line ids int n_lines = m_lines.GetCount(); if (n_lines > 0) { wxExpr *list = new wxExpr(wxExprList); wxNode *node = m_lines.GetFirst(); while (node) { wxShape *line = (wxShape *)node->GetData(); wxExpr *id_expr = new wxExpr(line->GetId()); list->Append(id_expr); node = node->GetNext(); } clause->AddAttributeValue(_T("arcs"), list); } // Miscellaneous members if (m_attachmentMode != 0) clause->AddAttributeValue(_T("use_attachments"), (long)m_attachmentMode); if (m_sensitivity != OP_ALL) clause->AddAttributeValue(_T("sensitivity"), (long)m_sensitivity); if (!m_spaceAttachments) clause->AddAttributeValue(_T("space_attachments"), (long)m_spaceAttachments); if (m_fixedWidth) clause->AddAttributeValue(_T("fixed_width"), (long)m_fixedWidth); if (m_fixedHeight) clause->AddAttributeValue(_T("fixed_height"), (long)m_fixedHeight); if (m_shadowMode != SHADOW_NONE) clause->AddAttributeValue(_T("shadow_mode"), (long)m_shadowMode); if (m_centreResize != true) clause->AddAttributeValue(_T("centre_resize"), (long)0); clause->AddAttributeValue(_T("maintain_aspect_ratio"), (long) m_maintainAspectRatio); if (m_highlighted != false) clause->AddAttributeValue(_T("hilite"), (long)m_highlighted); if (m_parent) // For composite objects clause->AddAttributeValue(_T("parent"), (long)m_parent->GetId()); if (m_rotation != 0.0) clause->AddAttributeValue(_T("rotation"), m_rotation); if (!this->IsKindOf(CLASSINFO(wxLineShape))) { clause->AddAttributeValue(_T("neck_length"), (long) m_branchNeckLength); clause->AddAttributeValue(_T("stem_length"), (long) m_branchStemLength); clause->AddAttributeValue(_T("branch_spacing"), (long) m_branchSpacing); clause->AddAttributeValue(_T("branch_style"), (long) m_branchStyle); } // Write user-defined attachment points, if any if (m_attachmentPoints.GetCount() > 0) { wxExpr *attachmentList = new wxExpr(wxExprList); wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxExpr *pointExpr = new wxExpr(wxExprList); pointExpr->Append(new wxExpr((long)point->m_id)); pointExpr->Append(new wxExpr(point->m_x)); pointExpr->Append(new wxExpr(point->m_y)); attachmentList->Append(pointExpr); node = node->GetNext(); } clause->AddAttributeValue(_T("user_attachments"), attachmentList); } // Write text regions WriteRegions(clause); } void wxShape::WriteRegions(wxExpr *clause) { // Output regions as region1 = (...), region2 = (...), etc // and formatted text as text1 = (...), text2 = (...) etc. int regionNo = 1; wxChar regionNameBuf[20]; wxChar textNameBuf[20]; wxNode *node = m_regions.GetFirst(); while (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(textNameBuf, _T("text%d"), regionNo); // Original text and region attributes: // region1 = (regionName regionText x y width height minWidth minHeight proportionX proportionY // formatMode fontSize fontFamily fontStyle fontWeight textColour) wxExpr *regionExpr = new wxExpr(wxExprList); regionExpr->Append(new wxExpr(wxExprString, region->m_regionName)); regionExpr->Append(new wxExpr(wxExprString, region->m_regionText)); regionExpr->Append(new wxExpr(region->m_x)); regionExpr->Append(new wxExpr(region->m_y)); regionExpr->Append(new wxExpr(region->GetWidth())); regionExpr->Append(new wxExpr(region->GetHeight())); regionExpr->Append(new wxExpr(region->m_minWidth)); regionExpr->Append(new wxExpr(region->m_minHeight)); regionExpr->Append(new wxExpr(region->m_regionProportionX)); regionExpr->Append(new wxExpr(region->m_regionProportionY)); regionExpr->Append(new wxExpr((long)region->m_formatMode)); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetPointSize() : 10))); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetFamily() : wxDEFAULT))); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetStyle() : wxDEFAULT))); regionExpr->Append(new wxExpr((long)(region->m_font ? region->m_font->GetWeight() : wxNORMAL))); regionExpr->Append(new wxExpr(wxExprString, region->m_textColour)); // New members for pen colour/style regionExpr->Append(new wxExpr(wxExprString, region->m_penColour)); regionExpr->Append(new wxExpr((long)region->m_penStyle)); // Formatted text: // text1 = ((x y string) (x y string) ...) wxExpr *textExpr = new wxExpr(wxExprList); wxNode *textNode = region->m_formattedText.GetFirst(); while (textNode) { wxShapeTextLine *line = (wxShapeTextLine *)textNode->GetData(); wxExpr *list2 = new wxExpr(wxExprList); list2->Append(new wxExpr(line->GetX())); list2->Append(new wxExpr(line->GetY())); list2->Append(new wxExpr(wxExprString, line->GetText())); textExpr->Append(list2); textNode = textNode->GetNext(); } // Now add both attributes to the clause clause->AddAttributeValue(regionNameBuf, regionExpr); clause->AddAttributeValue(textNameBuf, textExpr); node = node->GetNext(); regionNo ++; } } void wxShape::ReadAttributes(wxExpr *clause) { clause->GetAttributeValue(_T("id"), m_id); wxRegisterId(m_id); clause->GetAttributeValue(_T("x"), m_xpos); clause->GetAttributeValue(_T("y"), m_ypos); // Input text strings (FOR COMPATIBILITY WITH OLD FILES ONLY. SEE REGION CODE BELOW.) ClearText(); wxExpr *strings = clause->AttributeValue(_T("text")); if (strings && strings->Type() == wxExprList) { m_formatted = true; // Assume text is formatted unless we prove otherwise wxExpr *node = strings->value.first; while (node) { wxExpr *string_expr = node; double the_x = 0.0; double the_y = 0.0; wxString the_string = wxEmptyString; // string_expr can either be a string, or a list of // 3 elements: x, y, and string. if (string_expr->Type() == wxExprString) { the_string = string_expr->StringValue(); m_formatted = false; } else if (string_expr->Type() == wxExprList) { wxExpr *first = string_expr->value.first; wxExpr *second = first ? first->next : (wxExpr*) NULL; wxExpr *third = second ? second->next : (wxExpr*) NULL; if (first && second && third && (first->Type() == wxExprReal || first->Type() == wxExprInteger) && (second->Type() == wxExprReal || second->Type() == wxExprInteger) && third->Type() == wxExprString) { if (first->Type() == wxExprReal) the_x = first->RealValue(); else the_x = (double)first->IntegerValue(); if (second->Type() == wxExprReal) the_y = second->RealValue(); else the_y = (double)second->IntegerValue(); the_string = third->StringValue(); } } wxShapeTextLine *line = new wxShapeTextLine(the_x, the_y, the_string); m_text.Append(line); node = node->next; } } wxString pen_string = wxEmptyString; wxString brush_string = wxEmptyString; int pen_width = 1; int pen_style = wxPENSTYLE_SOLID; int brush_style = wxBRUSHSTYLE_SOLID; m_attachmentMode = ATTACHMENT_MODE_NONE; clause->GetAttributeValue(_T("pen_colour"), pen_string); clause->GetAttributeValue(_T("text_colour"), m_textColourName); SetTextColour(m_textColourName); clause->GetAttributeValue(_T("region_name"), m_regionName); clause->GetAttributeValue(_T("brush_colour"), brush_string); clause->GetAttributeValue(_T("pen_width"), pen_width); clause->GetAttributeValue(_T("pen_style"), pen_style); clause->GetAttributeValue(_T("brush_style"), brush_style); int iVal = (int) m_attachmentMode; clause->GetAttributeValue(_T("use_attachments"), iVal); m_attachmentMode = iVal; clause->GetAttributeValue(_T("sensitivity"), m_sensitivity); iVal = (int) m_spaceAttachments; clause->GetAttributeValue(_T("space_attachments"), iVal); m_spaceAttachments = (iVal != 0); iVal = (int) m_fixedWidth; clause->GetAttributeValue(_T("fixed_width"), iVal); m_fixedWidth = (iVal != 0); iVal = (int) m_fixedHeight; clause->GetAttributeValue(_T("fixed_height"), iVal); m_fixedHeight = (iVal != 0); clause->GetAttributeValue(_T("format_mode"), m_formatMode); clause->GetAttributeValue(_T("shadow_mode"), m_shadowMode); iVal = m_branchNeckLength; clause->GetAttributeValue(_T("neck_length"), iVal); m_branchNeckLength = iVal; iVal = m_branchStemLength; clause->GetAttributeValue(_T("stem_length"), iVal); m_branchStemLength = iVal; iVal = m_branchSpacing; clause->GetAttributeValue(_T("branch_spacing"), iVal); m_branchSpacing = iVal; clause->GetAttributeValue(_T("branch_style"), m_branchStyle); iVal = (int) m_centreResize; clause->GetAttributeValue(_T("centre_resize"), iVal); m_centreResize = (iVal != 0); iVal = (int) m_maintainAspectRatio; clause->GetAttributeValue(_T("maintain_aspect_ratio"), iVal); m_maintainAspectRatio = (iVal != 0); iVal = (int) m_highlighted; clause->GetAttributeValue(_T("hilite"), iVal); m_highlighted = (iVal != 0); clause->GetAttributeValue(_T("rotation"), m_rotation); if (pen_string == wxEmptyString) pen_string = _T("BLACK"); if (brush_string == wxEmptyString) brush_string = _T("WHITE"); if (pen_string.GetChar(0) == '#') { wxColour col(oglHexToColour(pen_string.After('#'))); m_pen = wxThePenList->FindOrCreatePen(col, pen_width, (wxPenStyle)pen_style); } else m_pen = wxThePenList->FindOrCreatePen(pen_string, pen_width, (wxPenStyle)pen_style); if (!m_pen) m_pen = wxBLACK_PEN; if (brush_string.GetChar(0) == '#') { wxColour col(oglHexToColour(brush_string.After('#'))); m_brush = wxTheBrushList->FindOrCreateBrush(col, (wxBrushStyle)brush_style); } else m_brush = wxTheBrushList->FindOrCreateBrush(brush_string, (wxBrushStyle)brush_style); if (!m_brush) m_brush = wxWHITE_BRUSH; int point_size = 10; clause->GetAttributeValue(_T("point_size"), point_size); SetFont(oglMatchFont(point_size)); // Read user-defined attachment points, if any wxExpr *attachmentList = clause->AttributeValue(_T("user_attachments")); if (attachmentList) { wxExpr *pointExpr = attachmentList->GetFirst(); while (pointExpr) { wxExpr *idExpr = pointExpr->Nth(0); wxExpr *xExpr = pointExpr->Nth(1); wxExpr *yExpr = pointExpr->Nth(2); if (idExpr && xExpr && yExpr) { wxAttachmentPoint *point = new wxAttachmentPoint; point->m_id = (int)idExpr->IntegerValue(); point->m_x = xExpr->RealValue(); point->m_y = yExpr->RealValue(); m_attachmentPoints.Append((wxObject *)point); } pointExpr = pointExpr->GetNext(); } } // Read text regions ReadRegions(clause); } void wxShape::ReadRegions(wxExpr *clause) { ClearRegions(); // region1 = (regionName regionText x y width height minWidth minHeight proportionX proportionY // formatMode fontSize fontFamily fontStyle fontWeight textColour) int regionNo = 1; wxChar regionNameBuf[20]; wxChar textNameBuf[20]; wxExpr *regionExpr; wxExpr *textExpr = NULL; wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(textNameBuf, _T("text%d"), regionNo); m_formatted = true; // Assume text is formatted unless we prove otherwise while ((regionExpr = clause->AttributeValue(regionNameBuf)) != NULL) { /* * Get the region information * */ wxString regionName = wxEmptyString; wxString regionText = wxEmptyString; double x = 0.0; double y = 0.0; double width = 0.0; double height = 0.0; double minWidth = 5.0; double minHeight = 5.0; double m_regionProportionX = -1.0; double m_regionProportionY = -1.0; int formatMode = FORMAT_NONE; int fontSize = 10; int fontFamily = wxSWISS; int fontStyle = wxNORMAL; int fontWeight = wxNORMAL; wxString regionTextColour = wxEmptyString; wxString penColour = wxEmptyString; int penStyle = wxPENSTYLE_SOLID; if (regionExpr->Type() == wxExprList) { wxExpr *nameExpr = regionExpr->Nth(0); wxExpr *textExpr = regionExpr->Nth(1); wxExpr *xExpr = regionExpr->Nth(2); wxExpr *yExpr = regionExpr->Nth(3); wxExpr *widthExpr = regionExpr->Nth(4); wxExpr *heightExpr = regionExpr->Nth(5); wxExpr *minWidthExpr = regionExpr->Nth(6); wxExpr *minHeightExpr = regionExpr->Nth(7); wxExpr *propXExpr = regionExpr->Nth(8); wxExpr *propYExpr = regionExpr->Nth(9); wxExpr *formatExpr = regionExpr->Nth(10); wxExpr *sizeExpr = regionExpr->Nth(11); wxExpr *familyExpr = regionExpr->Nth(12); wxExpr *styleExpr = regionExpr->Nth(13); wxExpr *weightExpr = regionExpr->Nth(14); wxExpr *colourExpr = regionExpr->Nth(15); wxExpr *penColourExpr = regionExpr->Nth(16); wxExpr *penStyleExpr = regionExpr->Nth(17); regionName = nameExpr->StringValue(); regionText = textExpr->StringValue(); x = xExpr->RealValue(); y = yExpr->RealValue(); width = widthExpr->RealValue(); height = heightExpr->RealValue(); minWidth = minWidthExpr->RealValue(); minHeight = minHeightExpr->RealValue(); m_regionProportionX = propXExpr->RealValue(); m_regionProportionY = propYExpr->RealValue(); formatMode = (int) formatExpr->IntegerValue(); fontSize = (int)sizeExpr->IntegerValue(); fontFamily = (int)familyExpr->IntegerValue(); fontStyle = (int)styleExpr->IntegerValue(); fontWeight = (int)weightExpr->IntegerValue(); if (colourExpr) { regionTextColour = colourExpr->StringValue(); } else regionTextColour = _T("BLACK"); if (penColourExpr) penColour = penColourExpr->StringValue(); if (penStyleExpr) penStyle = (int)penStyleExpr->IntegerValue(); } wxFont *font = wxTheFontList->FindOrCreateFont(fontSize, fontFamily, (wxFontStyle)fontStyle, fontWeight); wxShapeRegion *region = new wxShapeRegion; region->SetProportions(m_regionProportionX, m_regionProportionY); region->SetFont(font); region->SetSize(width, height); region->SetPosition(x, y); region->SetMinSize(minWidth, minHeight); region->SetFormatMode(formatMode); region->SetPenStyle(penStyle); if (penColour != wxEmptyString) region->SetPenColour(penColour); region->m_textColour = regionTextColour; region->m_regionText = regionText; region->m_regionName = regionName; m_regions.Append(region); /* * Get the formatted text strings * */ textExpr = clause->AttributeValue(textNameBuf); if (textExpr && (textExpr->Type() == wxExprList)) { wxExpr *node = textExpr->value.first; while (node) { wxExpr *string_expr = node; double the_x = 0.0; double the_y = 0.0; wxString the_string = wxEmptyString; // string_expr can either be a string, or a list of // 3 elements: x, y, and string. if (string_expr->Type() == wxExprString) { the_string = string_expr->StringValue(); m_formatted = false; } else if (string_expr->Type() == wxExprList) { wxExpr *first = string_expr->value.first; wxExpr *second = first ? first->next : (wxExpr*) NULL; wxExpr *third = second ? second->next : (wxExpr*) NULL; if (first && second && third && (first->Type() == wxExprReal || first->Type() == wxExprInteger) && (second->Type() == wxExprReal || second->Type() == wxExprInteger) && third->Type() == wxExprString) { if (first->Type() == wxExprReal) the_x = first->RealValue(); else the_x = (double)first->IntegerValue(); if (second->Type() == wxExprReal) the_y = second->RealValue(); else the_y = (double)second->IntegerValue(); the_string = third->StringValue(); } } if (the_string) { wxShapeTextLine *line = new wxShapeTextLine(the_x, the_y, the_string); region->m_formattedText.Append(line); } node = node->next; } } regionNo ++; wxSprintf(regionNameBuf, _T("region%d"), regionNo); wxSprintf(textNameBuf, _T("text%d"), regionNo); } // Compatibility: check for no regions (old file). // Lines and divided rectangles must deal with this compatibility // theirselves. Composites _may_ not have any regions anyway. if ((m_regions.GetCount() == 0) && !this->IsKindOf(CLASSINFO(wxLineShape)) && !this->IsKindOf(CLASSINFO(wxDividedShape)) && !this->IsKindOf(CLASSINFO(wxCompositeShape))) { wxShapeRegion *newRegion = new wxShapeRegion; newRegion->SetName(_T("0")); m_regions.Append((wxObject *)newRegion); if (m_text.GetCount() > 0) { newRegion->ClearText(); wxNode *node = m_text.GetFirst(); while (node) { wxShapeTextLine *textLine = (wxShapeTextLine *)node->GetData(); wxNode *next = node->GetNext(); newRegion->GetFormattedText().Append((wxObject *)textLine); delete node; node = next; } } } } #endif void wxShape::Copy(wxShape& copy) { copy.m_id = m_id; copy.m_xpos = m_xpos; copy.m_ypos = m_ypos; copy.m_pen = m_pen; copy.m_brush = m_brush; copy.m_textColour = m_textColour; copy.m_centreResize = m_centreResize; copy.m_maintainAspectRatio = m_maintainAspectRatio; copy.m_attachmentMode = m_attachmentMode; copy.m_spaceAttachments = m_spaceAttachments; copy.m_highlighted = m_highlighted; copy.m_rotation = m_rotation; copy.m_textColourName = m_textColourName; copy.m_regionName = m_regionName; copy.m_sensitivity = m_sensitivity; copy.m_draggable = m_draggable; copy.m_fixedWidth = m_fixedWidth; copy.m_fixedHeight = m_fixedHeight; copy.m_formatMode = m_formatMode; copy.m_drawHandles = m_drawHandles; copy.m_visible = m_visible; copy.m_shadowMode = m_shadowMode; copy.m_shadowOffsetX = m_shadowOffsetX; copy.m_shadowOffsetY = m_shadowOffsetY; copy.m_shadowBrush = m_shadowBrush; copy.m_branchNeckLength = m_branchNeckLength; copy.m_branchStemLength = m_branchStemLength; copy.m_branchSpacing = m_branchSpacing; // Copy text regions copy.ClearRegions(); wxNode *node = m_regions.GetFirst(); while (node) { wxShapeRegion *region = (wxShapeRegion *)node->GetData(); wxShapeRegion *newRegion = new wxShapeRegion(*region); copy.m_regions.Append(newRegion); node = node->GetNext(); } // Copy attachments copy.ClearAttachments(); node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); wxAttachmentPoint *newPoint = new wxAttachmentPoint; newPoint->m_id = point->m_id; newPoint->m_x = point->m_x; newPoint->m_y = point->m_y; copy.m_attachmentPoints.Append((wxObject *)newPoint); node = node->GetNext(); } // Copy lines copy.m_lines.Clear(); node = m_lines.GetFirst(); while (node) { wxLineShape* line = (wxLineShape*) node->GetData(); copy.m_lines.Append(line); node = node->GetNext(); } } // Create and return a new, fully copied object. wxShape *wxShape::CreateNewCopy(bool resetMapping, bool recompute) { if (resetMapping) oglObjectCopyMapping.Clear(); wxShape* newObject = (wxShape*) GetClassInfo()->CreateObject(); wxASSERT( (newObject != NULL) ); wxASSERT( (newObject->IsKindOf(CLASSINFO(wxShape))) ); Copy(*newObject); if (GetEventHandler() != this) { wxShapeEvtHandler* newHandler = GetEventHandler()->CreateNewCopy(); newObject->SetEventHandler(newHandler); newObject->SetPreviousHandler(NULL); newHandler->SetPreviousHandler(newObject); newHandler->SetShape(newObject); } if (recompute) newObject->Recompute(); return newObject; } // Does the copying for this object, including copying event // handler data if any. Calls the virtual Copy function. void wxShape::CopyWithHandler(wxShape& copy) { Copy(copy); if (GetEventHandler() != this) { wxASSERT( copy.GetEventHandler() != NULL ); wxASSERT( copy.GetEventHandler() != (&copy) ); wxASSERT( GetEventHandler()->GetClassInfo() == copy.GetEventHandler()->GetClassInfo() ); GetEventHandler()->CopyData(* (copy.GetEventHandler())); } } // Default - make 6 control points void wxShape::MakeControlPoints() { double maxX, maxY, minX, minY; GetBoundingBoxMax(&maxX, &maxY); GetBoundingBoxMin(&minX, &minY); double widthMin = (double)(minX + CONTROL_POINT_SIZE + 2); double heightMin = (double)(minY + CONTROL_POINT_SIZE + 2); // Offsets from main object double top = (double)(- (heightMin / 2.0)); double bottom = (double)(heightMin / 2.0 + (maxY - minY)); double left = (double)(- (widthMin / 2.0)); double right = (double)(widthMin / 2.0 + (maxX - minX)); wxControlPoint *control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, top, CONTROL_POINT_DIAGONAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, top, CONTROL_POINT_VERTICAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, top, CONTROL_POINT_DIAGONAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, 0, CONTROL_POINT_HORIZONTAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, right, bottom, CONTROL_POINT_DIAGONAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, 0, bottom, CONTROL_POINT_VERTICAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, bottom, CONTROL_POINT_DIAGONAL); m_canvas->AddShape(control); m_controlPoints.Append(control); control = new wxControlPoint(m_canvas, this, CONTROL_POINT_SIZE, left, 0, CONTROL_POINT_HORIZONTAL); m_canvas->AddShape(control); m_controlPoints.Append(control); } void wxShape::MakeMandatoryControlPoints() { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->MakeMandatoryControlPoints(); node = node->GetNext(); } } void wxShape::ResetMandatoryControlPoints() { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->ResetMandatoryControlPoints(); node = node->GetNext(); } } void wxShape::ResetControlPoints() { ResetMandatoryControlPoints(); if (m_controlPoints.GetCount() < 1) return; double maxX, maxY, minX, minY; GetBoundingBoxMax(&maxX, &maxY); GetBoundingBoxMin(&minX, &minY); double widthMin = (double)(minX + CONTROL_POINT_SIZE + 2); double heightMin = (double)(minY + CONTROL_POINT_SIZE + 2); // Offsets from main object double top = (double)(- (heightMin / 2.0)); double bottom = (double)(heightMin / 2.0 + (maxY - minY)); double left = (double)(- (widthMin / 2.0)); double right = (double)(widthMin / 2.0 + (maxX - minX)); wxNode *node = m_controlPoints.GetFirst(); wxControlPoint *control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = top; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = 0; control->m_yoffset = top; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = top; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = 0; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = right; control->m_yoffset = bottom; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = 0; control->m_yoffset = bottom; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = bottom; node = node->GetNext(); control = (wxControlPoint *)node->GetData(); control->m_xoffset = left; control->m_yoffset = 0; } void wxShape::DeleteControlPoints(wxDC *dc) { wxNode *node = m_controlPoints.GetFirst(); while (node) { wxControlPoint *control = (wxControlPoint *)node->GetData(); if (dc) control->GetEventHandler()->OnErase(*dc); m_canvas->RemoveShape(control); delete control; delete node; node = m_controlPoints.GetFirst(); } // Children of divisions are contained objects, // so stop here if (!IsKindOf(CLASSINFO(wxDivisionShape))) { node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->DeleteControlPoints(dc); node = node->GetNext(); } } } void wxShape::OnDrawControlPoints(wxDC& dc) { if (!m_drawHandles) return; dc.SetBrush(* wxBLACK_BRUSH); dc.SetPen(* wxBLACK_PEN); wxNode *node = m_controlPoints.GetFirst(); while (node) { wxControlPoint *control = (wxControlPoint *)node->GetData(); control->Draw(dc); node = node->GetNext(); } // Children of divisions are contained objects, // so stop here. // This test bypasses the type facility for speed // (critical when drawing) if (!IsKindOf(CLASSINFO(wxDivisionShape))) { node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->GetEventHandler()->OnDrawControlPoints(dc); node = node->GetNext(); } } } void wxShape::OnEraseControlPoints(wxDC& dc) { wxNode *node = m_controlPoints.GetFirst(); while (node) { wxControlPoint *control = (wxControlPoint *)node->GetData(); control->Erase(dc); node = node->GetNext(); } if (!IsKindOf(CLASSINFO(wxDivisionShape))) { node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->GetEventHandler()->OnEraseControlPoints(dc); node = node->GetNext(); } } } void wxShape::Select(bool select, wxDC* dc) { m_selected = select; if (select) { MakeControlPoints(); // Children of divisions are contained objects, // so stop here if (!IsKindOf(CLASSINFO(wxDivisionShape))) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->MakeMandatoryControlPoints(); node = node->GetNext(); } } if (dc) GetEventHandler()->OnDrawControlPoints(*dc); } if (!select) { DeleteControlPoints(dc); if (!IsKindOf(CLASSINFO(wxDivisionShape))) { wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); child->DeleteControlPoints(dc); node = node->GetNext(); } } } } bool wxShape::Selected() const { return m_selected; } bool wxShape::AncestorSelected() const { if (m_selected) return true; if (!GetParent()) return false; else return GetParent()->AncestorSelected(); } int wxShape::GetNumberOfAttachments() const { // Should return the MAXIMUM attachment point id here, // so higher-level functions can iterate through all attachments, // even if they're not contiguous. if (m_attachmentPoints.GetCount() == 0) return 4; else { int maxN = 3; wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id > maxN) maxN = point->m_id; node = node->GetNext(); } return maxN+1;; } } bool wxShape::AttachmentIsValid(int attachment) const { if (m_attachmentPoints.GetCount() == 0) { return ((attachment >= 0) && (attachment < 4)) ; } wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) return true; node = node->GetNext(); } return false; } bool wxShape::GetAttachmentPosition(int attachment, double *x, double *y, int nth, int no_arcs, wxLineShape *line) { if (m_attachmentMode == ATTACHMENT_MODE_NONE) { *x = m_xpos; *y = m_ypos; return true; } else if (m_attachmentMode == ATTACHMENT_MODE_BRANCHING) { wxRealPoint pt, stemPt; GetBranchingAttachmentPoint(attachment, nth, pt, stemPt); *x = pt.x; *y = pt.y; return true; } else if (m_attachmentMode == ATTACHMENT_MODE_EDGE) { if (m_attachmentPoints.GetCount() > 0) { wxNode *node = m_attachmentPoints.GetFirst(); while (node) { wxAttachmentPoint *point = (wxAttachmentPoint *)node->GetData(); if (point->m_id == attachment) { *x = (double)(m_xpos + point->m_x); *y = (double)(m_ypos + point->m_y); return true; } node = node->GetNext(); } *x = m_xpos; *y = m_ypos; return false; } else { // Assume is rectangular double w, h; GetBoundingBoxMax(&w, &h); double top = (double)(m_ypos + h/2.0); double bottom = (double)(m_ypos - h/2.0); double left = (double)(m_xpos - w/2.0); double right = (double)(m_xpos + w/2.0); #if 0 /* bool isEnd = */ (line && line->IsEnd(this)); #endif int physicalAttachment = LogicalToPhysicalAttachment(attachment); // Simplified code switch (physicalAttachment) { case 0: { wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, bottom), wxRealPoint(right, bottom), nth, no_arcs, line); *x = pt.x; *y = pt.y; break; } case 1: { wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(right, bottom), wxRealPoint(right, top), nth, no_arcs, line); *x = pt.x; *y = pt.y; break; } case 2: { wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, top), wxRealPoint(right, top), nth, no_arcs, line); *x = pt.x; *y = pt.y; break; } case 3: { wxRealPoint pt = CalcSimpleAttachment(wxRealPoint(left, bottom), wxRealPoint(left, top), nth, no_arcs, line); *x = pt.x; *y = pt.y; break; } default: { return false; } } return true; } } return false; } void wxShape::GetBoundingBoxMax(double *w, double *h) { double ww, hh; GetBoundingBoxMin(&ww, &hh); if (m_shadowMode != SHADOW_NONE) { ww += m_shadowOffsetX; hh += m_shadowOffsetY; } *w = ww; *h = hh; } // Returns true if image is a descendant of this composite bool wxShape::HasDescendant(wxShape *image) { if (image == this) return true; wxNode *node = m_children.GetFirst(); while (node) { wxShape *child = (wxShape *)node->GetData(); bool ans = child->HasDescendant(image); if (ans) return true; node = node->GetNext(); } return false; } // Clears points from a list of wxRealPoints, and clears list void wxShape::ClearPointList(wxList& list) { wxNode* node = list.GetFirst(); while (node) { wxRealPoint* pt = (wxRealPoint*) node->GetData(); delete pt; node = node->GetNext(); } list.Clear(); } // Assuming the attachment lies along a vertical or horizontal line, // calculate the position on that point. wxRealPoint wxShape::CalcSimpleAttachment(const wxRealPoint& pt1, const wxRealPoint& pt2, int nth, int noArcs, wxLineShape* line) { bool isEnd = (line && line->IsEnd(this)); // Are we horizontal or vertical? bool isHorizontal = (oglRoughlyEqual(pt1.y, pt2.y) == true); double x, y; if (isHorizontal) { wxRealPoint firstPoint, secondPoint; if (pt1.x > pt2.x) { firstPoint = pt2; secondPoint = pt1; } else { firstPoint = pt1; secondPoint = pt2; } if (m_spaceAttachments) { if (line && (line->GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE)) { // Align line according to the next handle along wxRealPoint *point = line->GetNextControlPoint(this); if (point->x < firstPoint.x) x = firstPoint.x; else if (point->x > secondPoint.x) x = secondPoint.x; else x = point->x; } else x = firstPoint.x + (nth + 1)*(secondPoint.x - firstPoint.x)/(noArcs + 1); } else x = (secondPoint.x - firstPoint.x)/2.0; // Midpoint y = pt1.y; } else { wxASSERT( oglRoughlyEqual(pt1.x, pt2.x) == true ); wxRealPoint firstPoint, secondPoint; if (pt1.y > pt2.y) { firstPoint = pt2; secondPoint = pt1; } else { firstPoint = pt1; secondPoint = pt2; } if (m_spaceAttachments) { if (line && (line->GetAlignmentType(isEnd) == LINE_ALIGNMENT_TO_NEXT_HANDLE)) { // Align line according to the next handle along wxRealPoint *point = line->GetNextControlPoint(this); if (point->y < firstPoint.y) y = firstPoint.y; else if (point->y > secondPoint.y) y = secondPoint.y; else y = point->y; } else y = firstPoint.y + (nth + 1)*(secondPoint.y - firstPoint.y)/(noArcs + 1); } else y = (secondPoint.y - firstPoint.y)/2.0; // Midpoint x = pt1.x; } return wxRealPoint(x, y); } // Return the zero-based position in m_lines of line. int wxShape::GetLinePosition(wxLineShape* line) { for (size_t i = 0; i < m_lines.GetCount(); i++) if ((wxLineShape*) (m_lines.Item(i)->GetData()) == line) return i; return 0; } // // |________| // | <- root // | <- neck // shoulder1 ->---------<- shoulder2 // | | | | | // <- branching attachment point N-1 // This function gets information about where branching connections go. // Returns false if there are no lines at this attachment. bool wxShape::GetBranchingAttachmentInfo(int attachment, wxRealPoint& root, wxRealPoint& neck, wxRealPoint& shoulder1, wxRealPoint& shoulder2) { int physicalAttachment = LogicalToPhysicalAttachment(attachment); // Number of lines at this attachment. int lineCount = GetAttachmentLineCount(attachment); if (lineCount == 0) return false; int totalBranchLength = m_branchSpacing * (lineCount - 1); root = GetBranchingAttachmentRoot(attachment); // Assume that we have attachment points 0 to 3: top, right, bottom, left. switch (physicalAttachment) { case 0: { neck.x = GetX(); neck.y = root.y - m_branchNeckLength; shoulder1.x = root.x - (totalBranchLength/2.0) ; shoulder2.x = root.x + (totalBranchLength/2.0) ; shoulder1.y = neck.y; shoulder2.y = neck.y; break; } case 1: { neck.x = root.x + m_branchNeckLength; neck.y = root.y; shoulder1.x = neck.x ; shoulder2.x = neck.x ; shoulder1.y = neck.y - (totalBranchLength/2.0) ; shoulder2.y = neck.y + (totalBranchLength/2.0) ; break; } case 2: { neck.x = GetX(); neck.y = root.y + m_branchNeckLength; shoulder1.x = root.x - (totalBranchLength/2.0) ; shoulder2.x = root.x + (totalBranchLength/2.0) ; shoulder1.y = neck.y; shoulder2.y = neck.y; break; } case 3: { neck.x = root.x - m_branchNeckLength; neck.y = root.y ; shoulder1.x = neck.x ; shoulder2.x = neck.x ; shoulder1.y = neck.y - (totalBranchLength/2.0) ; shoulder2.y = neck.y + (totalBranchLength/2.0) ; break; } default: { wxFAIL_MSG( wxT("Unrecognised attachment point in GetBranchingAttachmentInfo.") ); break; } } return true; } // n is the number of the adjoining line, from 0 to N-1 where N is the number of lines // at this attachment point. // Get the attachment point where the arc joins the stem, and also the point where the // the stem meets the shoulder. bool wxShape::GetBranchingAttachmentPoint(int attachment, int n, wxRealPoint& pt, wxRealPoint& stemPt) { int physicalAttachment = LogicalToPhysicalAttachment(attachment); wxRealPoint root, neck, shoulder1, shoulder2; GetBranchingAttachmentInfo(attachment, root, neck, shoulder1, shoulder2); // Assume that we have attachment points 0 to 3: top, right, bottom, left. switch (physicalAttachment) { case 0: { pt.y = neck.y - m_branchStemLength; pt.x = shoulder1.x + n*m_branchSpacing; stemPt.x = pt.x; stemPt.y = neck.y; break; } case 2: { pt.y = neck.y + m_branchStemLength; pt.x = shoulder1.x + n*m_branchSpacing; stemPt.x = pt.x; stemPt.y = neck.y; break; } case 1: { pt.x = neck.x + m_branchStemLength; pt.y = shoulder1.y + n*m_branchSpacing; stemPt.x = neck.x; stemPt.y = pt.y; break; } case 3: { pt.x = neck.x - m_branchStemLength; pt.y = shoulder1.y + n*m_branchSpacing; stemPt.x = neck.x; stemPt.y = pt.y; break; } default: { wxFAIL_MSG( wxT("Unrecognised attachment point in GetBranchingAttachmentPoint.") ); break; } } return true; } // Get the number of lines at this attachment position. int wxShape::GetAttachmentLineCount(int attachment) const { int count = 0; wxNode* node = m_lines.GetFirst(); while (node) { wxLineShape* lineShape = (wxLineShape*) node->GetData(); if ((lineShape->GetFrom() == this) && (lineShape->GetAttachmentFrom() == attachment)) count ++; else if ((lineShape->GetTo() == this) && (lineShape->GetAttachmentTo() == attachment)) count ++; node = node->GetNext(); } return count; } // This function gets the root point at the given attachment. wxRealPoint wxShape::GetBranchingAttachmentRoot(int attachment) { int physicalAttachment = LogicalToPhysicalAttachment(attachment); wxRealPoint root; double width, height; GetBoundingBoxMax(& width, & height); // Assume that we have attachment points 0 to 3: top, right, bottom, left. switch (physicalAttachment) { case 0: { root.x = GetX() ; root.y = GetY() - height/2.0; break; } case 1: { root.x = GetX() + width/2.0; root.y = GetY() ; break; } case 2: { root.x = GetX() ; root.y = GetY() + height/2.0; break; } case 3: { root.x = GetX() - width/2.0; root.y = GetY() ; break; } default: { wxFAIL_MSG( wxT("Unrecognised attachment point in GetBranchingAttachmentRoot.") ); break; } } return root; } // Draw or erase the branches (not the actual arcs though) void wxShape::OnDrawBranches(wxDC& dc, int attachment, bool erase) { int count = GetAttachmentLineCount(attachment); if (count == 0) return; wxRealPoint root, neck, shoulder1, shoulder2; GetBranchingAttachmentInfo(attachment, root, neck, shoulder1, shoulder2); if (erase) { dc.SetPen(*wxWHITE_PEN); dc.SetBrush(*wxWHITE_BRUSH); } else { dc.SetPen(*wxBLACK_PEN); dc.SetBrush(*wxBLACK_BRUSH); } // Draw neck dc.DrawLine((long) root.x, (long) root.y, (long) neck.x, (long) neck.y); if (count > 1) { // Draw shoulder-to-shoulder line dc.DrawLine((long) shoulder1.x, (long) shoulder1.y, (long) shoulder2.x, (long) shoulder2.y); } // Draw all the little branches int i; for (i = 0; i < count; i++) { wxRealPoint pt, stemPt; GetBranchingAttachmentPoint(attachment, i, pt, stemPt); dc.DrawLine((long) stemPt.x, (long) stemPt.y, (long) pt.x, (long) pt.y); if ((GetBranchStyle() & BRANCHING_ATTACHMENT_BLOB) && (count > 1)) { long blobSize=6; // dc.DrawEllipse((long) (stemPt.x + 0.5 - (blobSize/2.0)), (long) (stemPt.y + 0.5 - (blobSize/2.0)), blobSize, blobSize); dc.DrawEllipse((long) (stemPt.x - (blobSize/2.0)), (long) (stemPt.y - (blobSize/2.0)), blobSize, blobSize); } } } // Draw or erase the branches (not the actual arcs though) void wxShape::OnDrawBranches(wxDC& dc, bool erase) { if (m_attachmentMode != ATTACHMENT_MODE_BRANCHING) return; int count = GetNumberOfAttachments(); int i; for (i = 0; i < count; i++) OnDrawBranches(dc, i, erase); } // Only get the attachment position at the _edge_ of the shape, ignoring // branching mode. This is used e.g. to indicate the edge of interest, not the point // on the attachment branch. bool wxShape::GetAttachmentPositionEdge(int attachment, double *x, double *y, int nth, int no_arcs, wxLineShape *line) { int oldMode = m_attachmentMode; // Calculate as if to edge, not branch if (m_attachmentMode == ATTACHMENT_MODE_BRANCHING) m_attachmentMode = ATTACHMENT_MODE_EDGE; bool success = GetAttachmentPosition(attachment, x, y, nth, no_arcs, line); m_attachmentMode = oldMode; return success; } // Rotate the standard attachment point from physical (0 is always North) // to logical (0 -> 1 if rotated by 90 degrees) int wxShape::PhysicalToLogicalAttachment(int physicalAttachment) const { const double pi = M_PI ; int i; if (oglRoughlyEqual(GetRotation(), 0.0)) { i = physicalAttachment; } else if (oglRoughlyEqual(GetRotation(), (pi/2.0))) { i = physicalAttachment - 1; } else if (oglRoughlyEqual(GetRotation(), pi)) { i = physicalAttachment - 2; } else if (oglRoughlyEqual(GetRotation(), (3.0*pi/2.0))) { i = physicalAttachment - 3; } else // Can't handle -- assume the same. return physicalAttachment; if (i < 0) i += 4; return i; } // Rotate the standard attachment point from logical // to physical (0 is always North) int wxShape::LogicalToPhysicalAttachment(int logicalAttachment) const { const double pi = M_PI ; int i; if (oglRoughlyEqual(GetRotation(), 0.0)) { i = logicalAttachment; } else if (oglRoughlyEqual(GetRotation(), (pi/2.0))) { i = logicalAttachment + 1; } else if (oglRoughlyEqual(GetRotation(), pi)) { i = logicalAttachment + 2; } else if (oglRoughlyEqual(GetRotation(), (3.0*pi/2.0))) { i = logicalAttachment + 3; } else // Can't handle -- assume the same. return logicalAttachment; if (i > 3) i -= 4; return i; } void wxShape::Rotate(double WXUNUSED(x), double WXUNUSED(y), double theta) { const double pi = M_PI ; m_rotation = theta; if (m_rotation < 0.0) { m_rotation += 2*pi; } else if (m_rotation > 2*pi) { m_rotation -= 2*pi; } } wxPen wxShape::GetBackgroundPen() { if (GetCanvas()) { wxColour c = GetCanvas()->GetBackgroundColour(); return wxPen(c, 1, wxPENSTYLE_SOLID); } return * g_oglWhiteBackgroundPen; } wxBrush wxShape::GetBackgroundBrush() { if (GetCanvas()) { wxColour c = GetCanvas()->GetBackgroundColour(); return wxBrush(c, wxBRUSHSTYLE_SOLID); } return * g_oglWhiteBackgroundBrush; }
[ "firodj@gmail.com" ]
firodj@gmail.com
93a8faa0f3fa53b73a0f843e43ed3d1a79359ca9
120526f47e2ecc1e4d8b45a5befb1f5a178003dd
/栈和队列/两栈共享空间.cpp
1a954264f20c5e5f61135ac36c3836f4074d1713
[]
no_license
summerKK/data_structure_and_algorithms
7d30861247e80c5ad372199230f23eadab482cbd
c21cda9563f01a3ab6f9431f683b98f6ddaef6b8
refs/heads/master
2020-12-01T05:36:26.761490
2020-01-01T16:05:44
2020-01-01T16:05:44
230,568,026
0
0
null
null
null
null
UTF-8
C++
false
false
1,479
cpp
// // Created by 陈思贝 on 2019/12/22. // #include <iostream> using namespace std; #define MAXSIZE 100 typedef int DATA_TYPE; typedef struct { DATA_TYPE data[MAXSIZE]; int top1; int top2; } StackList; void InitStackList(StackList &s) { s.top1 = -1; s.top2 = MAXSIZE; } void push(StackList &s, DATA_TYPE x, int stackNum) { if (s.top1 + 1 == s.top2) { printf("stack overflow"); exit(0); } if (stackNum == 1) { s.data[++s.top1] = x; } else { s.data[--s.top2] = x; } } void pop(StackList &s, DATA_TYPE *x, int stackNum) { if (stackNum == 1) { if (s.top1 == -1) { printf("stack empty"); exit(0); } *x = s.data[s.top1--]; } if (stackNum == 2) { if (s.top2 == MAXSIZE) { printf("stack empty"); exit(0); } *x = s.data[s.top2++]; } } int main() { StackList stackList; InitStackList(stackList); int i; push(stackList, 1, 1); push(stackList, 2, 1); push(stackList, 3, 1); pop(stackList, &i, 1); cout << i << endl; pop(stackList, &i, 1); cout << i << endl; pop(stackList, &i, 1); cout << i << endl; int j; push(stackList, 100, 2); push(stackList, 99, 2); push(stackList, 98, 2); pop(stackList, &j, 2); cout << j << endl; pop(stackList, &j, 2); cout << j << endl; pop(stackList, &j, 2); cout << j << endl; }
[ "su943515688@gmail.com" ]
su943515688@gmail.com
cbf4d4ddad73c32be6b255267196f29d41355c7b
8c5ca1bee5f581cebea051f181725698ef3e4e31
/src/libtsduck/dtv/signalization/tsTablesLoggerFilterInterface.cpp
28f0057a5888335bee2429e0431881e3c772e83b
[ "BSD-2-Clause" ]
permissive
vtns/tsduck
1f914c799fcd3e758fbea144cbd7a14f95e17f00
2a7c923ef054d8f42fd4428efe905b033574f78f
refs/heads/master
2023-08-28T08:11:02.430223
2021-10-29T23:28:47
2021-10-29T23:28:47
null
0
0
null
null
null
null
UTF-8
C++
false
false
1,696
cpp
//---------------------------------------------------------------------------- // // TSDuck - The MPEG Transport Stream Toolkit // Copyright (c) 2005-2021, Thierry Lelegard // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // //---------------------------------------------------------------------------- #include "tsTablesLoggerFilterInterface.h" ts::TablesLoggerFilterInterface::~TablesLoggerFilterInterface() { }
[ "thierry@lelegard.fr" ]
thierry@lelegard.fr