diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-12 15:06:40 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-02-12 15:06:40 +0000 |
commit | 86d686c1755d86cdf4b8e093ede57de3942bfff3 (patch) | |
tree | 8031728d2f30cc5e8a24fa9065a6d136d3ae742e | |
parent | 868aa50a5e42f060d615058de6483727edb7c376 (diff) |
This commit was manufactured by cvs2svn to create tagrtlopt-merge-20030212
'rtlopt-merge-20030212'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/rtlopt-merge-20030212@62768 138bc75d-0d04-0410-961f-82ee72b054a4
583 files changed, 0 insertions, 23100 deletions
diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h deleted file mode 100644 index 7da93053256..00000000000 --- a/gcc/config/i386/scodbx.h +++ /dev/null @@ -1,84 +0,0 @@ -/* Definitions for Intel 386 running SCO Unix System V, - using dbx-in-coff encapsulation. - Copyright (C) 1992, 1995, 1996, 1999 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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, or (at your option) -any later version. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#include "i386/svr3dbx.h" - -/* Overridden defines for SCO systems from sco.h. */ - -/* By default, target has a 80387, uses IEEE compatible arithmetic, - and returns float values in the 387, ie, - (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387) - - SCO's software emulation of a 387 fails to handle the `fucomp' - opcode. fucomp is only used when generating IEEE compliant code. - So don't make TARGET_IEEE_FP default for SCO. */ - -#undef TARGET_SUBTARGET_DEFAULT -#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS) - -/* Use crt1.o as a startup file and crtn.o as a closing file. */ - -#undef STARTFILE_SPEC -#define STARTFILE_SPEC \ - "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\ - %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}" - -/* Library spec, including SCO international language support. */ - -#undef LIB_SPEC -#define LIB_SPEC \ - "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc" - -/* Specify predefined symbols in preprocessor. */ - -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3" - -#undef CPP_SPEC -#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}" - -/* This spec is used for telling cpp whether char is signed or not. */ - -#undef SIGNED_CHAR_SPEC -#if DEFAULT_SIGNED_CHAR -#define SIGNED_CHAR_SPEC \ - "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#else -#define SIGNED_CHAR_SPEC \ - "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}" -#endif - -/* caller has to pop the extra argument passed to functions that return - structures. */ - -#undef RETURN_POPS_ARGS -#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \ - ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \ - : (TARGET_RTD \ - && (TYPE_ARG_TYPES (FUNTYPE) == 0 \ - || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \ - == void_type_node))) ? (SIZE) \ - : 0) -/* On other 386 systems, the last line looks like this: - : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */ - -/* Handle #pragma pack. */ -#define HANDLE_SYSV_PRAGMA diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h deleted file mode 100644 index 881c5c7be9d..00000000000 --- a/gcc/config/i386/xm-dgux.h +++ /dev/null @@ -1,4 +0,0 @@ -/* Configuration for GCC for Intel i386 running DG/ux */ - -/* looks just like sysv4 for now */ -#include "xm-svr4.h" diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h deleted file mode 100644 index 6c0f0a25630..00000000000 --- a/gcc/config/i386/xm-sun.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0. - Copyright (C) 1988, 1997 Free Software Foundation, Inc. - -This file is part of GNU CC. - -GNU CC 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, or (at your option) -any later version. - -GNU CC 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 GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 59 Temple Place - Suite 330, -Boston, MA 02111-1307, USA. */ - -#define USG diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h deleted file mode 100644 index 9a655443ff5..00000000000 --- a/gcc/config/i386/xm-sysv3.h +++ /dev/null @@ -1,3 +0,0 @@ -/* Configuration for GCC for Intel i386 running System V Release 3. */ - -#include "xm-svr3.h" diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C deleted file mode 100644 index c27aa8d2df7..00000000000 --- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C +++ /dev/null @@ -1,19 +0,0 @@ -//Build don't link: -#include <vector> -#include <algorithm> - -template <class T> class Expr -{ -public : -Expr(){}; -Expr(const T&){}; -}; - -template <class T > -inline bool compare(const Expr<T> a, const Expr<T> b){ return true; }; - -int main() -{ - std::vector<int> a(3); - std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000105-1.c b/gcc/testsuite/gcc.c-torture/compile/20000105-1.c deleted file mode 100644 index 6f389d88b22..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000105-1.c +++ /dev/null @@ -1,27 +0,0 @@ -main(int na, char* argv[]) -{ - int wflg = 0, tflg = 0; - int dflg = 0; - exit(0); - while(1) - { - switch(argv[1][0]) - { - help: - exit(0); - case 'w': - case 'W': - wflg = 1; - break; - case 't': - case 'T': - tflg = 1; - break; - case 'd': - dflg = 1; - break; - } - } -} - - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000105-2.c b/gcc/testsuite/gcc.c-torture/compile/20000105-2.c deleted file mode 100644 index 7689395f45d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000105-2.c +++ /dev/null @@ -1,5 +0,0 @@ -foo () -{ - long long int i = (int) ""; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000120-1.c b/gcc/testsuite/gcc.c-torture/compile/20000120-1.c deleted file mode 100644 index 99843933bd0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000120-1.c +++ /dev/null @@ -1,13 +0,0 @@ -extern char letters[26+1]; -char letter; -int letter_number; -char letters[] = "AbCdefghiJklmNopQrStuVwXyZ"; - -static void -pad_home1 () -{ - letter = letters[letter_number = - letters[letter_number + 1] ? letter_number + - 1 : 0]; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000120-2.c b/gcc/testsuite/gcc.c-torture/compile/20000120-2.c deleted file mode 100644 index 737eb92ac64..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000120-2.c +++ /dev/null @@ -1,18 +0,0 @@ -extern __inline__ int -odd(int i) -{ - return i & 0x1; -} - -int -foo(int i, int j) -{ - return odd(i + j); -} - -int -odd(int i) -{ - return i & 0x1; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000127-1.c b/gcc/testsuite/gcc.c-torture/compile/20000127-1.c deleted file mode 100644 index 34b173c680f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000127-1.c +++ /dev/null @@ -1,7 +0,0 @@ -double bar(void), c; -int foo(void) { - double a, b; - int i = bar() + bar(); - a = i; i += 1; a += 0.1; i = c + i; - return i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c b/gcc/testsuite/gcc.c-torture/compile/20000211-1.c deleted file mode 100644 index 8d8a4074e0f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000211-1.c +++ /dev/null @@ -1,98 +0,0 @@ -typedef long unsigned int size_t; -typedef unsigned char Bufbyte; -typedef int Bytecount; -typedef int Charcount; -typedef struct lstream Lstream; -typedef int Lisp_Object; -extern Lisp_Object Qnil; -extern inline int -TRUE_LIST_P (Lisp_Object object) -{ - return (( object ) == ( Qnil )) ; -} -struct Lisp_String -{ - Bytecount _size; - Bufbyte *_data; -}; -typedef enum lstream_buffering -{ - LSTREAM_LINE_BUFFERED, -} Lstream_buffering; -struct lstream -{ - Lstream_buffering buffering; - unsigned char *out_buffer; - size_t out_buffer_size; - size_t out_buffer_ind; - size_t byte_count; - long flags; - char data[1]; -}; -typedef struct printf_spec printf_spec; -struct printf_spec -{ -}; -typedef union printf_arg printf_arg; -union printf_arg -{ -}; -typedef struct -{ - int cur; -} printf_spec_dynarr; -typedef struct -{ -} printf_arg_dynarr; -static void -doprnt_1 (Lisp_Object stream, const Bufbyte *string, Bytecount len, - Charcount minlen, Charcount maxlen, int minus_flag, int zero_flag) -{ - Charcount cclen; - Bufbyte pad; - Lstream *lstr = (( struct lstream *) ((void *)(((( stream ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) ; - cclen = ( len ) ; - if (zero_flag) - pad = '0'; - pad = ' '; -#if 0 - if (minlen > cclen && !minus_flag) -#endif - { - int to_add = minlen - cclen; - while (to_add > 0) - { - (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ; - to_add--; - } - } - if (maxlen >= 0) - len = ( ((( maxlen ) <= ( cclen )) ? ( maxlen ) : ( cclen )) ) ; - Lstream_write (lstr, string, len); - if (minlen > cclen && minus_flag) - { - int to_add = minlen - cclen; - while (to_add > 0) - { - (( lstr )->out_buffer_ind >= ( lstr )->out_buffer_size ? Lstream_fputc ( lstr , pad ) : (( lstr )->out_buffer[( lstr )->out_buffer_ind++] = (unsigned char) ( pad ), ( lstr )->byte_count++, ( lstr )->buffering == LSTREAM_LINE_BUFFERED && ( lstr )->out_buffer[( lstr )->out_buffer_ind - 1] == '\n' ? Lstream_flush_out ( lstr ) : 0)) ; - to_add--; - } - } -} -static Bytecount -emacs_doprnt_1 (Lisp_Object stream, const Bufbyte *format_nonreloc, - Lisp_Object format_reloc, Bytecount format_length, - int nargs, - const Lisp_Object *largs) -{ - int i; - printf_spec_dynarr *specs = 0; - format_nonreloc = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_data + 0) ; - format_length = (( (( struct Lisp_String *) ((void *)(((( format_reloc ) & ((1UL << ((4 * 8 ) - 4 ) ) - 1UL) ) ) | 0x40000000 )) ) )->_size) ; - specs = parse_doprnt_spec (format_nonreloc, format_length); - for (i = 0; i < (( specs )->cur) ; i++) - { - char ch; - doprnt_1 (stream, (Bufbyte *) &ch, 1, 0, -1, 0, 0); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000211-3.c b/gcc/testsuite/gcc.c-torture/compile/20000211-3.c deleted file mode 100644 index 7e43c8ad467..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000211-3.c +++ /dev/null @@ -1,10 +0,0 @@ -void f_clos(int x) - -{ - switch(x) { - default: - mumble: - } -} - - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000224-1.c b/gcc/testsuite/gcc.c-torture/compile/20000224-1.c deleted file mode 100644 index 1c72b6accab..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000224-1.c +++ /dev/null @@ -1,41 +0,0 @@ -enum Lisp_Type -{ - Lisp_Int - ,Lisp_Record - ,Lisp_Cons - ,Lisp_String - ,Lisp_Vector - ,Lisp_Symbol - ,Lisp_Char -}; -typedef -union Lisp_Object - { - struct - { - enum Lisp_Type type: 3L ; - unsigned long markbit: 1; - unsigned long val: 32; - } gu; - long i; - } -Lisp_Object; -extern int initialized; -void -init_device_faces (int *d) -{ - if (initialized) - { - Lisp_Object tdevice; - do { - tdevice = (union Lisp_Object) - { gu: - { markbit: 0, - type: Lisp_Record, - val: ((unsigned long )d) - } - }; - } while (0); - call_critical_lisp_code (tdevice); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000314-1.c b/gcc/testsuite/gcc.c-torture/compile/20000314-1.c deleted file mode 100644 index 26c13a7d685..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000314-1.c +++ /dev/null @@ -1,11 +0,0 @@ -struct { - char a[5]; -} *p; - -int main () -{ - int i = -1; - - if(p->a[-i]) - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000314-2.c b/gcc/testsuite/gcc.c-torture/compile/20000314-2.c deleted file mode 100644 index 3fdb3c3a857..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000314-2.c +++ /dev/null @@ -1,6 +0,0 @@ -extern void malloc(__SIZE_TYPE__ size); - -toto() -{ - malloc(100); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000319-1.c b/gcc/testsuite/gcc.c-torture/compile/20000319-1.c deleted file mode 100644 index db00e4f016f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000319-1.c +++ /dev/null @@ -1,6 +0,0 @@ -struct foo -{ - long x; - char y; - long boom[0]; -}; diff --git a/gcc/testsuite/gcc.c-torture/compile/20000326-1.c b/gcc/testsuite/gcc.c-torture/compile/20000326-1.c deleted file mode 100644 index 71ed149c8ed..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000326-1.c +++ /dev/null @@ -1,23 +0,0 @@ -long sys_reboot(int magic1, int magic2, int cmd, void * arg) -{ - switch (cmd) { - case 0x89ABCDEF: - break; - - case 0x00000000: - break; - - case 0xCDEF0123: - break; - - case 0x4321FEDC: - break; - - case 0xA1B2C3D4: - break; - - default: - break; - }; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000326-2.c b/gcc/testsuite/gcc.c-torture/compile/20000326-2.c deleted file mode 100644 index 055260f6e64..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000326-2.c +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NO_LABEL_VALUES -extern int printk(const char *fmt, ...); - -void foo (int x, int y) -{ - __label__ here; - here: - printk ("", &&here); -} - -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/20000329-1.c b/gcc/testsuite/gcc.c-torture/compile/20000329-1.c deleted file mode 100644 index 547bf96f955..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000329-1.c +++ /dev/null @@ -1,40 +0,0 @@ -int giop_tx_big_endian; - -inline -void -giop_encode_ulong (unsigned long i, char *buf) -{ - if (giop_tx_big_endian) - { - *(unsigned long *) buf = i; - } - else - { - *buf++ = i & 0xff; - *buf++ = (i >> 8) & 0xff; - *buf++ = (i >> 16) & 0xff; - *buf = (i >> 24) & 0xff; - } -} - - - -static -double -time_giop_encode (unsigned long l) -{ - int c; - char buf[4]; - - for (c = 0; c < (512 * 1024 * 1024); ++c) - { - giop_encode_ulong (l, buf); - } -} - -int -main (int ac, char *av[]) -{ - giop_tx_big_endian = 1; - time_giop_encode (0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000403-1.c b/gcc/testsuite/gcc.c-torture/compile/20000403-1.c deleted file mode 100644 index 27345b56fef..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000403-1.c +++ /dev/null @@ -1,18 +0,0 @@ -struct utsname { - char sysname[32 ]; - char version[32 ]; -}; -int -uname(name) - struct utsname *name; -{ - int mib[2], rval; - long len; - char *p; - int oerrno; - if (sysctl(mib, 2, &name->sysname, &len, 0 , 0) == -1) - ; - for (p = name->version; len--; ++p) { - *p = ' '; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000403-2.c b/gcc/testsuite/gcc.c-torture/compile/20000403-2.c deleted file mode 100644 index c793a49fb6c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000403-2.c +++ /dev/null @@ -1,6 +0,0 @@ -void -foo () -{ - long long tmp; - (( tmp ) = (long long)( tmp ) >> ( 32 )) ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000405-1.c b/gcc/testsuite/gcc.c-torture/compile/20000405-1.c deleted file mode 100644 index 64dd2e16882..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000405-1.c +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (C) 2000 Free Software Foundation - -// by Alexandre Oliva <oliva@lsd.ic.unicamp.br> -// simplified from libio/floatconv.c - -static const double bar[] = { 0 }; -int j; - -double -foo () -{ - return bar[j]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000405-2.c b/gcc/testsuite/gcc.c-torture/compile/20000405-2.c deleted file mode 100644 index 0b8559f1436..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000405-2.c +++ /dev/null @@ -1,6 +0,0 @@ -extern void foo (int); - -void bar (unsigned long l) -{ - foo(l == 0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000405-3.c b/gcc/testsuite/gcc.c-torture/compile/20000405-3.c deleted file mode 100644 index c2e88339eea..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000405-3.c +++ /dev/null @@ -1,9 +0,0 @@ -struct foo { - void *entry[40]; -} __attribute__ ((aligned(32))); - -int foo (struct foo *ptr, int idx, void *pointer) -{ - ptr->entry[idx] = pointer; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000412-1.c b/gcc/testsuite/gcc.c-torture/compile/20000412-1.c deleted file mode 100644 index 243b469e7d2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000412-1.c +++ /dev/null @@ -1,16 +0,0 @@ -typedef struct { - short a; - short b; -} s1; - -extern void g(unsigned char *b); - -void f(void) -{ - s1 a; - unsigned char *b; - - a.a = 0; - b = (unsigned char *)&a; - g(b); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000412-2.c b/gcc/testsuite/gcc.c-torture/compile/20000412-2.c deleted file mode 100644 index e76a1eb73b5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000412-2.c +++ /dev/null @@ -1,4 +0,0 @@ -char list[250][64]; - -int f(int idx) { return (strlen(list[idx])); } - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000420-1.c b/gcc/testsuite/gcc.c-torture/compile/20000420-1.c deleted file mode 100644 index 552f02e423c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000420-1.c +++ /dev/null @@ -1,19 +0,0 @@ -struct z_candidate { struct z_candidate *next;int viable;}; -int pedantic; - -static struct z_candidate * -splice_viable (cands) - struct z_candidate *cands; -{ - struct z_candidate **p = &cands; - - for (; *p; ) - { - if (pedantic ? (*p)->viable == 1 : (*p)->viable) - p = &((*p)->next); - else - *p = (*p)->next; - } - - return cands; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000420-2.c b/gcc/testsuite/gcc.c-torture/compile/20000420-2.c deleted file mode 100644 index 2d825f01992..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000420-2.c +++ /dev/null @@ -1,11 +0,0 @@ -struct x { int a, b, c; }; - -extern struct x a (); -extern void b (struct x); - -void -foo () -{ - a (); - b (a ()); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000427-1.c b/gcc/testsuite/gcc.c-torture/compile/20000427-1.c deleted file mode 100644 index dc51419cf01..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000427-1.c +++ /dev/null @@ -1,9 +0,0 @@ -int lwidth; -int lheight; -void ConvertFor3dDriver (int requirePO2, int maxAspect) -{ - int oldw = lwidth, oldh = lheight; - - lheight = FindNearestPowerOf2 (lheight); - while (lwidth/lheight > maxAspect) lheight += lheight; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000502-1.c b/gcc/testsuite/gcc.c-torture/compile/20000502-1.c deleted file mode 100644 index fcf7899a159..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000502-1.c +++ /dev/null @@ -1,17 +0,0 @@ -static int minimum(int a, int b) -{ - if(a < b) - return a; - else - return b; -} -static int a, b; -static inline int foo(void) -{ - a = minimum (a, b); - return 0; -} -static int bar(void) -{ - return foo(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000504-1.c b/gcc/testsuite/gcc.c-torture/compile/20000504-1.c deleted file mode 100644 index 1941bb34da5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000504-1.c +++ /dev/null @@ -1,15 +0,0 @@ -struct foo { - int a; - int b; -}; - -int func(struct foo *foo, int a) -{ - if (foo->b == 0) { - int ret = foo->a = a; - if (a >= 0) - foo->a = a; - return (ret); - } - return (0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000511-1.c b/gcc/testsuite/gcc.c-torture/compile/20000511-1.c deleted file mode 100644 index 11c131522e6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000511-1.c +++ /dev/null @@ -1,31 +0,0 @@ -typedef struct { - char y; - char x[32]; -} X; - -int z (void) -{ - X xxx; - xxx.x[0] = - xxx.x[31] = '0'; - xxx.y = 0xf; - return f (xxx, xxx); -} - -int main (void) -{ - int val; - - val = z (); - if (val != 0x60) - abort (); - exit (0); -} - -int f(X x, X y) -{ - if (x.y != y.y) - return 'F'; - - return x.x[0] + y.x[0]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000517-1.c b/gcc/testsuite/gcc.c-torture/compile/20000517-1.c deleted file mode 100644 index 903e61eefad..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000517-1.c +++ /dev/null @@ -1,9 +0,0 @@ -void test2 (int*, int, int, int); - -void test () -{ - int l; - - test2 (0, 0, 0, 0); - test2 (&l, 0, 0, 0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000518-1.c b/gcc/testsuite/gcc.c-torture/compile/20000518-1.c deleted file mode 100644 index fda44b657cc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000518-1.c +++ /dev/null @@ -1,17 +0,0 @@ -void callit1(void*); - -extern __inline__ void test() -{ - __label__ l1; - - callit1(&&l1); - -l1: - -} - - -void dotest() -{ - test(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000523-1.c b/gcc/testsuite/gcc.c-torture/compile/20000523-1.c deleted file mode 100644 index eab4a9c42d1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000523-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation */ -/* Contributed by Alexandre Oliva <aoliva@cygnus.com> */ - -enum { foo = sizeof(void *) }; -int i = sizeof(void *); diff --git a/gcc/testsuite/gcc.c-torture/compile/20000605-1.c b/gcc/testsuite/gcc.c-torture/compile/20000605-1.c deleted file mode 100644 index 1fe5882340f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000605-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation */ - -/* make sure we don't get confused by various flavors of void */ - -/* Origin: Jakub Jelinek <jakub@redhat.com> - * Joel Sherrill <joel.sherrill@OARcorp.com> - */ - -typedef void foo; -foo bar(void); -void baz(void) -{ - bar(); -} - -void volatile f(); - -int x() -{ - f(); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000606-1.c b/gcc/testsuite/gcc.c-torture/compile/20000606-1.c deleted file mode 100644 index 93977c0931a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000606-1.c +++ /dev/null @@ -1,10 +0,0 @@ -typedef struct _foo foo; -extern foo bar; -struct _foo { - int a; -}; - -void baz(void) -{ - bar.a = 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000609-1.c b/gcc/testsuite/gcc.c-torture/compile/20000609-1.c deleted file mode 100644 index f03aa35a7ac..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000609-1.c +++ /dev/null @@ -1,6 +0,0 @@ -int main () -{ - char temp[1024] = "tempfile"; - return temp[0] != 't'; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000629-1.c b/gcc/testsuite/gcc.c-torture/compile/20000629-1.c deleted file mode 100644 index 58b522ed815..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000629-1.c +++ /dev/null @@ -1,28 +0,0 @@ -struct a -{ - struct a * x; -}; - -void -foo (struct a * b) -{ - int i; - - for (i = 0; i < 1000; i++) - { - b->x = b; - b++; - } -} - -void -bar (struct a * b) -{ - int i; - - for (i = 0; i < 1000; i++) - { - b->x = b; - b--; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000701-1.c b/gcc/testsuite/gcc.c-torture/compile/20000701-1.c deleted file mode 100644 index 2f1e731579b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000701-1.c +++ /dev/null @@ -1,19 +0,0 @@ -void -dr106_1(void *pv, int i) -{ - *pv; - i ? *pv : *pv; - *pv, *pv; -} - -void -dr106_2(const void *pcv, volatile void *pvv, int i) -{ - *pcv; - i ? *pcv : *pcv; - *pcv, *pcv; - - *pvv; - i ? *pvv : *pvv; - *pvv, *pvv; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000717-1.c b/gcc/testsuite/gcc.c-torture/compile/20000717-1.c deleted file mode 100644 index 9a0c747ad5b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000717-1.c +++ /dev/null @@ -1,11 +0,0 @@ -short -inner_product (short *a, short *b) -{ - int i; - short sum = 0; - - for (i = 9; i >= 0; i--) - sum += (*a++) * (*b++); - - return sum; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000718.c b/gcc/testsuite/gcc.c-torture/compile/20000718.c deleted file mode 100644 index acabaf16011..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000718.c +++ /dev/null @@ -1,14 +0,0 @@ -extern double foo(double, double); -extern void bar(float*, int*); - -void -baz(int* arg) -{ - float tmp = (float)foo(2.0,1.0); - unsigned i; - short junk[64]; - - for (i=0; i<10; i++, arg++) { - bar(&tmp, arg); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000728-1.c b/gcc/testsuite/gcc.c-torture/compile/20000728-1.c deleted file mode 100644 index f56d940834e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000728-1.c +++ /dev/null @@ -1,16 +0,0 @@ -struct clock { - long sec; long usec; -}; - -int foo(void) -{ - struct clock clock_old = {0, 0}; - - for (;;) { - long foo; - - if (foo == clock_old.sec && 0 == clock_old.usec); - } - return 0; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000802-1.c b/gcc/testsuite/gcc.c-torture/compile/20000802-1.c deleted file mode 100644 index 0b2f1d6af56..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000802-1.c +++ /dev/null @@ -1,15 +0,0 @@ -struct foo { - char a[3]; - char b; - char c; -}; - -struct foo bs; -int x; -char y[3]; - -void bar(void) -{ - memcpy(bs.a, y, 3); - bs.a[1] = ((x ? &bs.b : &bs.c) - (char *)&bs) - 2; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000803-1.c b/gcc/testsuite/gcc.c-torture/compile/20000803-1.c deleted file mode 100644 index 08b50a9f210..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000803-1.c +++ /dev/null @@ -1,11 +0,0 @@ -static int gl_cnt = 0; -static char gl_buf[1024]; - -void -gl_yank() -{ - int i; - - for (i=gl_cnt; i >= 0; i--) - gl_buf[i+10] = gl_buf[i]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000804-1.c b/gcc/testsuite/gcc.c-torture/compile/20000804-1.c deleted file mode 100644 index d99cb7b5584..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000804-1.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation */ -__complex__ long long f () -{ - int i[99]; - __complex__ long long v; - - v += f (); - asm("": "+r" (v) : "r" (0), "r" (1)); - v = 2; - return v; - g (&v); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000804-1.x b/gcc/testsuite/gcc.c-torture/compile/20000804-1.x deleted file mode 100644 index 458c8e720e3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000804-1.x +++ /dev/null @@ -1,8 +0,0 @@ -# This does not work on m68hc11 due to the use of an asm statement -# to force a 'long long' (64-bits) to go in a register. - -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { - return 1 -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/20000818-1.c b/gcc/testsuite/gcc.c-torture/compile/20000818-1.c deleted file mode 100644 index 01f10f60cf2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000818-1.c +++ /dev/null @@ -1,6 +0,0 @@ -void -foo (long double x) -{ - struct {long double t;} y = {x}; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000825-1.c b/gcc/testsuite/gcc.c-torture/compile/20000825-1.c deleted file mode 100644 index 3c2e5bda75a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000825-1.c +++ /dev/null @@ -1,31 +0,0 @@ -typedef signed int s32; -typedef signed long s64; -typedef unsigned int u32; -typedef unsigned long u64; - -extern __inline__ u32 foobar(int logmask) -{ - u32 ret = ~(1 << logmask); // fails - // s32 ret = ~(1 << logmask); // ok - // u64 ret = ~(1 << logmask); // ok - // s64 ret = ~(1 << logmask); // ok - return ret; -} - -// This procedure compiles fine... -u32 good(u32 var) -{ - var = foobar(0); - return var; -} - -// This procedure does not compile... -// Same as above, but formal parameter is a pointer -// Both good() and fails() compile ok if we choose -// a different type for "ret" in foobar(). -u32 fails(u32 *var) -{ - *var = foobar(0); - return *var; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20000827-1.c b/gcc/testsuite/gcc.c-torture/compile/20000827-1.c deleted file mode 100644 index a985f908b2b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000827-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation */ -/* Contributed by Alexandre Oliva <aoliva@redhat.com> */ - -int -foo () -{ - while (1) - { - int a; - char b; - /* gcse should not merge these asm statements, since their - output operands have different modes. */ - __asm__("":"=r" (a)); __asm__("":"=r" (b)); - if (b) - return a; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000922-1.c b/gcc/testsuite/gcc.c-torture/compile/20000922-1.c deleted file mode 100644 index 0fef966e676..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000922-1.c +++ /dev/null @@ -1,12 +0,0 @@ -extern void doit(int); -void -quick_doit(int x) -{ -#ifdef __OPTIMIZE__ - if (__builtin_constant_p (x) - && x != 0) - asm volatile ("%0" : : "i#*X"(x)); - else -#endif - doit(x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20000923-1.c b/gcc/testsuite/gcc.c-torture/compile/20000923-1.c deleted file mode 100644 index 9ed98868206..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20000923-1.c +++ /dev/null @@ -1,8 +0,0 @@ -const int a = 3; -const int b = 50; - -void foo (void) -{ - long int x[a][b]; - asm ("" : : "r" (x) : "memory"); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001018-1.c b/gcc/testsuite/gcc.c-torture/compile/20001018-1.c deleted file mode 100644 index 86e5cd5dda9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001018-1.c +++ /dev/null @@ -1,10 +0,0 @@ -void -foo (void) -{ - extern char i[10]; - - { - extern char i[]; - char x[sizeof (i) == 10 ? 1 : -1]; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001024-1.c b/gcc/testsuite/gcc.c-torture/compile/20001024-1.c deleted file mode 100644 index 59208cde107..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001024-1.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation */ -/* Contributed by Nathan Sidwell <nathan@codesourcery.com> */ - -typedef __SIZE_TYPE__ size_t; - -extern void *memset(void *, int, size_t); - -struct Baz; - -void quux(struct Baz *context) -{ - memset(context, 0, 4); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c b/gcc/testsuite/gcc.c-torture/compile/20001109-1.c deleted file mode 100644 index cce8047ae8a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001109-1.c +++ /dev/null @@ -1,7 +0,0 @@ -typedef struct _foo foo; -extern foo bar; -struct _foo { - int a; -}; - -int tst[__alignof__ (bar) >= __alignof__ (int) ? 1 : -1]; diff --git a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c b/gcc/testsuite/gcc.c-torture/compile/20001109-2.c deleted file mode 100644 index a23e56bd34b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001109-2.c +++ /dev/null @@ -1,6 +0,0 @@ -extern struct foo bar; -struct foo { - int a; -}; - -int tst[__alignof__ (bar) >= __alignof__ (int) ? 1 : -1]; diff --git a/gcc/testsuite/gcc.c-torture/compile/20001116-1.c b/gcc/testsuite/gcc.c-torture/compile/20001116-1.c deleted file mode 100644 index c356392fa37..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001116-1.c +++ /dev/null @@ -1,3 +0,0 @@ -int x[60]; -char *y = ((char*)&(x[2*8 + 2]) - 8); -int z = (&"Foobar"[1] - &"Foobar"[0]); diff --git a/gcc/testsuite/gcc.c-torture/compile/20001121-1.c b/gcc/testsuite/gcc.c-torture/compile/20001121-1.c deleted file mode 100644 index 38efe6da0fe..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001121-1.c +++ /dev/null @@ -1,21 +0,0 @@ -extern int bar(int); - -int foo(int x) -{ - return 1 + bar( - ({ - int y; - switch (x) - { - case 0: y = 1; break; - case 1: y = 2; break; - case 2: y = 3; break; - case 3: y = 4; break; - case 4: y = 5; break; - case 5: y = 6; break; - default: y = 7; break; - } - y; - }) - ); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001123-1.c b/gcc/testsuite/gcc.c-torture/compile/20001123-1.c deleted file mode 100644 index 59534480db2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001123-1.c +++ /dev/null @@ -1,11 +0,0 @@ - -typedef __builtin_va_list __gnuc_va_list; -typedef __gnuc_va_list va_list; - -struct X { int y; }; - -void func(va_list va) -{ - char* a = __builtin_va_arg(va, char**)[0]; - int b = __builtin_va_arg(va, struct X*)->y; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001123-2.c b/gcc/testsuite/gcc.c-torture/compile/20001123-2.c deleted file mode 100644 index dcb5dd1fa3e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001123-2.c +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright 2000 Free Software Foundation - - by Alexandre Oliva <aoliva@redhat.com> - - Based on zlib/gzio.c. - - This used to generate duplicate labels when compiled with - sh-elf-gcc -O2 -m3 -fPIC. - - Bug reported by NIIBE Yutaka <gniibe@m17n.org>. */ - -void foo (void); - -void -bar () -{ - unsigned len; - - for (len = 0; len < 2; len++) - foo (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001205-1.c b/gcc/testsuite/gcc.c-torture/compile/20001205-1.c deleted file mode 100644 index 69708e59ea0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001205-1.c +++ /dev/null @@ -1,21 +0,0 @@ -static inline unsigned long rdfpcr(void) -{ - unsigned long tmp, ret; - __asm__ ("" : "=r"(tmp), "=r"(ret)); - return ret; -} - -static inline unsigned long -swcr_update_status(unsigned long swcr, unsigned long fpcr) -{ - swcr &= ~0x7e0000ul; - swcr |= (fpcr >> 3) & 0x7e0000ul; - return swcr; -} - -unsigned long osf_getsysinfo(unsigned long flags) -{ - unsigned long w; - w = swcr_update_status(flags, rdfpcr()); - return w; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001205-1.x b/gcc/testsuite/gcc.c-torture/compile/20001205-1.x deleted file mode 100644 index 134cdf109fe..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001205-1.x +++ /dev/null @@ -1,7 +0,0 @@ -# This does not work on m68hc11 due to the asm statement which -# forces two 'long' (32-bits) variables to go in registers. - -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { - return 1 -} -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/20001212-1.c b/gcc/testsuite/gcc.c-torture/compile/20001212-1.c deleted file mode 100644 index 009138c5d3f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001212-1.c +++ /dev/null @@ -1,10 +0,0 @@ -typedef struct -{ - long double l; -} ld; - -ld a (ld x, ld y) -{ - ld b; - b.l = x.l + y.l; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001221-1.c b/gcc/testsuite/gcc.c-torture/compile/20001221-1.c deleted file mode 100644 index 66ae7141147..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001221-1.c +++ /dev/null @@ -1,70 +0,0 @@ -static void -foo () -{ - long maplength; - int type; - { - const long nibbles = 8; - char buf1[nibbles + 1]; - char buf2[nibbles + 1]; - char buf3[nibbles + 1]; - buf1[nibbles] = '\0'; - buf2[nibbles] = '\0'; - buf3[nibbles] = '\0'; - ((nibbles) <= 16 - ? (({ - void *__s = (buf1); - union - { - unsigned int __ui; - unsigned short int __usi; - unsigned char __uc; - } - *__u = __s; - unsigned char __c = (unsigned char)('0'); - switch ((unsigned int) (nibbles)) - { - case 16: - __u->__ui = __c * 0x01010101; - __u = __extension__ ((void *) __u + 4); - case 12: - __u->__ui = __c * 0x01010101; - __u = __extension__ ((void *) __u + 4); - case 0: - break; - } - __s; - })) - : 0); - ((nibbles) <= 16 - ? (({ - void *__s = (buf2); - union - { - unsigned int __ui; - unsigned short int __usi; - unsigned char __uc; - } - *__u = __s; - unsigned char __c = (unsigned char)('0'); - switch ((unsigned int) (nibbles)) - { - case 16: - __u->__ui = __c * 0x01010101; - __u = __extension__ ((void *) __u + 4); - case 12: - __u->__ui = __c * 0x01010101; - __u = __extension__ ((void *) __u + 4); - case 8: - __u->__ui = __c * 0x01010101; - __u = __extension__ ((void *) __u + 4); - case 4: - __u->__ui = __c * 0x01010101; - case 0: - break; - } - __s; - })) - : 0); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001222-1.c b/gcc/testsuite/gcc.c-torture/compile/20001222-1.c deleted file mode 100644 index de97eeef70e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001222-1.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Testcase for PR c/1501. */ -double __complex__ -f (void) -{ - return ~(1.0 + 2.0i); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c b/gcc/testsuite/gcc.c-torture/compile/20001226-1.c deleted file mode 100644 index 54dacf74167..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001226-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* This testcase exposed two branch shortening bugs on powerpc. */ - -#define C(a,b) \ - if (a > b) goto gt; \ - if (a < b) goto lt; - -#define C4(x,b) C((x)[0], b) C((x)[1],b) C((x)[2],b) C((x)[3],b) -#define C16(x,y) C4(x, (y)[0]) C4(x, (y)[1]) C4(x, (y)[2]) C4(x, (y)[3]) - -#define C64(x,y) C16(x,y) C16(x+4,y) C16(x+8,y) C16(x+12,y) -#define C256(x,y) C64(x,y) C64(x,y+4) C64(x,y+8) C64(x,y+12) - -#define C1024(x,y) C256(x,y) C256(x+16,y) C256(x+32,y) C256(x+48,y) -#define C4096(x,y) C1024(x,y) C1024(x,y+16) C1024(x,y+32) C1024(x,y+48) - -unsigned foo(int x[64], int y[64]) -{ - C4096(x,y); - - return 0x01234567; - gt: - return 0x12345678; - lt: - return 0xF0123456; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20001226-1.x b/gcc/testsuite/gcc.c-torture/compile/20001226-1.x deleted file mode 100644 index 6e46f46724e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20001226-1.x +++ /dev/null @@ -1,22 +0,0 @@ -# This does not assemble on m68hc11 because the function is larger -# than 64K. - -global target_triplet -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { - return 1 -} - -# It doesn't work on Xtensa with -O0 because the function is larger -# than the range of a jump instruction (+- 128K) and the assembler -# does not yet relax jumps to indirect jumps. - -set torture_eval_before_compile { - set compiler_conditional_xfail_data { - "jump beyond 128K not supported" \ - "xtensa-*-*" \ - { "-O0" } \ - { "" } - } -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/20010102-1.c b/gcc/testsuite/gcc.c-torture/compile/20010102-1.c deleted file mode 100644 index a409b566098..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010102-1.c +++ /dev/null @@ -1,101 +0,0 @@ -/* This testcase derives from gnu obstack.c/obstack.h and failed with - -O3 -funroll-all-loops, or -O1 -frename-registers -funroll-loops on - sparc-sun-solaris2.7. - - Copyright (C) 2001 Free Software Foundation. */ - -# define PTR_INT_TYPE __PTRDIFF_TYPE__ - -struct _obstack_chunk -{ - char *limit; - struct _obstack_chunk *prev; - char contents[4]; -}; - -struct obstack -{ - long chunk_size; - struct _obstack_chunk *chunk; - char *object_base; - char *next_free; - char *chunk_limit; - PTR_INT_TYPE temp; - int alignment_mask; - struct _obstack_chunk *(*chunkfun) (void *, long); - void (*freefun) (void *, struct _obstack_chunk *); - void *extra_arg; - unsigned use_extra_arg:1; - unsigned maybe_empty_object:1; - unsigned alloc_failed:1; -}; - -extern void _obstack_newchunk (struct obstack *, int); - -struct fooalign {char x; double d;}; -#define DEFAULT_ALIGNMENT \ - ((PTR_INT_TYPE) ((char *) &((struct fooalign *) 0)->d - (char *) 0)) -union fooround {long x; double d;}; -#define DEFAULT_ROUNDING (sizeof (union fooround)) - -#ifndef COPYING_UNIT -#define COPYING_UNIT int -#endif - -#define CALL_CHUNKFUN(h, size) \ - (((h) -> use_extra_arg) \ - ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ - : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) - -#define CALL_FREEFUN(h, old_chunk) \ - do { \ - if ((h) -> use_extra_arg) \ - (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ - else \ - (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ - } while (0) - -void -_obstack_newchunk (h, length) - struct obstack *h; - int length; -{ - register struct _obstack_chunk *old_chunk = h->chunk; - register struct _obstack_chunk *new_chunk; - register long new_size; - register long obj_size = h->next_free - h->object_base; - register long i; - long already; - - new_size = (obj_size + length) + (obj_size >> 3) + 100; - if (new_size < h->chunk_size) - new_size = h->chunk_size; - - new_chunk = CALL_CHUNKFUN (h, new_size); - h->chunk = new_chunk; - new_chunk->prev = old_chunk; - new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size; - - if (h->alignment_mask + 1 >= DEFAULT_ALIGNMENT) - { - for (i = obj_size / sizeof (COPYING_UNIT) - 1; - i >= 0; i--) - ((COPYING_UNIT *)new_chunk->contents)[i] - = ((COPYING_UNIT *)h->object_base)[i]; - already = obj_size / sizeof (COPYING_UNIT) * sizeof (COPYING_UNIT); - } - else - already = 0; - for (i = already; i < obj_size; i++) - new_chunk->contents[i] = h->object_base[i]; - - if (h->object_base == old_chunk->contents && ! h->maybe_empty_object) - { - new_chunk->prev = old_chunk->prev; - CALL_FREEFUN (h, old_chunk); - } - - h->object_base = new_chunk->contents; - h->next_free = h->object_base + obj_size; - h->maybe_empty_object = 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010107-1.c b/gcc/testsuite/gcc.c-torture/compile/20010107-1.c deleted file mode 100644 index 222def4d9ef..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010107-1.c +++ /dev/null @@ -1,6 +0,0 @@ -unsigned long x[4]; - -void foo(void) -{ - ((void (*)())(x+2))(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010112-1.c b/gcc/testsuite/gcc.c-torture/compile/20010112-1.c deleted file mode 100644 index 69bbe169e31..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010112-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Test that putting an initialized variable in a register works. */ - -#ifdef __i386__ -#define REGISTER asm ("eax") -#elif defined (__arm__) -#define REGISTER asm ("r0") -#else -/* Put examples for other architectures here. */ -#define REGISTER -#endif - -void f() { - register int i REGISTER = 3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010113-1.c b/gcc/testsuite/gcc.c-torture/compile/20010113-1.c deleted file mode 100644 index 35b7c1f1d7e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010113-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* Origin: PR c/364 from and@genesyslab.com, very much reduced to a - testcase by Joseph Myers <jsm28@cam.ac.uk>. - - The initializer of z is a valid address constant, and GCC 2.95.2 - accepts it as such. CVS GCC as of 2001-01-13 rejects it, but accepts - it if y is changed to x in the initializer. */ - -struct { - struct { - int x; - int y; - } p; -} v; - -int *z = &((&(v.p))->y); diff --git a/gcc/testsuite/gcc.c-torture/compile/20010114-1.c b/gcc/testsuite/gcc.c-torture/compile/20010114-1.c deleted file mode 100644 index 9b608aad132..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010114-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Origin: PR c/166 from Joerg Czeranski <jc@joerch.org>. */ -/* In the declaration of proc, x cannot be parsed as a typedef name, - so it must be parsed as a parameter name. */ -typedef int x; -void proc(int (*x)(void)) {} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010114-2.c b/gcc/testsuite/gcc.c-torture/compile/20010114-2.c deleted file mode 100644 index 75f5ea20e09..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010114-2.c +++ /dev/null @@ -1,6 +0,0 @@ -/* Origin: <URL:http://gcc.gnu.org/ml/gcc-patches/2000-12/msg01384.html> - from Fred Fish <fnf@geekgadgets.org>. See also PR c/1625. */ - -#include <stdbool.h> - -struct { int x; bool y; } foo = { 0, false }; diff --git a/gcc/testsuite/gcc.c-torture/compile/20010117-1.c b/gcc/testsuite/gcc.c-torture/compile/20010117-1.c deleted file mode 100644 index d0772b3c32d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010117-1.c +++ /dev/null @@ -1,7 +0,0 @@ -unsigned char u, v, w; - -void baz (void) -{ - if ((u - v - w) & 0x80) - v = 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010117-2.c b/gcc/testsuite/gcc.c-torture/compile/20010117-2.c deleted file mode 100644 index 813468b56b2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010117-2.c +++ /dev/null @@ -1,20 +0,0 @@ -unsigned char a, b; - -void baz (void) -{ - if (b & 0x08) - { - int g = 0; - int c = (b & 0x01); - int d = a - g - c; - int e = (a & 0x0f) - (g & 0x0f); - int f = (a & 0xf0) - (g & 0xf0); - int h = (a & 0x0f) - (g & 0x0f); - - if ((a ^ g) & (a ^ d) & 0x80) b |= 0x40; - if ((d & 0xff00) == 0) b |= 0x01; - if (!((a - h - c) & 0xff)) b |= 0x02; - if ((a - g - c) & 0x80) b |= 0x80; - a = (e & 0x0f) | (f & 0xf0); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010118-1.c b/gcc/testsuite/gcc.c-torture/compile/20010118-1.c deleted file mode 100644 index 6d1fc6431c6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010118-1.c +++ /dev/null @@ -1,21 +0,0 @@ -static unsigned int bar(void *h, unsigned int n) -{ - static int i; - return i++; -} - -static void baz(unsigned int *x) -{ - (*x)++; -} - -long -foo(void *h, unsigned int l) -{ - unsigned int n; - long m; - n = bar(h, 0); - n = bar(h, n); - m = ({ baz(&n); 21; }); - return m; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010124-1.c b/gcc/testsuite/gcc.c-torture/compile/20010124-1.c deleted file mode 100644 index dd2d9c11737..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010124-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* Origin: testcase from Joseph Myers <jsm28@cam.ac.uk>, problem pointed - out in a post to comp.std.c - <980283801.3063.0.nnrp-07.c2deb1c2@news.demon.co.uk> - by Dibyendu Majumdar <dibyendu@mazumdar.demon.co.uk>. - Compound literals should be parsed as postfix expressions, rather than - as cast expressions. In particular, they are valid operands of sizeof. */ - -struct s { int a; int b; }; -char x[((sizeof (struct s){ 1, 2 }) == sizeof (struct s)) ? 1 : -1]; diff --git a/gcc/testsuite/gcc.c-torture/compile/20010202-1.c b/gcc/testsuite/gcc.c-torture/compile/20010202-1.c deleted file mode 100644 index e72586a3371..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010202-1.c +++ /dev/null @@ -1,6 +0,0 @@ -int foo (int n, char m[1][n]); - -int foo (int n, char m[1][n]) -{ -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20010209-1.c b/gcc/testsuite/gcc.c-torture/compile/20010209-1.c deleted file mode 100644 index 20434644be6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010209-1.c +++ /dev/null @@ -1,7 +0,0 @@ -short int a; - -int main (void) -{ - a = 65535.0; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010226-1.c b/gcc/testsuite/gcc.c-torture/compile/20010226-1.c deleted file mode 100644 index c06be53dc52..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010226-1.c +++ /dev/null @@ -1,22 +0,0 @@ -void f1 (void *); -void f3 (void *, void (*)(void *)); -void f2 (void *); - -int foo (void *a, int b) -{ - if (!b) - { - f1 (a); - return 1; - } - if (b) - { - void bar (void *c) - { - if (c == a) - f2 (c); - } - f3 (a, bar); - } - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010227-1.c b/gcc/testsuite/gcc.c-torture/compile/20010227-1.c deleted file mode 100644 index 767cb0d1c2e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010227-1.c +++ /dev/null @@ -1,6 +0,0 @@ -void foo (void) -{ - double a = 0.0; - double b = a; - if (&b != &a); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010313-1.c b/gcc/testsuite/gcc.c-torture/compile/20010313-1.c deleted file mode 100644 index a5a6ee65217..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010313-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ -/* After the open parenthesis before the __attribute__, we used to shift - the __attribute__ (expecting a parenthesised abstract declarator) - instead of reducing to the start of a parameter list. */ -void bar (int (__attribute__((__mode__(__SI__))) int foo)); diff --git a/gcc/testsuite/gcc.c-torture/compile/20010320-1.c b/gcc/testsuite/gcc.c-torture/compile/20010320-1.c deleted file mode 100644 index 14686d62318..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010320-1.c +++ /dev/null @@ -1,28 +0,0 @@ -typedef struct sec { -const char *name; -int id; -int index; -struct sec *next; -unsigned int flags; -unsigned int user_set_vma : 1; -unsigned int reloc_done : 1; -unsigned int linker_mark : 1; -unsigned int gc_mark : 1; -unsigned int segment_mark : 1; -unsigned long long vma; } asection; - -static void pe_print_pdata (asection *section) -{ - unsigned long long i; - unsigned long long start = 0, stop = 0; - int onaline = (3*8) ; - - for (i = start; i < stop; i += onaline) - { - if (i + (3*8) > stop) - break; - - f (((unsigned long) ((( i + section->vma ) >> 32) & 0xffffffff)) , ((unsigned long) ((( i + section->vma ) & 0xffffffff))) ) ; - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20010326-1.c b/gcc/testsuite/gcc.c-torture/compile/20010326-1.c deleted file mode 100644 index 43acf4588ca..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010326-1.c +++ /dev/null @@ -1,16 +0,0 @@ -float d; -int e, f; - -void foo (void) -{ - struct { float u, v; } a = {0.0, 0.0}; - float b; - int c; - - c = e; - if (c == 0) - c = f; - b = d; - if (a.v < b) - a.v = b; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c b/gcc/testsuite/gcc.c-torture/compile/20010327-1.c deleted file mode 100644 index fc31a6e68c2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010327-1.c +++ /dev/null @@ -1,2 +0,0 @@ -extern void _text; -static unsigned long x = (unsigned long) &_text - 0x10000000L - 1; diff --git a/gcc/testsuite/gcc.c-torture/compile/20010328-1.c b/gcc/testsuite/gcc.c-torture/compile/20010328-1.c deleted file mode 100644 index d92c6dae113..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010328-1.c +++ /dev/null @@ -1,80 +0,0 @@ -typedef unsigned int size_t; -typedef unsigned int __u_int; -typedef unsigned long __u_long; - -__extension__ typedef unsigned long long int __u_quad_t; -__extension__ typedef long long int __quad_t; - -typedef struct - { - int __val[2]; - } __fsid_t; - -typedef long int __blksize_t; -typedef long int __blkcnt_t; -typedef __quad_t __blkcnt64_t; -typedef __u_long __fsblkcnt_t; -typedef __u_quad_t __fsblkcnt64_t; -typedef __u_long __fsfilcnt_t; -typedef __u_quad_t __fsfilcnt64_t; -typedef __u_quad_t __ino64_t; - -extern void *memcpy (void *__restrict __dest, - __const void *__restrict __src, size_t __n) ; - -struct statfs - { - int f_type; - int f_bsize; - - __fsblkcnt_t f_blocks; - __fsblkcnt_t f_bfree; - __fsblkcnt_t f_bavail; - __fsfilcnt_t f_files; - __fsfilcnt_t f_ffree; - - __fsid_t f_fsid; - int f_namelen; - int f_spare[6]; - }; - - -struct statfs64 - { - int f_type; - int f_bsize; - __fsblkcnt64_t f_blocks; - __fsblkcnt64_t f_bfree; - __fsblkcnt64_t f_bavail; - __fsfilcnt64_t f_files; - __fsfilcnt64_t f_ffree; - __fsid_t f_fsid; - int f_namelen; - int f_spare[6]; - }; - -extern int __statfs (__const char *__file, struct statfs *__buf); -extern int __statfs64 (__const char *__file, struct statfs64 *__buf); - - -int -__statfs64 (const char *file, struct statfs64 *buf) -{ - struct statfs buf32; - - if (__statfs (file, &buf32) < 0) - return -1; - - buf->f_type = buf32.f_type; - buf->f_bsize = buf32.f_bsize; - buf->f_blocks = buf32.f_blocks; - buf->f_bfree = buf32.f_bfree; - buf->f_bavail = buf32.f_bavail; - buf->f_files = buf32.f_files; - buf->f_ffree = buf32.f_ffree; - buf->f_fsid = buf32.f_fsid; - buf->f_namelen = buf32.f_namelen; - memcpy (buf->f_spare, buf32.f_spare, sizeof (buf32.f_spare)); - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010329-1.c b/gcc/testsuite/gcc.c-torture/compile/20010329-1.c deleted file mode 100644 index 4d495e1afc8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010329-1.c +++ /dev/null @@ -1,17 +0,0 @@ -union u { - unsigned char a; - double b; -}; - -int a; - -union u foo (void) -{ - union u b; - - if (a) - b.a = 1; - else - b.a = 0; - return b; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010404-1.c b/gcc/testsuite/gcc.c-torture/compile/20010404-1.c deleted file mode 100644 index f890118e15d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010404-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* This testcase caused a floating point exception in the compiler when - compiled with -O2. The crash occurs when trying to simplify division - and modulo operations. */ - -#include <limits.h> - -extern void bar (int); - -void foo () -{ - int a = INT_MIN; - int b = -1; - bar (a / b); - bar (a % b); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010408-1.c b/gcc/testsuite/gcc.c-torture/compile/20010408-1.c deleted file mode 100644 index 9aa3597a24a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010408-1.c +++ /dev/null @@ -1,77 +0,0 @@ -extern struct win *windows, *wtab[]; -struct win -{ - struct win *w_next; -}; - -struct auser; - -struct comm -{ - char *name; - int flags; -}; - -extern struct comm comms[]; - -extern int WindowByNoN (char *); -extern int FindCommnr (char *); -extern int AclSetPermCmd (struct auser *, char *, struct comm *); -extern int AclSetPermWin (struct auser *, struct auser *, char *, struct win *); - - -int - AclSetPerm(uu, u, mode, s) - struct auser *uu, *u; -char *mode, *s; -{ - struct win *w; - int i; - char *p, ch; - - do - { - } - while (0); - - while (*s) - { - switch (*s) - { - case '*': - return AclSetPerm(uu, u, mode, "#?"); - case '#': - if (uu) - AclSetPermWin(uu, u, mode, (struct win *)1); - else - for (w = windows; w; w = w->w_next) - AclSetPermWin((struct auser *)0, u, mode, w); - s++; - break; - case '?': - if (uu) - AclSetPermWin(uu, u, mode, (struct win *)0); - else - for (i = 0; i <= 174; i++) - AclSetPermCmd(u, mode, &comms[i]); - s++; - break; - default: - for (p = s; *p && *p != ' ' && *p != '\t' && *p != ','; p++) - ; - if ((ch = *p)) - *p++ = '\0'; - if ((i = FindCommnr(s)) != -1) - AclSetPermCmd(u, mode, &comms[i]); - else if (((i = WindowByNoN(s)) >= 0) && wtab[i]) - AclSetPermWin((struct auser *)0, u, mode, wtab[i]); - else - return -1; - if (ch) - p[-1] = ch; - s = p; - } - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010421-1.c b/gcc/testsuite/gcc.c-torture/compile/20010421-1.c deleted file mode 100644 index bec6aa90304..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010421-1.c +++ /dev/null @@ -1,8 +0,0 @@ -int j; - -void residual () -{ - long double s; - for (j = 3; j < 9; j++) - s -= 3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010423-1.c b/gcc/testsuite/gcc.c-torture/compile/20010423-1.c deleted file mode 100644 index ef7771f8e6b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010423-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* Origin: PR c/2618 from Cesar Eduardo Barros <cesarb@nitnet.com.br>, - adapted to a testcase by Joseph Myers <jsm28@cam.ac.uk>. - - Boolean conversions were causing infinite recursion between convert - and fold in certain cases. */ - -#include <stdbool.h> - -bool x; -unsigned char y; - -void -fn (void) -{ - x = y & 0x1 ? 1 : 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010426-1.c b/gcc/testsuite/gcc.c-torture/compile/20010426-1.c deleted file mode 100644 index 356818f9ec8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010426-1.c +++ /dev/null @@ -1,19 +0,0 @@ -struct { char *m; long n; } a[20]; -int b = 20, c; -void bar(void) __attribute__((__noreturn__)); - -int -foo(int x) -{ - int i; - - for (i = 0; i < x; i++) - { - a[0].m = "a"; a[0].n = 10; c=1; - a[c].m = "b"; a[c].n = 32; c++; - if (c >= b) bar (); - a[c].m = "c"; a[c].n = 80; c++; - if (c >= b) bar (); - } - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010503-1.c b/gcc/testsuite/gcc.c-torture/compile/20010503-1.c deleted file mode 100644 index 75005f456c3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010503-1.c +++ /dev/null @@ -1,17 +0,0 @@ -void f1 (double); -void f2 (int); - -void -foo (int type, double xx) -{ - if (type) - f1 (xx); - else - f2 (type); -} - -void -bar (int type) -{ - foo (type, 1.0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010510-1.c b/gcc/testsuite/gcc.c-torture/compile/20010510-1.c deleted file mode 100644 index 23d44f8642c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010510-1.c +++ /dev/null @@ -1,3 +0,0 @@ -typedef char *ident; -#ident "This is ident" -ident i; diff --git a/gcc/testsuite/gcc.c-torture/compile/20010516-1.c b/gcc/testsuite/gcc.c-torture/compile/20010516-1.c deleted file mode 100644 index 7732812cfb1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010516-1.c +++ /dev/null @@ -1,5 +0,0 @@ -foo() -{ - char d; - asm volatile ( "" :: "m"(&d)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010518-1.c b/gcc/testsuite/gcc.c-torture/compile/20010518-1.c deleted file mode 100644 index 4ab40d8e226..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010518-1.c +++ /dev/null @@ -1,205 +0,0 @@ -/* This was cut down from reload1.c in May 2001, was observed to cause - a bootstrap failure for powerpc-apple-darwin1.3. - - Copyright (C) 2001 Free Software Foundation. */ - -enum insn_code -{ - CODE_FOR_extendqidi2 = 3, - CODE_FOR_nothing = 870 -}; - -struct rtx_def; - -enum machine_mode -{ - VOIDmode, - MAX_MACHINE_MODE -}; - -typedef unsigned long long HARD_REG_ELT_TYPE; -typedef HARD_REG_ELT_TYPE HARD_REG_SET[((77 + (8 * 8) - 1) / (8 * 8))]; - -enum rtx_code -{ - UNKNOWN, - NIL, - REG, - LAST_AND_UNUSED_RTX_CODE -}; - -typedef struct -{ - unsigned min_align:8; - unsigned base_after_vec:1; - unsigned min_after_vec:1; - unsigned max_after_vec:1; - unsigned min_after_base:1; - unsigned max_after_base:1; - unsigned offset_unsigned:1; - unsigned:2; - unsigned scale:8; -} -addr_diff_vec_flags; -typedef union rtunion_def -{ - long long rtwint; - int rtint; - unsigned int rtuint; - const char *rtstr; - struct rtx_def *rtx; - struct rtvec_def *rtvec; - enum machine_mode rttype; - addr_diff_vec_flags rt_addr_diff_vec_flags; - struct cselib_val_struct *rt_cselib; - struct bitmap_head_def *rtbit; - union tree_node *rttree; - struct basic_block_def *bb; -} -rtunion; -typedef struct rtx_def -{ - enum rtx_code code:16; - enum machine_mode mode:8; - unsigned int jump:1; - unsigned int call:1; - unsigned int unchanging:1; - unsigned int volatil:1; - unsigned int in_struct:1; - unsigned int used:1; - unsigned integrated:1; - unsigned frame_related:1; - rtunion fld[1]; -} - *rtx; - -enum reload_type -{ - RELOAD_FOR_INPUT, RELOAD_FOR_OUTPUT, RELOAD_FOR_INSN, - RELOAD_FOR_INPUT_ADDRESS, RELOAD_FOR_INPADDR_ADDRESS, - RELOAD_FOR_OUTPUT_ADDRESS, RELOAD_FOR_OUTADDR_ADDRESS, - RELOAD_FOR_OPERAND_ADDRESS, RELOAD_FOR_OPADDR_ADDR, - RELOAD_OTHER, RELOAD_FOR_OTHER_ADDRESS -}; - -struct reload -{ - rtx in; - rtx out; - // enum reg_class class; - enum machine_mode inmode; - enum machine_mode outmode; - enum machine_mode mode; - unsigned int nregs; - int inc; - rtx in_reg; - rtx out_reg; - int regno; - rtx reg_rtx; - int opnum; - int secondary_in_reload; - int secondary_out_reload; - enum insn_code secondary_in_icode; - enum insn_code secondary_out_icode; - enum reload_type when_needed; - unsigned int optional:1; - unsigned int nocombine:1; - unsigned int secondary_p:1; - unsigned int nongroup:1; -}; - -struct insn_chain -{ - rtx insn; -}; - -extern int n_reloads; -static short reload_order[(2 * 10 * (2 + 1))]; -int reload_spill_index[(2 * 10 * (2 + 1))]; -extern struct reload rld[(2 * 10 * (2 + 1))]; -static rtx *reg_last_reload_reg; -static HARD_REG_SET reg_reloaded_valid; -static HARD_REG_SET reg_reloaded_dead; -static HARD_REG_SET reg_reloaded_died; -static HARD_REG_SET reg_is_output_reload; -extern const unsigned int mode_size[]; -extern int target_flags; - -static void -emit_reload_insns (chain) - struct insn_chain *chain; -{ - rtx insn = chain->insn; - register int j; - rtx following_insn = (((insn)->fld[2]).rtx); - rtx before_insn = (((insn)->fld[1]).rtx); - - for (j = 0; j < n_reloads; j++) - { - register int r = reload_order[j]; - register int i = reload_spill_index[r]; - - { - rtx out = (((enum rtx_code) (rld[r].out)->code) == REG ? rld[r].out : rld[r].out_reg); - register int nregno = (((out)->fld[0]).rtuint); - - if (nregno >= 77) - { - rtx src_reg, store_insn = (rtx) 0; - - reg_last_reload_reg[nregno] = 0; - if (src_reg && ((enum rtx_code) (src_reg)->code) == REG && (((src_reg)->fld[0]).rtuint) < 77) - { - int src_regno = (((src_reg)->fld[0]).rtuint); - int nr = - (((src_regno) >= 32 - && (src_regno) <= - 63) ? (((mode_size[(int) (rld[r].mode)]) + 8 - - 1) / 8) : (((mode_size[(int) (rld[r].mode)]) + - (!(target_flags & 0x00000020) ? 4 : - 8) - 1) / (!(target_flags & 0x00000020) ? 4 : 8))); - rtx note = 0; - - while (nr-- > 0) - { - ((reg_reloaded_dead) - [(src_regno + nr) / ((unsigned) (8 * 8))] &= - ~(((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8))))); - ((reg_reloaded_valid) - [(src_regno + nr) / ((unsigned) (8 * 8))] |= - ((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8)))); - ((reg_is_output_reload) - [(src_regno + nr) / ((unsigned) (8 * 8))] |= - ((HARD_REG_ELT_TYPE) (1)) << ((src_regno + nr) % ((unsigned) (8 * 8)))); - if (note) - ((reg_reloaded_died) - [(src_regno) / ((unsigned) (8 * 8))] |= - ((HARD_REG_ELT_TYPE) (1)) << ((src_regno) % ((unsigned) (8 * 8)))); - else - ((reg_reloaded_died) - [(src_regno) / ((unsigned) (8 * 8))] &= - ~(((HARD_REG_ELT_TYPE) (1)) << ((src_regno) % ((unsigned) (8 * 8))))); - } - reg_last_reload_reg[nregno] = src_reg; - } - } - else - { - int num_regs = - (((nregno) >= 32 - && (nregno) <= - 63) - ? (((mode_size - [(int) (((enum machine_mode) (rld[r].out)->mode))]) + - 8 - - 1) / - 8) - : (((mode_size - [(int) (((enum machine_mode) (rld[r].out)->mode))]) + - (!(target_flags & 0x00000020) ? 4 : 8) - 1) / (!(target_flags & 0x00000020) ? 4 : 8))); - while (num_regs-- > 0) - reg_last_reload_reg[nregno + num_regs] = 0; - } - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010518-2.c b/gcc/testsuite/gcc.c-torture/compile/20010518-2.c deleted file mode 100644 index aa8ce344c05..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010518-2.c +++ /dev/null @@ -1,13 +0,0 @@ -/* Large static storage. */ - -#include <limits.h> - -static volatile char chars_1[INT_MAX / 2]; -static volatile char chars_2[1]; - -int -foo (void) -{ - chars_1[10] = 'y'; - chars_2[0] = 'x'; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010518-2.x b/gcc/testsuite/gcc.c-torture/compile/20010518-2.x deleted file mode 100644 index 4cfce33b2dc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010518-2.x +++ /dev/null @@ -1,2 +0,0 @@ -set options "-S" -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/20010525-1.c b/gcc/testsuite/gcc.c-torture/compile/20010525-1.c deleted file mode 100644 index 2e4ae382ab9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010525-1.c +++ /dev/null @@ -1,6 +0,0 @@ -static int kind_varread(char *str) -{ - if (0 == memcmp("%_#", str, 3)) return 2; - /* NOTREACHED */ -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20010605-1.c b/gcc/testsuite/gcc.c-torture/compile/20010605-1.c deleted file mode 100644 index 036b796982e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010605-1.c +++ /dev/null @@ -1,15 +0,0 @@ -int -main (int argc, char **argv) -{ - int size = 10; - - typedef struct { - char val[size]; - } block; - block retframe_block() - { - return *(block*)0; - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010605-2.c b/gcc/testsuite/gcc.c-torture/compile/20010605-2.c deleted file mode 100644 index b8d9d5892da..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010605-2.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ -/* As an extension, GCC allows a struct or union to be cast to its own - type, but failed to allow this when a typedef was involved. - Reported as PR c/2735 by <cowan@ccil.org>. */ -union u { int i; }; -typedef union u uu; -union u a; -uu b; - -void -foo (void) -{ - a = (union u) b; - a = (uu) b; - b = (union u) a; - b = (uu) a; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010605-3.c b/gcc/testsuite/gcc.c-torture/compile/20010605-3.c deleted file mode 100644 index a43c0b1e462..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010605-3.c +++ /dev/null @@ -1,20 +0,0 @@ -struct A { unsigned long buf[100]; }; -int foo(unsigned int *x) -{ - unsigned int a; - - if (!x) - return -22; - -#ifdef __ia64__ - if (({ - register long b asm ("r8") = 0; - register long c asm ("r9") = 0; - asm ("" : "=r"(c), "=r"(b) : "m"(*(struct A *)x), "1"(b)); - a = (unsigned int) c; - b; })) - return -14; -#endif - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010610-1.c b/gcc/testsuite/gcc.c-torture/compile/20010610-1.c deleted file mode 100644 index ee8e2431bbb..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010610-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Origin: Kaveh R. Ghazi <ghazi@caip.rutgers.edu> - - Boolean types were not accepted as array sizes nor as switch - quantities. */ - -#include <stdbool.h> - -int -main(void) -{ - bool arr[(bool)1]; - - switch (arr[0]) - { - default:; - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010611-1.c b/gcc/testsuite/gcc.c-torture/compile/20010611-1.c deleted file mode 100644 index 87723bd497a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010611-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* Origin: PR c/3116 from Andreas Jaeger <aj@suse.de>. */ -/* When determining type compatibility of function types, we must remove - qualifiers from argument types. We used to fail to do this properly - in store_parm_decls when comparing prototype and non-prototype - declarations. */ -struct _IO_FILE { - int _flags; -}; - -typedef struct _IO_FILE __FILE; -typedef struct _IO_FILE _IO_FILE; -typedef long int wchar_t; - -extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n, - __FILE *__restrict __stream); - -wchar_t * -fgetws (buf, n, fp) - wchar_t *buf; - int n; - _IO_FILE *fp; -{ - return (wchar_t *)0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010701-1.c b/gcc/testsuite/gcc.c-torture/compile/20010701-1.c deleted file mode 100644 index 7fb7ab5b150..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010701-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Test that postfix attributes only apply to a single declared object. - (decl_attributes used to chain them onto the end of the prefix attributes, - which caused them to apply to other declarations as well.) */ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ -void __attribute__((__noreturn__)) foo (const char *, ...) __attribute__((__format__(__printf__, 1, 2))), bar (void); diff --git a/gcc/testsuite/gcc.c-torture/compile/20010706-1.c b/gcc/testsuite/gcc.c-torture/compile/20010706-1.c deleted file mode 100644 index 44aec371a99..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010706-1.c +++ /dev/null @@ -1,5 +0,0 @@ - -foo(unsigned int x) -{ - return (x << 1) | (x >> 31); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010711-1.c b/gcc/testsuite/gcc.c-torture/compile/20010711-1.c deleted file mode 100644 index a0787421f94..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010711-1.c +++ /dev/null @@ -1,11 +0,0 @@ -typedef unsigned long long value; - -void foo (value *v) {} - -void test () -{ - value v; - foo (&v); - if (v-- > 0) - foo (&v); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010711-2.c b/gcc/testsuite/gcc.c-torture/compile/20010711-2.c deleted file mode 100644 index 2f8d68ba4ae..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010711-2.c +++ /dev/null @@ -1,11 +0,0 @@ -typedef unsigned long long value; - -void foo (value *v) {} - -void test () -{ - value v; - foo (&v); - if (v-- == 1) - foo (&v); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010714-1.c b/gcc/testsuite/gcc.c-torture/compile/20010714-1.c deleted file mode 100644 index fc4bdbac7d5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010714-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Test that prefix attributes after a comma only apply to a single - declared object or function. */ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ - -__attribute__((noreturn)) void d0 (void), __attribute__((format(printf, 1, 2))) d1 (const char *, ...), d2 (void); diff --git a/gcc/testsuite/gcc.c-torture/compile/20010824-1.c b/gcc/testsuite/gcc.c-torture/compile/20010824-1.c deleted file mode 100644 index 8e67722b960..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010824-1.c +++ /dev/null @@ -1,7 +0,0 @@ -void f(int n) -{ -bugcauser: - if (n != 0) - f(n-1); - return; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010903-1.c b/gcc/testsuite/gcc.c-torture/compile/20010903-1.c deleted file mode 100644 index 8e519f26e41..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010903-1.c +++ /dev/null @@ -1,28 +0,0 @@ -struct A { - long a; -}; - -static inline void foo(struct A *x) -{ - __asm__ __volatile__("" : "+m"(x->a) : "r"(x) : "memory", "cc"); -} - -static inline void bar(struct A *x) -{ - foo(x); -} - -struct B { char buf[640]; struct A a; }; -struct B b[32]; - -int baz(void) -{ - int i; - struct B *j; - for (i = 1; i < 32; i++) - { - j = &b[i]; - bar(&j->a); - } - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010903-2.c b/gcc/testsuite/gcc.c-torture/compile/20010903-2.c deleted file mode 100644 index a5d78c0111d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010903-2.c +++ /dev/null @@ -1,15 +0,0 @@ -extern int __dummy (void *__preg, const char *__string); -extern int rpmatch (const char *response); - -int -rpmatch (const char *response) -{ - auto inline int try (void *re); - - inline int try (void *re) - { - return __dummy (re, response); - } - static void *yesre; - return (try (&yesre)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20010911-1.c b/gcc/testsuite/gcc.c-torture/compile/20010911-1.c deleted file mode 100644 index f5a4724bc72..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20010911-1.c +++ /dev/null @@ -1,4 +0,0 @@ -/* Test for segfault handling an empty attribute. */ -/* Origin: PR c/4294 from <tori@ringstrom.mine.nu>. */ - -void __attribute__(()) foo(); diff --git a/gcc/testsuite/gcc.c-torture/compile/20011010-1.c b/gcc/testsuite/gcc.c-torture/compile/20011010-1.c deleted file mode 100644 index b0137554379..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011010-1.c +++ /dev/null @@ -1,10 +0,0 @@ -extern int used (void); - - -int foo () -{ - int i; - for (; used (); ({while (1) if (used ()) return 0;})) - i++; - return i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011023-1.c b/gcc/testsuite/gcc.c-torture/compile/20011023-1.c deleted file mode 100644 index eca1adf17ca..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011023-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Test whether tree inlining works with prototyped nested functions. */ - -extern void foo (char *x); -void bar (void); -void bar (void) -{ - auto void baz (void); - void baz (void) - { - char tmp[2]; - foo (tmp); - } - baz (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011029-1.c b/gcc/testsuite/gcc.c-torture/compile/20011029-1.c deleted file mode 100644 index 3b2bcdf2e9d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011029-1.c +++ /dev/null @@ -1,9 +0,0 @@ -void foo (void *) __attribute__ ((noreturn)); - -void -bar (void *x) -{ - if (__builtin_setjmp (x)) - return; - foo (x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011106-1.c b/gcc/testsuite/gcc.c-torture/compile/20011106-1.c deleted file mode 100644 index 9363780a65a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011106-1.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Test that functions passed to the comma operator are correctly converted - to pointers. */ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ - -void foo (void); -void (*fp) (void); -char x[sizeof (1, foo) == sizeof (fp) ? 1 : -1]; diff --git a/gcc/testsuite/gcc.c-torture/compile/20011106-2.c b/gcc/testsuite/gcc.c-torture/compile/20011106-2.c deleted file mode 100644 index 358f9d2ed49..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011106-2.c +++ /dev/null @@ -1,7 +0,0 @@ -/* Test the the type of a component of a conditional expression between - two structures is correct. */ -/* Origin: Joseph Myers <jsm28@cam.ac.uk>. */ - -struct s { char c; } a, b; -int c; -char x[sizeof ((c ? a : b).c) == 1 ? 1 : -1]; diff --git a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c b/gcc/testsuite/gcc.c-torture/compile/20011109-1.c deleted file mode 100644 index f1987a74bf2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011109-1.c +++ /dev/null @@ -1,51 +0,0 @@ -typedef struct { short x[4]; } S; -typedef struct { unsigned int a, b, c; S *d; } T; - -S *(*foo) (T *, int, int, int, int); -unsigned short *(*bar)(const T *); -unsigned short baz(T *,const int); - -T *die (void) -{ - typedef struct { unsigned int a, b, e; double f, g; } U; - - char h[8], i[2053], j[2053]; - double k, l, m; - U n; - T *o; - unsigned short p; - int q, r; - long s; - unsigned short *t; - S *u; - unsigned char *v, *w; - unsigned int x; - - o = 0; - for (x = 0; x < n.e; x++) - { - l = 1.0; - if (n.g - n.f <= 1.0) - l = ((1 << o->c) - 1) / (n.g - n.f); - v = w; - for (r = o->b - 1; r >= 0; r--) - { - u = foo (o, 0, r, o->a, 1); - if (!u) - break; - t = bar (o); - for (q = 0; q < (int) o->a; q++) - { - h[0] = *v; - s = *v++; - k = (double) s; - m = l*k; - p = m < 0 ? 0 : m > (1 << o->c) - 1 ? (1 << o->c) - 1 : m + 0.5; - p = baz (o,p); - t[q] = p; - *u++ = o->d[p]; - } - } - } - return o; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011114-1.c b/gcc/testsuite/gcc.c-torture/compile/20011114-1.c deleted file mode 100644 index 5e6e821845d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011114-1.c +++ /dev/null @@ -1,2 +0,0 @@ -extern void _text; -static __SIZE_TYPE__ x = (__SIZE_TYPE__) &_text - 0x10000000L - 1; diff --git a/gcc/testsuite/gcc.c-torture/compile/20011114-2.c b/gcc/testsuite/gcc.c-torture/compile/20011114-2.c deleted file mode 100644 index 46f0aedeb3a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011114-2.c +++ /dev/null @@ -1,13 +0,0 @@ -typedef struct { int c, d, e, f, g; } D; - -void bar (unsigned long, unsigned long); -void foo (D *y) -{ - int x = 0; - - if (y->f == 0) - x |= 0x1; - if (y->g == 0) - x |= 0x2; - bar ((x << 16) | (y->c & 0xffff), (y->d << 16) | (y->e & 0xffff)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011114-3.c b/gcc/testsuite/gcc.c-torture/compile/20011114-3.c deleted file mode 100644 index 882792525c9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011114-3.c +++ /dev/null @@ -1,42 +0,0 @@ -typedef struct { int s, t; } C; -C x; -int foo (void); -void bar (int); - -int baz (void) -{ - int a = 0, c, d = 0; - C *b = &x; - - while ((c = foo ())) - switch(c) - { - case 23: - bar (1); - break; - default: - break; - } - - if (a == 0 || (a & 1)) - { - if (b->s) - { - if (a) - bar (1); - else - a = 16; - } - else if (b->t) - { - if (a) - bar (1); - else - a = 32; - } - } - - if (d && (a & ~127)) - bar (2); - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011114-4.c b/gcc/testsuite/gcc.c-torture/compile/20011114-4.c deleted file mode 100644 index 516ef4f2325..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011114-4.c +++ /dev/null @@ -1,38 +0,0 @@ -static inline int foo (long x) -{ - register int a = 0; - register unsigned b; - - do - { - b = (x & 0x7f); - x = (x >> 7) | ~(-1L >> 7); - a += 1; - } - while ((x != 0 || (b & 0x40) != 0) && (x != -1 || (b & 0x40) == 0)); - return a; -} - -static inline int bar (unsigned long x) -{ - register int a = 0; - register unsigned b; - - do - { - b = (x & 0x7f); - x >>= 7; - a++; - } - while (x != 0); - return a; -} - -int -baz (unsigned long x, int y) -{ - if (y) - return foo ((long) x); - else - return bar (x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011119-1.c b/gcc/testsuite/gcc.c-torture/compile/20011119-1.c deleted file mode 100644 index 2204c11c90b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011119-1.c +++ /dev/null @@ -1,4 +0,0 @@ -extern inline int foo (void) { return 23; } -int xxx(void) __asm__("xxx"); -int xxx(void) { return 23; } -extern int foo (void) __attribute__ ((weak, alias ("xxx"))); diff --git a/gcc/testsuite/gcc.c-torture/compile/20011119-2.c b/gcc/testsuite/gcc.c-torture/compile/20011119-2.c deleted file mode 100644 index ab649b98bc7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011119-2.c +++ /dev/null @@ -1,6 +0,0 @@ -extern inline int foo (void) { return 23; } -int bar (void) { return foo (); } -extern int foo (void) __attribute__ ((weak, alias ("xxx"))); -int baz (void) { return foo (); } -int xxx(void) __asm__("xxx"); -int xxx(void) { return 23; } diff --git a/gcc/testsuite/gcc.c-torture/compile/20011130-1.c b/gcc/testsuite/gcc.c-torture/compile/20011130-1.c deleted file mode 100644 index 82ff042cee6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011130-1.c +++ /dev/null @@ -1,7 +0,0 @@ -extern struct S x[]; -struct S { int i; }; -char *bar (const struct S *); -void foo (void) -{ - bar (x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011130-2.c b/gcc/testsuite/gcc.c-torture/compile/20011130-2.c deleted file mode 100644 index 6439527e89c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011130-2.c +++ /dev/null @@ -1,54 +0,0 @@ -/* This testcase caused infinite loop in life info computation - after if conversion on IA-64. Conditional register dead for - pseudo holding sign-extended k was improperly computed, - resulting in this pseudo beeing live at start of bb if it was - dead at the end and vice versa; as it was a bb which had edge - to itself, this resulted in alternative propagating this basic - block forever. */ - -typedef struct { - unsigned char a; - unsigned char b; -} S0; - -typedef struct { - S0 *c; - int d; - unsigned int e; - unsigned char *f[3]; - void *g; -} S1; - -int bar (int, void *); - -int foo (S1 *x, float y) -{ - S0 *h; - int i, j, k, l, m; - float n, o, p; - unsigned char *q, *r[3]; - - h = x->c; - m = h->a; - l = h->b; - n = y; - o = 0.0; - if (x->d == 8) - for (j = 0; j < x->e; j++) - for (k = 0; k < 3; k++) - { - n = y; - o = 0.0; - if (m) - q = x->f[k] + x->e - 1 - j; - else - q = x->f[k] + j; - p = (*q - o) * y / (n - o); - p = 0.0 > p ? 0.0 : p; - p = y < p ? y : p; - if (l) - p = r[k][(int) p]; - bar (p, x->g); - } - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011205-1.c b/gcc/testsuite/gcc.c-torture/compile/20011205-1.c deleted file mode 100644 index ffc5ac419ea..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011205-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* Failure to mark_addressable all operands before evaluation means we - don't set up the proper temporaries, which leaves us with an asm that - doesn't match its contraints. */ - -long foo() -{ - long x; - asm("" : "=r"(x) : "m"(x)); - return x; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011217-1.c b/gcc/testsuite/gcc.c-torture/compile/20011217-1.c deleted file mode 100644 index 3e89ca04c19..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011217-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* Test that the initializer of a compound literal is properly walked - when tree inlining. */ -/* Origin: PR c/5105 from <aj@suse.de>. */ - -typedef struct { long p; } pt; - -inline pt f (pt _p) -{ - long p = _p.p; - - return (pt) { (p) }; -} - -static int mmap_mem (void) -{ - pt p; - p = f (p); - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011217-2.c b/gcc/testsuite/gcc.c-torture/compile/20011217-2.c deleted file mode 100644 index 0d9935969c3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011217-2.c +++ /dev/null @@ -1,19 +0,0 @@ -/* Test that the initializer of a compound literal is properly walked - when tree inlining. */ -/* Origin: glibc (as reported in PR c/5105) from <aj@suse.de>. */ - -inline int -finite (double __x) -{ - return (__extension__ - (((((union { double __d; int __i[2]; }) {__d: __x}).__i[1] - | 0x800fffffu) + 1) >> 31)); -} - -int -main (void) -{ - double x = 1.0; - - return finite (x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011218-1.c b/gcc/testsuite/gcc.c-torture/compile/20011218-1.c deleted file mode 100644 index bf63489b855..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011218-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* This testcase failed on Alpha at -O2 because $27 hard register - for the indirect call was exposed too early and reload couldn't - allocate it for multiplication and division. */ - -struct S { - int a, b; - void (*f) (long, int); -}; - -void foo (struct S *x) -{ - long c = x->a * 50; - c /= (long) x->b; - c *= (long) x->b; - x->f (c, 0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011219-1.c b/gcc/testsuite/gcc.c-torture/compile/20011219-1.c deleted file mode 100644 index 04923092dff..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011219-1.c +++ /dev/null @@ -1,29 +0,0 @@ -/* This testcase failed on IA-64 at -O2 during scheduling. */ - -void * baz (unsigned long); -static inline double ** -bar (long w, long x, long y, long z) -{ - long i, a = x - w + 1, b = z - y + 1; - double **m = (double **) baz (sizeof (double *) * (a + 1)); - - m += 1; - m -= w; - m[w] = (double *) baz (sizeof (double) * (a * b + 1)); - m[w] += 1; - m[w] -= y; - for (i = w + 1; i <= x; i++) - m[i] = m[i - 1] + b; - return m; -} - -void -foo (double w[], int x, double y[], double z[]) -{ - int i; - double **a; - - a = bar (1, 50, 1, 50); - for (i = 1; i <= x; i++) - a[1][i] = - w[x - i] / w[x]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011219-2.c b/gcc/testsuite/gcc.c-torture/compile/20011219-2.c deleted file mode 100644 index 2ad7eb1a372..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011219-2.c +++ /dev/null @@ -1,20 +0,0 @@ -/* This testcase failed on Alpha at -O2 when simplifying conditional - expressions. */ - -struct S { - unsigned long a; - double b, c; -}; - -extern double bar (double, double); - -int -foo (unsigned long x, unsigned int y, struct S *z) -{ - unsigned int a = z->a; - int b = y / z->a > 1 ? y / z->a : 1; - - a = y / b < z->a ? y / b : z->a; - z->c = z->b * bar ((double) a, (double) x); - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011229-1.c b/gcc/testsuite/gcc.c-torture/compile/20011229-1.c deleted file mode 100644 index 97b2655434a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011229-1.c +++ /dev/null @@ -1,78 +0,0 @@ -/* ICE: call insn does not satisfy its constraints, MMIX port. - Origin: ghostscript-6.52, reduction from hp@bitrange.com. */ -struct s0 -{ - void (*init_color)(void *, void *); -}; -struct s1 -{ - void (*map_cmyk)(short, void *, void **, void *); - void (*map_rgb_alpha)(short, void *, void **, void *); -}; -struct s5 -{ - long fill1; int fill2; - long fill3; unsigned int fill4, fill5; -}; -struct s2 -{ - struct s5 x, y; -}; -struct s3 -{ - long dev_color; - unsigned int key; -}; -struct s4 -{ - unsigned char spp; - int alpha; - struct mc_ - { - unsigned int values[14]; - unsigned int mask, test; - int exact; - } mask_color; - void **pis; - struct s0 *pcs; - struct dd_ - { - struct s2 row[2]; - struct s2 pixel0; - } dda; - struct s3 clues[256]; -}; -extern struct s1 *get_cmap_procs (void **, void *); -int image_render_color (struct s4 *, unsigned char *, int, void *); -int -image_render_color (struct s4 *penum, unsigned char *buffer, - int data_x, void *dev) -{ - struct s3 *clues = penum->clues; - void **pis = penum->pis; - struct s2 pnext; - struct s0 *pcs = penum->pcs; - struct s1 *cmap_procs = get_cmap_procs(pis, dev); - void (*map_4)(short, void *, void **, void *) = - (penum->alpha ? cmap_procs->map_rgb_alpha : cmap_procs->map_cmyk); - unsigned int mask = penum->mask_color.mask; - unsigned int test = penum->mask_color.test; - struct s3 *pic_next = &clues[1]; - int spp = penum->spp; - unsigned char *psrc = buffer + data_x * spp; - unsigned char v[6]; - - pnext = penum->dda.pixel0; - __builtin_memset (&v, 0, sizeof(v)); - (*(pcs)->init_color) (0, 0); - - if (spp == 4) - { - v[0] = psrc[0]; - v[1] = psrc[1]; - if ((buffer[0] & mask) == test && penum->mask_color.exact) - pic_next->dev_color = 0; - (*map_4)(v[0], &pic_next->dev_color, pis, dev); - } - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20011229-2.c b/gcc/testsuite/gcc.c-torture/compile/20011229-2.c deleted file mode 100644 index bb49bd18e34..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20011229-2.c +++ /dev/null @@ -1,17 +0,0 @@ -/* Test whether jump threading doesn't ICE if redirecting the jump to exit - block. */ - -extern int bar (); -extern void baz (); - -void foo () -{ - int x; - - do - { - if ((x = bar ()) == 1) - baz (); - } - while (x == 1); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020103-1.c b/gcc/testsuite/gcc.c-torture/compile/20020103-1.c deleted file mode 100644 index b9861688ddd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020103-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* This testcase failed on Alpha at -O2 when simplifying conditional - expressions. */ - -int foo (void); - -struct A -{ - int a, b, c, d; -}; - -void bar (struct A *x) -{ - int e, f; - - e = foo (); - e = e / x->b; - if (e < 1) - e = 1; - f = (x->a + x->c) / e; - if (f < x->d) - x->d -= (1 << 16) / 8; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020106-1.c b/gcc/testsuite/gcc.c-torture/compile/20020106-1.c deleted file mode 100644 index c114af1aa8c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020106-1.c +++ /dev/null @@ -1,8 +0,0 @@ -/* Origin: PR c/5279 from <wilco@equator.com>. */ - -int -foo () -{ - extern long long Y; - return (0 > Y++); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020109-1.c b/gcc/testsuite/gcc.c-torture/compile/20020109-1.c deleted file mode 100644 index 532fe6de2d5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020109-1.c +++ /dev/null @@ -1,23 +0,0 @@ -/* This testcase ICEd when 2 different successors of a basic block - were successfully threaded and try_forward_edges was not expecting - that. */ - -typedef struct A -{ - struct A *s, *t; - unsigned int u; -} A; - -void bar (A *); - -void -foo (A *x, A *y, A *z) -{ - while (y - && (((y && y->t && y->t->u) ? y : z)->t - == ((x && x->t && x->t->u) ? x : z)->t)) - y = y->s; - - if (y) - bar (y); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020109-2.c b/gcc/testsuite/gcc.c-torture/compile/20020109-2.c deleted file mode 100644 index 31673156569..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020109-2.c +++ /dev/null @@ -1,30 +0,0 @@ -typedef union -{ - unsigned char member3; - signed short member4; - unsigned int member5; -} -UNI02; - -struct srt_dat_t -{ - UNI02 un2; - unsigned long member1; - signed short member2; -}; - -struct srt_dat_t exsrt1; -void -extern_test (struct srt_dat_t arg1) -{ - arg1.un2.member3++; - arg1.member1++; - arg1.member2++; -} - -int -main (void) -{ - extern_test (exsrt1); - return (0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020110.c b/gcc/testsuite/gcc.c-torture/compile/20020110.c deleted file mode 100644 index 90e0ce95d29..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020110.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Copyright 2002 Free Software Foundation */ - -/* Make sure the nested extern declaration doesn't conflict with the - non-extern one in the enclosing scope. */ - -void foo() { - static long bar; - - { - extern int bar; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020116-1.c b/gcc/testsuite/gcc.c-torture/compile/20020116-1.c deleted file mode 100644 index 6c023edcabe..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020116-1.c +++ /dev/null @@ -1,28 +0,0 @@ -void noret (void) __attribute__ ((noreturn)); -int foo (int, char **); -char *a, *b; -int d; - -int -main (int argc, char **argv) -{ - register int c; - - d = 1; - while ((c = foo (argc, argv)) != -1) - switch (c) { - case 's': - case 'c': - case 'f': - a = b; - break; - case 'v': - d = 1; - break; - case 'V': - d = 0; - break; - } - noret (); - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020120-1.c b/gcc/testsuite/gcc.c-torture/compile/20020120-1.c deleted file mode 100644 index e049a9720ee..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020120-1.c +++ /dev/null @@ -1,55 +0,0 @@ -/* This ICEed on IA-32 with -O2 -mcpu=i386, because reload was trying - to reload into %sil register. */ - -struct A -{ - void *a; - unsigned int b, c, d; -}; - -struct B -{ - struct A *e; -}; - -void bar (struct A *); -void baz (struct A *); - -static inline unsigned int -inl (unsigned int v, unsigned char w, unsigned char x, unsigned char y, - unsigned char z) -{ - switch (v) - { - case 2: - return ((w & 0xf8) << 8) | ((x & 0xfc) << 3) | ((y & 0xf8) >> 3); - case 4: - return (z << 24) | (w << 16) | (x << 8) | y; - default: - return 0; - } -} - -void foo (struct B *x, int y, const float *z) -{ - struct A *a = x->e; - - if (y) - { - if (x->e->a) - bar (x->e); - } - else - { - unsigned char c[4]; - unsigned int b; - - c[0] = z[0]; c[1] = z[1]; c[2] = z[2]; c[3] = z[3]; - b = inl (a->b, c[0], c[1], c[2], c[3] ); - if (a->a) - bar (a); - else - baz (a); - a->c = b; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020121-1.c b/gcc/testsuite/gcc.c-torture/compile/20020121-1.c deleted file mode 100644 index f8950f4ce8b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020121-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* This testcase resulted in a 'unrecognizeable insn' on powerpc-linux-gnu - because of a missing trunc_int_for_mode in simplify_and_const_int. */ - -struct display { - struct disphist *hstent; - int pid; - int status; -}; - -struct disphist { - struct disphist *next; - char *name; - int startTries; - unsigned rLogin:2, - sd_how:2, - sd_when:2, - lock:1, - goodExit:1; - char *nuser, *npass, **nargs; -}; - -void -StartDisplay (struct display *d) -{ - d->pid = 0; - d->status = 0; - d->hstent->lock = d->hstent->rLogin = d->hstent->goodExit = - d->hstent->sd_how = d->hstent->sd_when = 0; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20020206-1.c b/gcc/testsuite/gcc.c-torture/compile/20020206-1.c deleted file mode 100644 index c21c5645409..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020206-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* Origin: PR optimization/5429 from Philipp Thomas <pthomas@suse.de>. */ -/* This testcase caused ICE on IA-32 -O2 -march=i686 due to rtl sharing - problem in noce_process_if_block. Fixed by - http://gcc.gnu.org/ml/gcc-patches/2002-01/msg02146.html. */ - -typedef struct { - unsigned char a; -} A; - -unsigned int foo (A *x) -{ - unsigned char b[2] = { 0, 0 }; - unsigned char c = 0; - - c = (x->a) ? b[1] : b[0]; - - return (unsigned int) c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020210-1.c b/gcc/testsuite/gcc.c-torture/compile/20020210-1.c deleted file mode 100644 index 5ca27f4f6ca..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020210-1.c +++ /dev/null @@ -1,2 +0,0 @@ -/* PR c/5615 */ -void f(int a, struct {int b[a];} c) {} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020303-1.c b/gcc/testsuite/gcc.c-torture/compile/20020303-1.c deleted file mode 100644 index a120adf7148..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020303-1.c +++ /dev/null @@ -1,5 +0,0 @@ -/* With -fzero-initialized-in-bss, we made I a common symbol instead - of a symbol in the .bss section. Not only does that break semantics, - but a common symbol can't be weak. */ - -int i __attribute__((weak)) = 0; diff --git a/gcc/testsuite/gcc.c-torture/compile/20020304-1.c b/gcc/testsuite/gcc.c-torture/compile/20020304-1.c deleted file mode 100644 index 3940d5ffd2e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020304-1.c +++ /dev/null @@ -1,777 +0,0 @@ -/* In 3.0, this test case (extracted from Bigloo) crashes the compiler in - bb-reorder.c. This is a regression from 2.95, already fixed in 3.1. - - Original bug report is c/5830 by Manuel Serrano <Manuel.Serrano@inria.fr>. - */ - -typedef union scmobj { - struct pair { - union scmobj *car; - union scmobj *cdr; - } pair_t; - struct vector { - long header; - int length; - union scmobj *obj0; - } vector_t; -} *obj_t; - -extern obj_t create_vector (int); -extern obj_t make_pair (obj_t, obj_t); -extern long bgl_list_length (obj_t); -extern int BGl_equalzf3zf3zz__r4_equivalence_6_2z00 (obj_t, obj_t); -extern obj_t BGl_evcompilezd2lambdazd2zz__evcompilez00 (obj_t - BgL_formalsz00_39, - obj_t BgL_bodyz00_40, - obj_t BgL_wherez00_41, - obj_t - BgL_namedzf3zf3_42, - obj_t BgL_locz00_43); - -obj_t -BGl_evcompilezd2lambdazd2zz__evcompilez00 (obj_t BgL_formalsz00_39, - obj_t BgL_bodyz00_40, - obj_t BgL_wherez00_41, - obj_t BgL_namedzf3zf3_42, - obj_t BgL_locz00_43) -{ - if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 - (BgL_formalsz00_39, - ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { - BgL_tagzd21966zd2_943: - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1042z00_998; - { - int BgL_auxz00_4066; - BgL_auxz00_4066 = (int) (((long) 3)); - BgL_v1042z00_998 = create_vector (BgL_auxz00_4066); - } - { - obj_t BgL_arg1586z00_1000; - BgL_arg1586z00_1000 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); - { - int BgL_auxz00_4070; - BgL_auxz00_4070 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4070] = - BgL_arg1586z00_1000, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4073; - BgL_auxz00_4073 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4073] = - BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4078; - int BgL_auxz00_4076; - { - long BgL_auxz00_4079; - { - long BgL_auxz00_4080; - BgL_auxz00_4080 = bgl_list_length (BgL_formalsz00_39); - BgL_auxz00_4079 = (BgL_auxz00_4080 + ((long) 37)); - } - BgL_auxz00_4078 = - (obj_t) ((long) (((long) (BgL_auxz00_4079) << 2) | 1)); - } - BgL_auxz00_4076 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1042z00_998))->vector_t.obj0))[BgL_auxz00_4076] = - BgL_auxz00_4078, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1042z00_998; - } else { - obj_t BgL_v1043z00_1005; - { - int BgL_auxz00_4085; - BgL_auxz00_4085 = (int) (((long) 3)); - BgL_v1043z00_1005 = create_vector (BgL_auxz00_4085); - } - { - int BgL_auxz00_4088; - BgL_auxz00_4088 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4088] = - BgL_bodyz00_40, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4091; - BgL_auxz00_4091 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4091] = - BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4096; - int BgL_auxz00_4094; - { - long BgL_auxz00_4097; - { - long BgL_auxz00_4098; - BgL_auxz00_4098 = bgl_list_length (BgL_formalsz00_39); - BgL_auxz00_4097 = (BgL_auxz00_4098 + ((long) 42)); - } - BgL_auxz00_4096 = - (obj_t) ((long) (((long) (BgL_auxz00_4097) << 2) | 1)); - } - BgL_auxz00_4094 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1043z00_1005))->vector_t.obj0))[BgL_auxz00_4094] = - BgL_auxz00_4096, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1043z00_1005; - } - } else { - if (((((long) BgL_formalsz00_39) & ((1 << 2) - 1)) == 3)) { - if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 - (((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).cdr), - ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { - goto BgL_tagzd21966zd2_943; - } else { - obj_t BgL_cdrzd21979zd2_953; - BgL_cdrzd21979zd2_953 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).cdr); - if (((((long) BgL_cdrzd21979zd2_953) & ((1 << 2) - 1)) == 3)) { - if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 - (((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t).cdr), - ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { - goto BgL_tagzd21966zd2_943; - } else { - obj_t BgL_cdrzd21986zd2_956; - BgL_cdrzd21986zd2_956 = - ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t).cdr); - if (((((long) BgL_cdrzd21986zd2_956) & ((1 << 2) - 1)) == 3)) { - if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 - (((((obj_t) ((long) BgL_cdrzd21986zd2_956 - 3))->pair_t). - cdr), - ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { - goto BgL_tagzd21966zd2_943; - } else { - obj_t BgL_cdrzd21994zd2_959; - { - obj_t BgL_auxz00_4120; - BgL_auxz00_4120 = - ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t). - cdr); - BgL_cdrzd21994zd2_959 = - ((((obj_t) ((long) BgL_auxz00_4120 - 3))->pair_t).cdr); - } - if (((((long) BgL_cdrzd21994zd2_959) & ((1 << 2) - 1)) == 3)) { - if (BGl_equalzf3zf3zz__r4_equivalence_6_2z00 - (((((obj_t) ((long) BgL_cdrzd21994zd2_959 - 3))-> - pair_t).cdr), - ((obj_t) (obj_t) ((long) (((long) (0) << 2) | 2))))) { - goto BgL_tagzd21966zd2_943; - } else { - int BgL_testz00_4128; - { - obj_t BgL_auxz00_4129; - BgL_auxz00_4129 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). - car); - BgL_testz00_4128 = - ((((long) BgL_auxz00_4129) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4128) { - BgL_tagzd21971zd2_948: - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) - ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1052z00_1026; - { - int BgL_auxz00_4134; - BgL_auxz00_4134 = (int) (((long) 3)); - BgL_v1052z00_1026 = create_vector (BgL_auxz00_4134); - } - { - obj_t BgL_arg1606z00_1028; - { - obj_t BgL_v1053z00_1029; - { - int BgL_auxz00_4137; - BgL_auxz00_4137 = (int) (((long) 3)); - BgL_v1053z00_1029 = - create_vector (BgL_auxz00_4137); - } - { - int BgL_auxz00_4140; - BgL_auxz00_4140 = (int) (((long) 2)); - ((& - (((obj_t) (BgL_v1053z00_1029))->vector_t. - obj0))[BgL_auxz00_4140] = - BgL_formalsz00_39, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4143; - BgL_auxz00_4143 = (int) (((long) 1)); - ((& - (((obj_t) (BgL_v1053z00_1029))->vector_t. - obj0))[BgL_auxz00_4143] = - BgL_bodyz00_40, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4146; - BgL_auxz00_4146 = (int) (((long) 0)); - ((& - (((obj_t) (BgL_v1053z00_1029))->vector_t. - obj0))[BgL_auxz00_4146] = - BgL_wherez00_41, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - BgL_arg1606z00_1028 = BgL_v1053z00_1029; - } - { - int BgL_auxz00_4149; - BgL_auxz00_4149 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) - [BgL_auxz00_4149] = - BgL_arg1606z00_1028, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4152; - BgL_auxz00_4152 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) - [BgL_auxz00_4152] = - BgL_locz00_43, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4157; - int BgL_auxz00_4155; - BgL_auxz00_4157 = - (obj_t) ((long) - (((long) (((long) 55)) << 2) | 1)); - BgL_auxz00_4155 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1052z00_1026))->vector_t.obj0)) - [BgL_auxz00_4155] = - BgL_auxz00_4157, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1052z00_1026; - } else { - obj_t BgL_v1054z00_1030; - { - int BgL_auxz00_4160; - BgL_auxz00_4160 = (int) (((long) 3)); - BgL_v1054z00_1030 = create_vector (BgL_auxz00_4160); - } - { - obj_t BgL_arg1608z00_1032; - BgL_arg1608z00_1032 = - make_pair (BgL_bodyz00_40, BgL_formalsz00_39); - { - int BgL_auxz00_4164; - BgL_auxz00_4164 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) - [BgL_auxz00_4164] = - BgL_arg1608z00_1032, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4167; - BgL_auxz00_4167 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) - [BgL_auxz00_4167] = - BgL_locz00_43, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4172; - int BgL_auxz00_4170; - BgL_auxz00_4172 = - (obj_t) ((long) - (((long) (((long) 56)) << 2) | 1)); - BgL_auxz00_4170 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1054z00_1030))->vector_t.obj0)) - [BgL_auxz00_4170] = - BgL_auxz00_4172, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1054z00_1030; - } - } else { - int BgL_testz00_4175; - { - obj_t BgL_auxz00_4176; - { - obj_t BgL_auxz00_4177; - BgL_auxz00_4177 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> - pair_t).cdr); - BgL_auxz00_4176 = - ((((obj_t) ((long) BgL_auxz00_4177 - 3))->pair_t). - car); - } - BgL_testz00_4175 = - ((((long) BgL_auxz00_4176) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4175) { - goto BgL_tagzd21971zd2_948; - } else { - int BgL_testz00_4181; - { - obj_t BgL_auxz00_4182; - { - obj_t BgL_auxz00_4183; - { - obj_t BgL_auxz00_4184; - BgL_auxz00_4184 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> - pair_t).cdr); - BgL_auxz00_4183 = - ((((obj_t) ((long) BgL_auxz00_4184 - 3))-> - pair_t).cdr); - } - BgL_auxz00_4182 = - ((((obj_t) ((long) BgL_auxz00_4183 - 3))-> - pair_t).car); - } - BgL_testz00_4181 = - ((((long) BgL_auxz00_4182) & ((1 << 2) - 1)) == - 3); - } - if (BgL_testz00_4181) { - goto BgL_tagzd21971zd2_948; - } else { - goto BgL_tagzd21971zd2_948; - } - } - } - } - } else { - int BgL_testz00_4189; - { - obj_t BgL_auxz00_4190; - BgL_auxz00_4190 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). - car); - BgL_testz00_4189 = - ((((long) BgL_auxz00_4190) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4189) { - goto BgL_tagzd21971zd2_948; - } else { - int BgL_testz00_4193; - { - obj_t BgL_auxz00_4194; - { - obj_t BgL_auxz00_4195; - BgL_auxz00_4195 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t). - cdr); - BgL_auxz00_4194 = - ((((obj_t) ((long) BgL_auxz00_4195 - 3))->pair_t). - car); - } - BgL_testz00_4193 = - ((((long) BgL_auxz00_4194) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4193) { - goto BgL_tagzd21971zd2_948; - } else { - int BgL_testz00_4199; - { - obj_t BgL_auxz00_4200; - { - obj_t BgL_auxz00_4201; - { - obj_t BgL_auxz00_4202; - BgL_auxz00_4202 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))-> - pair_t).cdr); - BgL_auxz00_4201 = - ((((obj_t) ((long) BgL_auxz00_4202 - 3))-> - pair_t).cdr); - } - BgL_auxz00_4200 = - ((((obj_t) ((long) BgL_auxz00_4201 - 3))->pair_t). - car); - } - BgL_testz00_4199 = - ((((long) BgL_auxz00_4200) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4199) { - goto BgL_tagzd21971zd2_948; - } else { - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) - ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1050z00_1022; - { - int BgL_auxz00_4209; - BgL_auxz00_4209 = (int) (((long) 3)); - BgL_v1050z00_1022 = - create_vector (BgL_auxz00_4209); - } - { - obj_t BgL_arg1604z00_1024; - BgL_arg1604z00_1024 = - make_pair (BgL_wherez00_41, BgL_bodyz00_40); - { - int BgL_auxz00_4213; - BgL_auxz00_4213 = (int) (((long) 2)); - ((& - (((obj_t) (BgL_v1050z00_1022))->vector_t. - obj0))[BgL_auxz00_4213] = - BgL_arg1604z00_1024, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4216; - BgL_auxz00_4216 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1050z00_1022))->vector_t.obj0)) - [BgL_auxz00_4216] = - BgL_locz00_43, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4221; - int BgL_auxz00_4219; - BgL_auxz00_4221 = - (obj_t) ((long) - (((long) (((long) 50)) << 2) | 1)); - BgL_auxz00_4219 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1050z00_1022))->vector_t.obj0)) - [BgL_auxz00_4219] = - BgL_auxz00_4221, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1050z00_1022; - } else { - obj_t BgL_v1051z00_1025; - { - int BgL_auxz00_4224; - BgL_auxz00_4224 = (int) (((long) 3)); - BgL_v1051z00_1025 = - create_vector (BgL_auxz00_4224); - } - { - int BgL_auxz00_4227; - BgL_auxz00_4227 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) - [BgL_auxz00_4227] = - BgL_bodyz00_40, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4230; - BgL_auxz00_4230 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) - [BgL_auxz00_4230] = - BgL_locz00_43, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4235; - int BgL_auxz00_4233; - BgL_auxz00_4235 = - (obj_t) ((long) - (((long) (((long) 54)) << 2) | 1)); - BgL_auxz00_4233 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1051z00_1025))->vector_t.obj0)) - [BgL_auxz00_4233] = - BgL_auxz00_4235, - ((obj_t) (obj_t) - ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1051z00_1025; - } - } - } - } - } - } - } else { - int BgL_testz00_4238; - { - obj_t BgL_auxz00_4239; - BgL_auxz00_4239 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).car); - BgL_testz00_4238 = - ((((long) BgL_auxz00_4239) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4238) { - goto BgL_tagzd21971zd2_948; - } else { - int BgL_testz00_4242; - { - obj_t BgL_auxz00_4243; - BgL_auxz00_4243 = - ((((obj_t) ((long) BgL_cdrzd21979zd2_953 - 3))->pair_t). - car); - BgL_testz00_4242 = - ((((long) BgL_auxz00_4243) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4242) { - goto BgL_tagzd21971zd2_948; - } else { - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1048z00_1018; - { - int BgL_auxz00_4248; - BgL_auxz00_4248 = (int) (((long) 3)); - BgL_v1048z00_1018 = create_vector (BgL_auxz00_4248); - } - { - obj_t BgL_arg1602z00_1020; - BgL_arg1602z00_1020 = - make_pair (BgL_wherez00_41, BgL_bodyz00_40); - { - int BgL_auxz00_4252; - BgL_auxz00_4252 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) - [BgL_auxz00_4252] = - BgL_arg1602z00_1020, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4255; - BgL_auxz00_4255 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) - [BgL_auxz00_4255] = - BgL_locz00_43, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4260; - int BgL_auxz00_4258; - BgL_auxz00_4260 = - (obj_t) ((long) (((long) (((long) 49)) << 2) | 1)); - BgL_auxz00_4258 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1048z00_1018))->vector_t.obj0)) - [BgL_auxz00_4258] = - BgL_auxz00_4260, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1048z00_1018; - } else { - obj_t BgL_v1049z00_1021; - { - int BgL_auxz00_4263; - BgL_auxz00_4263 = (int) (((long) 3)); - BgL_v1049z00_1021 = create_vector (BgL_auxz00_4263); - } - { - int BgL_auxz00_4266; - BgL_auxz00_4266 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) - [BgL_auxz00_4266] = - BgL_bodyz00_40, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4269; - BgL_auxz00_4269 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) - [BgL_auxz00_4269] = - BgL_locz00_43, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4274; - int BgL_auxz00_4272; - BgL_auxz00_4274 = - (obj_t) ((long) (((long) (((long) 53)) << 2) | 1)); - BgL_auxz00_4272 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1049z00_1021))->vector_t.obj0)) - [BgL_auxz00_4272] = - BgL_auxz00_4274, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1049z00_1021; - } - } - } - } - } - } else { - int BgL_testz00_4277; - { - obj_t BgL_auxz00_4278; - BgL_auxz00_4278 = - ((((obj_t) ((long) BgL_formalsz00_39 - 3))->pair_t).car); - BgL_testz00_4277 = - ((((long) BgL_auxz00_4278) & ((1 << 2) - 1)) == 3); - } - if (BgL_testz00_4277) { - goto BgL_tagzd21971zd2_948; - } else { - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1046z00_1014; - { - int BgL_auxz00_4283; - BgL_auxz00_4283 = (int) (((long) 3)); - BgL_v1046z00_1014 = create_vector (BgL_auxz00_4283); - } - { - obj_t BgL_arg1600z00_1016; - BgL_arg1600z00_1016 = - make_pair (BgL_wherez00_41, BgL_bodyz00_40); - { - int BgL_auxz00_4287; - BgL_auxz00_4287 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) - [BgL_auxz00_4287] = - BgL_arg1600z00_1016, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4290; - BgL_auxz00_4290 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) - [BgL_auxz00_4290] = - BgL_locz00_43, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4295; - int BgL_auxz00_4293; - BgL_auxz00_4295 = - (obj_t) ((long) (((long) (((long) 48)) << 2) | 1)); - BgL_auxz00_4293 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1046z00_1014))->vector_t.obj0)) - [BgL_auxz00_4293] = - BgL_auxz00_4295, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1046z00_1014; - } else { - obj_t BgL_v1047z00_1017; - { - int BgL_auxz00_4298; - BgL_auxz00_4298 = (int) (((long) 3)); - BgL_v1047z00_1017 = create_vector (BgL_auxz00_4298); - } - { - int BgL_auxz00_4301; - BgL_auxz00_4301 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) - [BgL_auxz00_4301] = - BgL_bodyz00_40, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4304; - BgL_auxz00_4304 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) - [BgL_auxz00_4304] = - BgL_locz00_43, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4309; - int BgL_auxz00_4307; - BgL_auxz00_4309 = - (obj_t) ((long) (((long) (((long) 52)) << 2) | 1)); - BgL_auxz00_4307 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1047z00_1017))->vector_t.obj0)) - [BgL_auxz00_4307] = - BgL_auxz00_4309, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1047z00_1017; - } - } - } - } - } else { - if ((BgL_namedzf3zf3_42 != - ((obj_t) (obj_t) ((long) (((long) (1) << 2) | 2))))) { - obj_t BgL_v1044z00_1010; - { - int BgL_auxz00_4314; - BgL_auxz00_4314 = (int) (((long) 3)); - BgL_v1044z00_1010 = create_vector (BgL_auxz00_4314); - } - { - obj_t BgL_arg1598z00_1012; - BgL_arg1598z00_1012 = make_pair (BgL_wherez00_41, BgL_bodyz00_40); - { - int BgL_auxz00_4318; - BgL_auxz00_4318 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0)) - [BgL_auxz00_4318] = - BgL_arg1598z00_1012, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - } - { - int BgL_auxz00_4321; - BgL_auxz00_4321 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0))[BgL_auxz00_4321] - = - BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4326; - int BgL_auxz00_4324; - BgL_auxz00_4326 = - (obj_t) ((long) (((long) (((long) 47)) << 2) | 1)); - BgL_auxz00_4324 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1044z00_1010))->vector_t.obj0))[BgL_auxz00_4324] - = - BgL_auxz00_4326, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1044z00_1010; - } else { - obj_t BgL_v1045z00_1013; - { - int BgL_auxz00_4329; - BgL_auxz00_4329 = (int) (((long) 3)); - BgL_v1045z00_1013 = create_vector (BgL_auxz00_4329); - } - { - int BgL_auxz00_4332; - BgL_auxz00_4332 = (int) (((long) 2)); - ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4332] - = - BgL_bodyz00_40, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - int BgL_auxz00_4335; - BgL_auxz00_4335 = (int) (((long) 1)); - ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4335] - = - BgL_locz00_43, ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - { - obj_t BgL_auxz00_4340; - int BgL_auxz00_4338; - BgL_auxz00_4340 = - (obj_t) ((long) (((long) (((long) 51)) << 2) | 1)); - BgL_auxz00_4338 = (int) (((long) 0)); - ((&(((obj_t) (BgL_v1045z00_1013))->vector_t.obj0))[BgL_auxz00_4338] - = - BgL_auxz00_4340, - ((obj_t) (obj_t) ((long) (((long) (3) << 2) | 2)))); - } - return BgL_v1045z00_1013; - } - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020304-2.c b/gcc/testsuite/gcc.c-torture/compile/20020304-2.c deleted file mode 100644 index 9a162d4935d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020304-2.c +++ /dev/null @@ -1,10 +0,0 @@ -/* This testcase ICEd because a SUBREG of MEM/v was never - simplified. */ -volatile unsigned long long *a; - -unsigned char -foo (void) -{ - unsigned char b = (*a != 0); - return b; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020309-1.c b/gcc/testsuite/gcc.c-torture/compile/20020309-1.c deleted file mode 100644 index b74061764de..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020309-1.c +++ /dev/null @@ -1,14 +0,0 @@ -int -sub1 (char *p, int i) -{ - char j = p[i]; - - { - void - sub2 () - { - i = 2; - p = p + 2; - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020309-2.c b/gcc/testsuite/gcc.c-torture/compile/20020309-2.c deleted file mode 100644 index 77699e43d3d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020309-2.c +++ /dev/null @@ -1,16 +0,0 @@ -/* This testcase ICEd on IA-32 at -O2, because loop was calling convert_modes - between a MODE_FLOAT and MODE_INT class modes. */ - -typedef union -{ - double d; - long long ll; -} A; - -void -foo (A x, A **y, A z) -{ - for (; *y; y++) - if (x.ll == 262 && (*y)->d == z.d) - break; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020312-1.c b/gcc/testsuite/gcc.c-torture/compile/20020312-1.c deleted file mode 100644 index 9f61dae64a5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020312-1.c +++ /dev/null @@ -1,19 +0,0 @@ -/* PR optimization/5892 */ -typedef struct { unsigned long a; unsigned int b, c; } A; -typedef struct { unsigned long a; A *b; int c; } B; - -static inline unsigned int -bar (unsigned int x) -{ - unsigned long r; - asm ("" : "=r" (r) : "0" (x)); - return r >> 31; -} - -int foo (B *x) -{ - A *y; - y = x->b; - y->b = bar (x->c); - y->c = ({ unsigned int z = 1; (z << 24) | (z >> 24); }); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020314-1.c b/gcc/testsuite/gcc.c-torture/compile/20020314-1.c deleted file mode 100644 index b21eb14f8d9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020314-1.c +++ /dev/null @@ -1,26 +0,0 @@ -typedef struct tux_req_struct tux_req_t; -struct tux_req_struct -{ - struct socket *sock; - char usermode; - char *userbuf; - unsigned int userlen; - char error; - void *private; -}; -void user_send_buffer (tux_req_t *req, int cachemiss) -{ - int ret; -repeat: - switch (ret) { - case -11: - if (add_output_space_event(req, req->sock)) { - del_tux_atom(req); - goto repeat; - } - do { } while (0); - break; - default: - add_req_to_workqueue(req); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020315-1.c b/gcc/testsuite/gcc.c-torture/compile/20020315-1.c deleted file mode 100644 index c6c9daa2f72..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020315-1.c +++ /dev/null @@ -1,34 +0,0 @@ -/* PR bootstrap/4128 */ - -extern int bar (char *, char *, int, int); -extern long baz (char *, char *, int, int); - -int sgt (char *a, char *b, int c, int d) -{ - return bar (a, b, c, d) > 0; -} - -long dgt (char *a, char *b, int c, int d) -{ - return baz (a, b, c, d) > 0; -} - -int sne (char *a, char *b, int c, int d) -{ - return bar (a, b, c, d) != 0; -} - -long dne (char *a, char *b, int c, int d) -{ - return baz (a, b, c, d) != 0; -} - -int seq (char *a, char *b, int c, int d) -{ - return bar (a, b, c, d) == 0; -} - -long deq (char *a, char *b, int c, int d) -{ - return baz (a, b, c, d) == 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020318-1.c b/gcc/testsuite/gcc.c-torture/compile/20020318-1.c deleted file mode 100644 index 097a35d7956..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020318-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* PR c/5656 - This testcase ICEd on IA-32 at -O3, due to tree inliner not converting - parameter assignment when using K&R syntax. */ - -void foo (c) - char c; -{ - (void) &c; -} - -int bar (void); - -void baz (void) -{ - foo (bar ()); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020319-1.c b/gcc/testsuite/gcc.c-torture/compile/20020319-1.c deleted file mode 100644 index be5b9c2fece..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020319-1.c +++ /dev/null @@ -1,20 +0,0 @@ -/* This testcase ICEd in combine.c:do_SUBST() self-test for sign-extended -CONST_INT because expr.c:expand_expr() was not sign-extending array index -into constant strings. */ - -typedef unsigned char uch; -extern uch outbuf[]; -extern unsigned outcnt; - -extern void flush_outbuf (void); - -int zip(void) -{ - outcnt = 0; - - {outbuf[outcnt++]=(uch)("\037\213"[0]); if (outcnt==16384) flush_outbuf();}; - {outbuf[outcnt++]=(uch)("\037\213"[1]); if (outcnt==16384) flush_outbuf();}; - - return 0; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20020320-1.c b/gcc/testsuite/gcc.c-torture/compile/20020320-1.c deleted file mode 100644 index 385c061e193..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020320-1.c +++ /dev/null @@ -1,24 +0,0 @@ -/* PR bootstrap/4192 - This testcase caused infinite loop in flow (several places), - because flow assumes gen_jump generates simple_jump_p. */ - -typedef void (*T) (void); -extern T x[]; - -void -foo (void) -{ - static T *p = x; - static _Bool a; - T f; - - if (__builtin_expect (a, 0)) - return; - - while ((f = *p)) - { - p++; - f (); - } - a = 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020323-1.c b/gcc/testsuite/gcc.c-torture/compile/20020323-1.c deleted file mode 100644 index ed3c66651d9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020323-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* This testcase caused ICE on powerpc at -O3, because regrename did - not handle match_dup of match_operator if the RTLs were not shared. */ - -struct A -{ - unsigned char *a0, *a1; - int a2; -}; - -void bar (struct A *); - -unsigned int -foo (int x) -{ - struct A a; - unsigned int b; - - if (x < -128 || x > 255 || x == -1) - return 26; - - a.a0 = (unsigned char *) &b; - a.a1 = a.a0 + sizeof (unsigned int); - a.a2 = 0; - bar (&a); - return b; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020330-1.c b/gcc/testsuite/gcc.c-torture/compile/20020330-1.c deleted file mode 100644 index cac7099127f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020330-1.c +++ /dev/null @@ -1,27 +0,0 @@ -/* PR 5446 */ -/* This testcase is similar to gcc.c-torture/compile/20011219-1.c except - with parts of it omitted, causing an ICE with -O3 on IA-64. */ - -void * baz (unsigned long); -static inline double ** -bar (long w, long x, long y, long z) -{ - long i, a = x - w + 1, b = z - y + 1; - double **m = (double **) baz (sizeof (double *) * (a + 1)); - - m += 1; - m -= w; - m[w] = (double *) baz (sizeof (double) * (a * b + 1)); - for (i = w + 1; i <= x; i++) - m[i] = m[i - 1] + b; - return m; -} - -void -foo (double w[], int x, double y[], double z[]) -{ - int i; - double **a; - - a = bar (1, 50, 1, 50); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020409-1.c b/gcc/testsuite/gcc.c-torture/compile/20020409-1.c deleted file mode 100644 index 1bdc08ff3b8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020409-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* PR c/5078 */ - -#include <limits.h> - -int f(int i) -{ - i -= 2 * (INT_MAX + 1); - return i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020415-1.c b/gcc/testsuite/gcc.c-torture/compile/20020415-1.c deleted file mode 100644 index 95cdc1eafeb..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020415-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* Check that floating point casts of integer operations don't ICE. */ -/* The first of these routines caused problems for a patch, that wasn't - otherwise caught by a full bootstrap, the regression test suite or - SPEC CPU2000. */ - -double -andop (unsigned int x) -{ - return x & 1; -} - -double -orop (unsigned int x) -{ - return x | 1; -} - -double -notop (unsigned int x) -{ - return ~x; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020418-1.c b/gcc/testsuite/gcc.c-torture/compile/20020418-1.c deleted file mode 100644 index df01e6847e3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020418-1.c +++ /dev/null @@ -1,18 +0,0 @@ -/* PR c/6358 - This testcase ICEd on IA-32 in foo, because current_function_return_rtx - was assigned a hard register only after expand_null_return was called, - thus return pseudo was clobbered twice and the hard register not at - all. */ - -void baz (void); - -double foo (void) -{ - baz (); - return; -} - -double bar (void) -{ - baz (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020530-1.c b/gcc/testsuite/gcc.c-torture/compile/20020530-1.c deleted file mode 100644 index a6794892ec7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020530-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* PR optimization/6822 */ - -extern unsigned char foo1 (void); -extern unsigned short foo2 (void); - -int bar1 (void) -{ - unsigned char q = foo1 (); - return (q < 0x80) ? 64 : 0; -} - -int bar2 (void) -{ - unsigned short h = foo2 (); - return (h < 0x8000) ? 64 : 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c b/gcc/testsuite/gcc.c-torture/compile/20020604-1.c deleted file mode 100644 index 19e082030a4..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c +++ /dev/null @@ -1,87 +0,0 @@ -/* PR c/6957 - This testcase ICEd at -O2 on IA-32, because - (insn 141 139 142 (set (subreg:SF (reg:QI 72) 0) - (plus:SF (reg:SF 73) - (reg:SF 76))) 525 {*fop_sf_comm_nosse} (insn_list 134 (nil)) - (expr_list:REG_DEAD (reg:SF 73) (nil))) - couldn't be reloaded. */ - -void -foo (unsigned int n, int x, int y, unsigned char *z) -{ - int a, b; - float c[2048][4]; - - switch (x) - { - case 0x1906: - a = b = -1; - break; - case 0x190A: - a = b = -1; - break; - case 0x8049: - a = b = -1; - break; - case 0x1907: - a = 1; - b = 2; - break; - default: - return; - } - - if (a >= 0) - { - unsigned char *d = z; - unsigned int i; - for (i = 0; i < n; i++) - { - do - { - union - { - float r; - unsigned int i; - } - e; - e.r = c[i][1]; - d[a] = - ((e.i >= 0x3f7f0000) ? ((int) e.i < - 0) ? (unsigned char) 0 - : (unsigned char) 255 : (e.r = - e.r * (255.0F / 256.0F) + - 32768.0F, (unsigned char) e.i)); - } - while (0); - d += y; - } - } - - if (b >= 0) - { - unsigned char *d = z; - unsigned int i; - for (i = 0; i < n; i++) - { - do - { - union - { - float r; - unsigned int i; - } - e; - e.r = c[i][2]; - d[b] = - ((e.i >= 0x3f7f0000) ? ((int) e.i < - 0) ? (unsigned char) 0 - : (unsigned char) 255 : (e.r = - e.r * (255.0F / 256.0F) + - 32768.0F, (unsigned char) e.i)); - } - while (0); - d += y; - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020604-1.x b/gcc/testsuite/gcc.c-torture/compile/20020604-1.x deleted file mode 100644 index bced22f0f44..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020604-1.x +++ /dev/null @@ -1,10 +0,0 @@ -# The array is too big. -if { [istarget "h8300-*-*"] } { - return 1; -} - -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { - return 1; -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/20020605-1.c b/gcc/testsuite/gcc.c-torture/compile/20020605-1.c deleted file mode 100644 index 960a4be7ed1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020605-1.c +++ /dev/null @@ -1,17 +0,0 @@ -/* This testcase caused on IA-32 -O2 endless loop in - merge_blocks when trying to merge a basic block - with itself. */ - -void f (void) -{ - char *c; - do - { - if (c) - break; - } - while (1); - if (!c) - while (1) - f (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020701-1.c b/gcc/testsuite/gcc.c-torture/compile/20020701-1.c deleted file mode 100644 index 1258cec28b7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020701-1.c +++ /dev/null @@ -1,75 +0,0 @@ -/* PR target/7177 - Problem with cris-axis-elf: ICE in global. - Origin: hp@axis.com. */ - -typedef __SIZE_TYPE__ size_t; -void f1 (void *); -char *f2 (const char *); -int atoi (const char *); -char *strchr (const char *, int); -int strcmp (const char *, const char *); -size_t strlen (const char *); -typedef enum { A, B, C } t1; -extern const char _v[]; - -static t1 -f (const char* p1, const char* p2, char p3) -{ - char *v1; - char *v2; - char *a; - char *v3; - char *v4; - char *v5; - char *e; - char *v6; - t1 r = C; - - v1 = f2 (p2); - v4 = f2 (p1); - - a = v2 = v1; - e = v5 = v4; - memcpy (&e, &e, sizeof (e)); - - v3 = strchr (v2, ','); - v6 = strchr (v5, ','); - - while ((_v + 1)[(unsigned) *a] & 4) - a++; - while ((_v + 1)[(unsigned) *e] & 4) - e++; - - if (a == v3 && e == v6) - { - if (p3) - r = atoi (v5) < atoi (v2) ? B : A; - else - r = atoi (v5) > atoi (v2) ? B : A; - v2 = ++a; - v5 = ++e; - v3 = strchr (v2, ','); - v6 = strchr (v5, ','); - - while ((_v + 1)[(unsigned) *a] & 4) - a++; - while ((_v + 1)[(unsigned) *e] & 4) - e++; - - if (a == v3 && e == v6) - { - if (r == B) - r = B; - else if (p3) - r = atoi (v5) < atoi (v2) ? B : A; - else - r = atoi (v5) > atoi (v2) ? B : A; - } - else - r = C; - } - - f1 (v1); - f1 (v4); - return r; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020706-1.c b/gcc/testsuite/gcc.c-torture/compile/20020706-1.c deleted file mode 100644 index c8811bc68ff..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020706-1.c +++ /dev/null @@ -1,50 +0,0 @@ -// Contributed by Alexandre Oliva <aoliva@redhat.com> -// From Red Hat case 106165. - -typedef struct s1 -{ - unsigned short v1; - unsigned char *v2; -} S1; - -extern void bar(const struct s1 *const hdb); -extern unsigned char* foo (); - -unsigned int sn; -S1 *hdb; -S1 *pb; -unsigned short len; - -unsigned int crashIt() -{ - unsigned char *p; - unsigned int nsn; - unsigned short cnt; - - if (sn != 0) return 1; - - if ((len < 12) || ((p = (((pb->v1) >= 8) ? pb->v2 : foo() )) == 0)) - return 1; - - nsn = ( - (((*(unsigned int*)p) & 0x000000ff) << 24) | - (((*(unsigned int*)p) & 0x0000ff00) << 8) | - (((*(unsigned int*)p) & 0x00ff0000) >> 8) | - (((*(unsigned int*)p) & 0xff000000) >> 24) ); - p += 4; - - cnt = (unsigned short) (( - (((*(unsigned int*)p) & 0x000000ff) << 24) | - (((*(unsigned int*)p) & 0x0000ff00) << 8) | - (((*(unsigned int*)p) & 0x00ff0000) >> 8) | - (((*(unsigned int*)p) & 0xff000000) >> 24) ) & - 0xffff); - - if ((len != 12 + (cnt * 56)) || (nsn == 0)) - { - bar(hdb); - return 1; - } - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020706-2.c b/gcc/testsuite/gcc.c-torture/compile/20020706-2.c deleted file mode 100644 index b84dda60fd3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020706-2.c +++ /dev/null @@ -1,26 +0,0 @@ -// Contributed by Alexandre Oliva <aoliva@redhat.com> -// From Red Hat case 106165. - -typedef unsigned short (FUNC_P) (void *, unsigned char *, unsigned short); - -void crashIt(int id, FUNC_P *func, unsigned char *funcparm) -{ - unsigned char buff[5], reverse[4]; - unsigned char *bp = buff; - unsigned char *rp = reverse; - unsigned short int count = 0; - unsigned short cnt; - while (id > 0) - { - *rp++ = (unsigned char) (id & 0x7F); - id >>= 7; - count++; - } - cnt = count + 1; - while ((count--) > 1) - { - *bp++ = (unsigned char)(*(--rp) | 0x80); - } - *bp++ = *(--rp); - (void)(*func)(funcparm, buff, cnt); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020709-1.c b/gcc/testsuite/gcc.c-torture/compile/20020709-1.c deleted file mode 100644 index af0e1ddf469..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020709-1.c +++ /dev/null @@ -1,7 +0,0 @@ -extern double atof (__const char *__nptr) __attribute__ ((__pure__)); - -void bar (char *s) -{ - union {double val; unsigned int a, b;} u; - u.val = atof (s); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020710-1.c b/gcc/testsuite/gcc.c-torture/compile/20020710-1.c deleted file mode 100644 index bf6c9066cdd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020710-1.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Red Hat bugzilla #68395 - PR middle-end/7245 - This testcase ICEd on IA-32 because shift & compare patterns - predicates allowed any immediate, but constraints allowed only - numbers from 1 to 31. */ - -void foo (int *x, unsigned int y) -{ - int a = y >> -13; - if (a) - *x = a; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020715-1.c b/gcc/testsuite/gcc.c-torture/compile/20020715-1.c deleted file mode 100644 index 5294133f37b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020715-1.c +++ /dev/null @@ -1,22 +0,0 @@ -/* PR optimization/7153 */ -/* Verify that GCC doesn't promote a register when its - lifetime is not limited to one basic block. */ - -void f(char); -void g(void); - -void scale(void) -{ - int width; - char bytes; - char *src; - - if (width) - { - bytes = *src; - g(); - width *= bytes; - } - - f(bytes); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020910-1.c b/gcc/testsuite/gcc.c-torture/compile/20020910-1.c deleted file mode 100644 index 31398ea3d45..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020910-1.c +++ /dev/null @@ -1,14 +0,0 @@ -unsigned int x0 = 0; - -typedef struct { - unsigned int field1 : 20; - unsigned int field2 : 12; -} XX; - -static XX yy; - -static void foo (void) -{ - yy.field1 = (unsigned int ) (&x0); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20020926-1.c b/gcc/testsuite/gcc.c-torture/compile/20020926-1.c deleted file mode 100644 index 260e844549a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020926-1.c +++ /dev/null @@ -1,21 +0,0 @@ -/* PR c/7160 */ -/* Verify that the register-to-stack converter properly handles - branches without return value containing function calls. */ - -extern int gi; - -extern int foo1(int, int); -extern void foo2(int, int); -extern float foo3(int); - -float bar(int i1, int i2) -{ - int i3; - - if (i2) { - i3 = foo1(i1, gi); - foo2(i1, i3); - } - else - return foo3(i2); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020927-1.c b/gcc/testsuite/gcc.c-torture/compile/20020927-1.c deleted file mode 100644 index b93d8a18d5e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020927-1.c +++ /dev/null @@ -1,26 +0,0 @@ -/* PR optimization/7520 */ -/* ICE at -O3 on x86 due to register life problems caused by - the return-without-value in bar. */ - -int -foo () -{ - int i; - long long int j; - - while (1) - { - if (j & 1) - ++i; - j >>= 1; - if (j) - return i; - } -} - -int -bar () -{ - if (foo ()) - return; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20020930-1.c b/gcc/testsuite/gcc.c-torture/compile/20020930-1.c deleted file mode 100644 index d2fa3748ab5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20020930-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* PR c/8002 */ - -float expm1f(float x) { - union { - float value; - unsigned word; - } sf_u; - sf_u.word = (unsigned) x * 2; - return x + sf_u.value; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021001-1.c b/gcc/testsuite/gcc.c-torture/compile/20021001-1.c deleted file mode 100644 index 9f0f9c0978f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021001-1.c +++ /dev/null @@ -1,4 +0,0 @@ -int foo (double x, double y) -{ - return !__builtin_isunordered (x, y); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021007-1.c b/gcc/testsuite/gcc.c-torture/compile/20021007-1.c deleted file mode 100644 index de4c0defae9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021007-1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* PR c/7411 */ -/* Verify that GCC simplifies the null addition to i before - virtual register substitution tries it and winds up with - a memory to memory move. */ - -void foo () -{ - int i = 0,j; - - i+=j=0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-1.c b/gcc/testsuite/gcc.c-torture/compile/20021015-1.c deleted file mode 100644 index 789b8a8b176..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021015-1.c +++ /dev/null @@ -1,12 +0,0 @@ -/* PR target/7370. */ - -int g (int *x, int *y); - -void f () -{ - int x, y; - char a[4000]; - - g (&x, &y); - x = x/y + x; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021015-2.c b/gcc/testsuite/gcc.c-torture/compile/20021015-2.c deleted file mode 100644 index 6b158c5bdc8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021015-2.c +++ /dev/null @@ -1,7 +0,0 @@ -/* PR target/8232. */ - -int f (char *p, char *q, int i) -{ - return bcmp (p, q, i); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20021103-1.c b/gcc/testsuite/gcc.c-torture/compile/20021103-1.c deleted file mode 100644 index 82802001a5d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021103-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* PR middle-end/8408 */ -/* Verify that the recognizer explicitly - handles ADDRESSOF operands. */ - -void foo(void) -{ - double d1 = 3.14159, d2; - if (&d2 == &d1) - ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021108-1.c b/gcc/testsuite/gcc.c-torture/compile/20021108-1.c deleted file mode 100644 index c421639035a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021108-1.c +++ /dev/null @@ -1,7 +0,0 @@ -int -main() -{ -l1: - return &&l1-&&l2; -l2: -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021110.c b/gcc/testsuite/gcc.c-torture/compile/20021110.c deleted file mode 100644 index dd2aa7e09dd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021110.c +++ /dev/null @@ -1,10 +0,0 @@ -/* PR c/8439 */ -/* Verify that GCC properly handles null increments. */ - -struct empty { -}; - -void foo(struct empty *p) -{ - p++; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021119-1.c b/gcc/testsuite/gcc.c-torture/compile/20021119-1.c deleted file mode 100644 index d4306b89b99..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021119-1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* PR c/8588 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC converts integer constants - in shift operations. */ - -void foo() -{ - unsigned int i, j; - j = (i >> 0xf0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021120-1.c b/gcc/testsuite/gcc.c-torture/compile/20021120-1.c deleted file mode 100644 index 423f8ec1964..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021120-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* PR c/8518 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC doesn't get confused by the - redefinition of an extern inline function. */ - -extern int inline foo () { return 0; } -extern int inline bar () { return 0; } -static int inline bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021120-2.c b/gcc/testsuite/gcc.c-torture/compile/20021120-2.c deleted file mode 100644 index 51f0e257dfd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021120-2.c +++ /dev/null @@ -1,9 +0,0 @@ -/* PR c/8518 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC doesn't get confused by the - redefinition of an extern inline function. */ - -extern int inline foo () { return 0; } -extern int inline bar () { return 0; } -static int bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-1.c b/gcc/testsuite/gcc.c-torture/compile/20021123-1.c deleted file mode 100644 index dd2aa7e09dd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021123-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* PR c/8439 */ -/* Verify that GCC properly handles null increments. */ - -struct empty { -}; - -void foo(struct empty *p) -{ - p++; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-2.c b/gcc/testsuite/gcc.c-torture/compile/20021123-2.c deleted file mode 100644 index 423f8ec1964..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021123-2.c +++ /dev/null @@ -1,9 +0,0 @@ -/* PR c/8518 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC doesn't get confused by the - redefinition of an extern inline function. */ - -extern int inline foo () { return 0; } -extern int inline bar () { return 0; } -static int inline bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-3.c b/gcc/testsuite/gcc.c-torture/compile/20021123-3.c deleted file mode 100644 index 51f0e257dfd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021123-3.c +++ /dev/null @@ -1,9 +0,0 @@ -/* PR c/8518 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC doesn't get confused by the - redefinition of an extern inline function. */ - -extern int inline foo () { return 0; } -extern int inline bar () { return 0; } -static int bar () { return foo(); } diff --git a/gcc/testsuite/gcc.c-torture/compile/20021123-4.c b/gcc/testsuite/gcc.c-torture/compile/20021123-4.c deleted file mode 100644 index d4306b89b99..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021123-4.c +++ /dev/null @@ -1,11 +0,0 @@ -/* PR c/8588 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that GCC converts integer constants - in shift operations. */ - -void foo() -{ - unsigned int i, j; - j = (i >> 0xf0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021124-1.c b/gcc/testsuite/gcc.c-torture/compile/20021124-1.c deleted file mode 100644 index 3ab2b2ef495..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021124-1.c +++ /dev/null @@ -1,7 +0,0 @@ -/* PR optimization/8275 */ -/* Contributed by Volker Reichelt. */ - -unsigned int foo (unsigned int u) -{ - return (u >> 32) & 0xffff; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021204-1.c b/gcc/testsuite/gcc.c-torture/compile/20021204-1.c deleted file mode 100644 index 4e8d3fefcbb..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021204-1.c +++ /dev/null @@ -1,16 +0,0 @@ -/* PR c/7622 */ - -/* Verify that GCC can handle the mix of - extern inline and nested functions. */ - -extern inline int t() -{ - int q() { return 0; } - - return q(); -} - -int foo() -{ - return t(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021205-1.c b/gcc/testsuite/gcc.c-torture/compile/20021205-1.c deleted file mode 100644 index 9c400cfac3a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021205-1.c +++ /dev/null @@ -1,11 +0,0 @@ -/* dg-do compile */ -/* dg-options "-O3" */ -typedef struct x x; -extern void *baz(char *); -struct x { char * (*bar) (int); }; -static x **foo() { return ((x**)baz(0)); } -int xyzzy() -{ - baz((*foo())->bar(0)); - return 3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021212-1.c b/gcc/testsuite/gcc.c-torture/compile/20021212-1.c deleted file mode 100644 index b89669d75b8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021212-1.c +++ /dev/null @@ -1,15 +0,0 @@ -/* PR optimization/8334 */ -/* Verify that GCC produces valid operands - after simplifying an addition. */ - -void foo(int m, int n, double *f) -{ - int i, j, k = 1; - - for (j = 0; j < n; j++) { - for (i = k; i < m; i++) { - f[i] = (double) (i * j); - f[i + j] = (double) ((i + 1) * j); - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20021230-1.c b/gcc/testsuite/gcc.c-torture/compile/20021230-1.c deleted file mode 100644 index 45ab51fd5ef..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20021230-1.c +++ /dev/null @@ -1,8 +0,0 @@ -/* SH has special handling for combined and/shift sequences. Make - sure that it behaves properly when one input is in the MACL register. */ -int r, t; - -static void initRGB() -{ - t = ((r*255/3) & 0xff) << 16; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20030109-1.c b/gcc/testsuite/gcc.c-torture/compile/20030109-1.c deleted file mode 100644 index 4df7d18721a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20030109-1.c +++ /dev/null @@ -1,6 +0,0 @@ -void foo () -{ - int x1, x2, x3; - - bar (&x2 - &x1, &x3 - &x2); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/20030110-1.c b/gcc/testsuite/gcc.c-torture/compile/20030110-1.c deleted file mode 100644 index 1cbbaea3c10..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20030110-1.c +++ /dev/null @@ -1,39 +0,0 @@ -extern char bpp; - -void foo() -{ - if (bpp == 32) - { - if (2 < 8) - { - do - { - while (inb(0x9ae8) & (0x0100 >> (2 +1))); - } - while(0); - } - else - { - do - { - while (inb(0x9ae8) & (0x0100 >> (2))); - } - while(0); - } - } - else - do - { - while (inb(0x9ae8) & (0x0100 >> (1))); - } - while(0); - if (8 < 8) - { - do - { - while (inb(0x9ae8) & (0x0100 >> (8 +1))); - } - while(0); - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/20030125-1.c b/gcc/testsuite/gcc.c-torture/compile/20030125-1.c deleted file mode 100644 index 656304e2d67..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20030125-1.c +++ /dev/null @@ -1,24 +0,0 @@ - int count; - - int func(int *valp) { - int val, locked = 0; - - while ((val = *valp) != 0) { - if (count) { - if (count) - locked = 1; - else - locked = 1; - - if (!locked) - continue; - } - - if (!count) - count--; - - break; - } - - return val; - } diff --git a/gcc/testsuite/gcc.c-torture/compile/20030206-1.c b/gcc/testsuite/gcc.c-torture/compile/20030206-1.c deleted file mode 100644 index 1e0d5445877..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/20030206-1.c +++ /dev/null @@ -1,14 +0,0 @@ -/* PR c/9530 */ -/* Contributed by Volker Reichelt. */ - -/* Verify that the call to 'foo' is not turned - into a sibling call. */ - -void foo(float d); - -float bar(float d); - -float baz(float d) -{ - foo(bar(d)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/900116-1.c b/gcc/testsuite/gcc.c-torture/compile/900116-1.c deleted file mode 100644 index 37c7eb789b9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/900116-1.c +++ /dev/null @@ -1,14 +0,0 @@ -struct st {char a, b, c, d; } - -zloop (struct st *s, int *p, int *q) -{ - int i; - struct st ss; - - for (i = 0; i < 100; i++) - { - ss = s[i]; - p[i] = ss.c; - q[i] = ss.b; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/900216-1.c b/gcc/testsuite/gcc.c-torture/compile/900216-1.c deleted file mode 100644 index 8a4bfb74e78..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/900216-1.c +++ /dev/null @@ -1,9 +0,0 @@ -foo (p, a, b) - unsigned short *p; -{ - unsigned int x; - - x = p[0]; - - return (x == 134U); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/900313-1.c b/gcc/testsuite/gcc.c-torture/compile/900313-1.c deleted file mode 100644 index f2bc40d7242..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/900313-1.c +++ /dev/null @@ -1,172 +0,0 @@ -main () -{ - char *a; - foo (alloca (10000)); - foo (alloca (100000)); - foo (alloca ((int) &main)); -} - -many_par (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p) -{ - char *x; - int aa, ba, ca, da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa; - - aa = bar (); - ba = bar (); - ca = bar (); - da = bar (); - ea = bar (); - fa = bar (); - ga = bar (); - ha = bar (); - ia = bar (); - ja = bar (); - ka = bar (); - la = bar (); - ma = bar (); - na = bar (); - oa = bar (); - pa = bar (); - foobar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, aa, ba, ca, - da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa); - -} - -foobar (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, aa, ba, ca, - da, ea, fa, ga, ha, ia, ja, ka, la, ma, na, oa, pa) -{ - int ab, bb, cb, db, eb, fb, gb, hb, ib, jb, kb, lb, mb, nb, ob, pb; - int qb, rb, sb, tb, ub, vb, xb, yb; - - ab = bar (); - bb = bar (); - cb = bar (); - db = bar (); - eb = bar (); - fb = bar (); - gb = bar (); - hb = bar (); - ib = bar (); - jb = bar (); - kb = bar (); - lb = bar (); - mb = bar (); - nb = bar (); - ob = bar (); - pb = bar (); - qb = bar (); - rb = bar (); - sb = bar (); - tb = bar (); - ub = bar (); - vb = bar (); - xb = bar (); - yb = bar (); - - boofar (a); - boofar (b); - boofar (c); - boofar (d); - boofar (e); - boofar (f); - boofar (g); - boofar (h); - boofar (i); - boofar (j); - boofar (k); - boofar (l); - boofar (m); - boofar (n); - boofar (o); - boofar (p); - boofar (aa); - boofar (ba); - boofar (ca); - boofar (da); - boofar (ea); - boofar (fa); - boofar (ga); - boofar (ha); - boofar (ia); - boofar (ja); - boofar (ka); - boofar (la); - boofar (ma); - boofar (na); - boofar (oa); - boofar (pa); - - boofar (ab); - boofar (bb); - boofar (cb); - boofar (db); - boofar (eb); - boofar (fb); - boofar (gb); - boofar (hb); - boofar (ib); - boofar (jb); - boofar (kb); - boofar (lb); - boofar (mb); - boofar (nb); - boofar (ob); - boofar (pb); - - boofar (a); - boofar (b); - boofar (c); - boofar (d); - boofar (e); - boofar (f); - boofar (g); - boofar (h); - boofar (i); - boofar (j); - boofar (k); - boofar (l); - boofar (m); - boofar (n); - boofar (o); - boofar (p); - boofar (aa); - boofar (ba); - boofar (ca); - boofar (da); - boofar (ea); - boofar (fa); - boofar (ga); - boofar (ha); - boofar (ia); - boofar (ja); - boofar (ka); - boofar (la); - boofar (ma); - boofar (na); - boofar (oa); - boofar (pa); - - boofar (ab); - boofar (bb); - boofar (cb); - boofar (db); - boofar (eb); - boofar (fb); - boofar (gb); - boofar (hb); - boofar (ib); - boofar (jb); - boofar (kb); - boofar (lb); - boofar (mb); - boofar (nb); - boofar (ob); - boofar (pb); - -} - -test_exit_ignore_stack () -{ - foobar (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/900407-1.c b/gcc/testsuite/gcc.c-torture/compile/900407-1.c deleted file mode 100644 index fdf47791cd7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/900407-1.c +++ /dev/null @@ -1,10 +0,0 @@ -foo (a, b, p) - int *p; -{ - int c; - p[1] = a + 0x1000; - c = b + 0xffff0000; - if ((b + 0xffff0000) == 0) - c++; - p[2] = c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/900516-1.c b/gcc/testsuite/gcc.c-torture/compile/900516-1.c deleted file mode 100644 index 69e96144745..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/900516-1.c +++ /dev/null @@ -1 +0,0 @@ -f(c){return!(c?2.0:1.0);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920301-1.c b/gcc/testsuite/gcc.c-torture/compile/920301-1.c deleted file mode 100644 index c4d663eb8a7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920301-1.c +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef NO_LABEL_VALUES -f(){static void*t[]={&&x};x:;} -#endif -g(){static unsigned p[5];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920409-1.c b/gcc/testsuite/gcc.c-torture/compile/920409-1.c deleted file mode 100644 index b96ec53d595..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920409-1.c +++ /dev/null @@ -1 +0,0 @@ -x(){int y;y>0.0?y:y-1;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920409-2.c b/gcc/testsuite/gcc.c-torture/compile/920409-2.c deleted file mode 100644 index ef2bdb8b7e7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920409-2.c +++ /dev/null @@ -1,2 +0,0 @@ -double x(){int x1,x2;double v; -if(((long)(x1-x2))<1)return -1.0;v=t(v);v=y(1,v>0.0?(int)v:((int)v-1));} diff --git a/gcc/testsuite/gcc.c-torture/compile/920410-1.c b/gcc/testsuite/gcc.c-torture/compile/920410-1.c deleted file mode 100644 index 4bfa7a665a3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920410-1.c +++ /dev/null @@ -1,30 +0,0 @@ -int alloc_float(f) - float f; -{ union - { - float f; - int i; - } - u; - u.f=f; - return u.i&~1; -} - -float c_float(int obj) -{ union - { - float f; - int i; - } u; - - u.i=obj; - return u.f; -} - -main() -{ int x=alloc_float(1.2); - int y=alloc_float(5.7); - int z=alloc_float(c_float(x)*c_float(y)); - - printf("%g\n",(double)c_float(z)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920410-2.c b/gcc/testsuite/gcc.c-torture/compile/920410-2.c deleted file mode 100644 index 958aae9cb0f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920410-2.c +++ /dev/null @@ -1,12 +0,0 @@ -joe() -{ - int j; - - while( 1 ) - { - for( j = 0; j < 4; j++ ) - ; - for( j = 0; j < 4; j++ ) - ; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920411-2.c b/gcc/testsuite/gcc.c-torture/compile/920411-2.c deleted file mode 100644 index 0cc13c8436a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920411-2.c +++ /dev/null @@ -1 +0,0 @@ -x(){int n;double x;n=x<1?n:n+1;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920413-1.c b/gcc/testsuite/gcc.c-torture/compile/920413-1.c deleted file mode 100644 index 45b5fc5d09c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920413-1.c +++ /dev/null @@ -1,2 +0,0 @@ -union u {double d;long long ll;}; -f(double x, int n){union u v;v.d=x;if(n>=0){v.ll<<=63;}else{v.ll+=1<<-n;v.ll>>=-n;}return v.ll;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920415-1.c b/gcc/testsuite/gcc.c-torture/compile/920415-1.c deleted file mode 100644 index 8d9bc065349..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920415-1.c +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef NO_LABEL_VALUES -f () -{ - __label__ l; - void *x() - { - return &&l; - } - goto *x (); - abort (); - return; - l: - exit (0); -} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-1.c b/gcc/testsuite/gcc.c-torture/compile/920428-1.c deleted file mode 100644 index fdc478a382c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-1.c +++ /dev/null @@ -1 +0,0 @@ -x(){char*q;return(long)q>>8&0xff;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-2.c b/gcc/testsuite/gcc.c-torture/compile/920428-2.c deleted file mode 100644 index 23f32a83a9d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-2.c +++ /dev/null @@ -1,531 +0,0 @@ -double sin(double x); -double cos(double x); -double tan(double x); -double asin(double x); -double acos(double x); -double atan(double x); -double atan2(double y, double x); -double sinh(double x); -double cosh(double x); -double tanh(double x); -double exp(double x); -double expm1(double x); -double log(double x); -double log10(double x); -double log1p(double x); -double pow(double x, double y); -double sqrt(double x); -double cbrt(double x); -double ceil(double x); -double floor(double x); -double fabs(double x); -double frexp(double value, int *eptr); -double ldexp(double value, int exp); -double modf(double value, double *iptr); -double erf(double x); -double erfc(double x); -double atof(const char *nptr); -double hypot(double x, double y); -double lgamma(double x); -double j0(double x); -double j1(double x); -double jn(int n, double x); -double y0(double x); -double y1(double x); -double yn(int n, double x); -extern struct _iobuf { - int _cnt; - char *_ptr; - char *_base; - int _bufsiz; - short _flag; - char _file; -} _iob[]; -typedef unsigned long size_t; -typedef char *va_list; -struct _iobuf *fopen(const char *filename, const char *type); -struct _iobuf *freopen(const char *filename, const char *type, struct _iobuf *stream); -struct _iobuf *fdopen(int fildes, const char *type); -struct _iobuf *popen(const char *command, const char *type); -int pclose(struct _iobuf *stream); -int fflush(struct _iobuf *stream); -int fclose(struct _iobuf *stream); -int remove(const char *path); -int rename(const char *from, const char *to); -struct _iobuf *tmpfile(void); -char *tmpnam(char *s); -int setvbuf(struct _iobuf *iop, char *buf, int type, size_t size); -int setbuf(struct _iobuf *stream, char *buf); -int setbuffer(struct _iobuf *stream, char *buf, size_t size); -int setlinebuf(struct _iobuf *stream); -int fprintf(struct _iobuf *stream, const char *format, ...); -int printf(const char *format, ...); -char *sprintf(char *s, const char *format, ...); -int vfprintf(struct _iobuf *stream, const char *format, va_list arg); -int vprintf(const char *format, va_list arg); -int vsprintf(char *s, const char *format, va_list arg); -int fscanf(struct _iobuf *stream, const char *format, ...); -int scanf(const char *format, ...); -int sscanf(char *s, const char *format, ...); -int fgetc(struct _iobuf *stream); -int getw(struct _iobuf *stream); -char *fgets(char *s, int n, struct _iobuf *stream); -char *gets(char *s); -int fputc(int c, struct _iobuf *stream); -int putw(int w, struct _iobuf *stream); -int fputs(const char *s, struct _iobuf *stream); -int puts(const char *s); -int ungetc(int c, struct _iobuf *stream); -int fread(void *ptr, size_t size, size_t count, struct _iobuf *iop); -int fwrite(const void *ptr, size_t size, size_t count, struct _iobuf *iop); -int fseek(struct _iobuf *stream, long offset, int ptrname); -long ftell(struct _iobuf *stream); -void rewind(struct _iobuf *stream); -int fgetpos(struct _iobuf *stream, long *pos); -int fsetpos(struct _iobuf *stream, const long *pos); -void perror(const char *s); -typedef unsigned char byte; -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; -typedef unsigned char u_char; -typedef unsigned short u_short; -typedef unsigned int u_int; -typedef unsigned long u_long; -typedef unsigned short ushort_; -typedef struct _physadr { int r[1]; } *physadr; -typedef struct label_t { - int val[11]; -} label_t; -typedef struct _quad { long val[2]; } quad; -typedef long daddr_t; -typedef char * caddr_t; -typedef u_long ino_t; -typedef long swblk_t; -typedef long time_t; -typedef short dev_t; -typedef long off_t; -typedef u_short uid_t; -typedef u_short gid_t; -typedef signed char prio_t; -typedef long fd_mask; -typedef struct fd_set { - fd_mask fds_bits[(((256 )+(( (sizeof(fd_mask) * 8 ) )-1))/( (sizeof(fd_mask) * 8 ) )) ]; -} fd_set; -typedef struct qhdr { - struct qhdr *link, *rlink; -} *queue_t; -typedef char *ptr_ord_t; -typedef double floatp; -typedef char *(*proc_alloc_t)(unsigned num_elements, unsigned element_size, const char *client_name ); -typedef void (*proc_free_t)(char *data, unsigned num_elements, unsigned element_size, const char *client_name ); -extern struct _iobuf *gs_out; -typedef struct gs_point_s { - double x, y; -} gs_point; -typedef struct gs_int_point_s { - int x, y; -} gs_int_point; -typedef struct gs_rect_s { - gs_point p, q; -} gs_rect; -typedef struct gs_int_rect_s { - gs_int_point p, q; -} gs_int_rect; -typedef struct gs_state_s gs_state; -typedef struct { - proc_alloc_t alloc; - proc_free_t free; -} gs_memory_procs; -char *gs_malloc(uint, uint, const char * ); -void gs_free(char *, uint, uint, const char * ); -extern char gs_debug[128]; -extern int gs_log_error(int, const char *, int ); -typedef long fixed; -typedef struct gs_fixed_point_s { - fixed x, y; -} gs_fixed_point; -typedef struct gs_fixed_rect_s { - gs_fixed_point p, q; -} gs_fixed_rect; -typedef struct gs_matrix_s { - long _xx; float xx; long _xy; float xy; long _yx; float yx; long _yy; float yy; long _tx; float tx; long _ty; float ty; -} gs_matrix; -void gs_make_identity(gs_matrix * ); -int gs_make_translation(floatp, floatp, gs_matrix * ), - gs_make_scaling(floatp, floatp, gs_matrix * ), - gs_make_rotation(floatp, gs_matrix * ); -int gs_matrix_multiply(const gs_matrix *, const gs_matrix *, gs_matrix * ), - gs_matrix_invert(const gs_matrix *, gs_matrix * ), - gs_matrix_rotate(const gs_matrix *, floatp, gs_matrix * ); -int gs_point_transform(floatp, floatp, const gs_matrix *, gs_point * ), - gs_point_transform_inverse(floatp, floatp, const gs_matrix *, gs_point * ), - gs_distance_transform(floatp, floatp, const gs_matrix *, gs_point * ), - gs_distance_transform_inverse(floatp, floatp, const gs_matrix *, gs_point * ), - gs_bbox_transform_inverse(gs_rect *, gs_matrix *, gs_rect * ); -typedef struct gs_matrix_fixed_s { - long _xx; float xx; long _xy; float xy; long _yx; float yx; long _yy; float yy; long _tx; float tx; long _ty; float ty; - fixed tx_fixed, ty_fixed; -} gs_matrix_fixed; -extern void gs_update_matrix_fixed(gs_matrix_fixed * ); -int gs_point_transform2fixed(gs_matrix_fixed *, floatp, floatp, gs_fixed_point * ), - gs_distance_transform2fixed(gs_matrix_fixed *, floatp, floatp, gs_fixed_point * ); -typedef struct { - long xx, xy, yx, yy; - int skewed; - int shift; - int max_bits; - fixed round; -} fixed_coeff; - -typedef enum { - gs_cap_butt = 0, - gs_cap_round = 1, - gs_cap_square = 2 -} gs_line_cap; -typedef enum { - gs_join_miter = 0, - gs_join_round = 1, - gs_join_bevel = 2 -} gs_line_join; -gs_state *gs_state_alloc(proc_alloc_t, proc_free_t ); -int gs_state_free(gs_state * ); -int gs_gsave(gs_state * ), - gs_grestore(gs_state * ), - gs_grestoreall(gs_state * ); -gs_state *gs_gstate(gs_state * ); -int gs_currentgstate(gs_state * , const gs_state * ), - gs_setgstate(gs_state * , const gs_state * ); -gs_state *gs_state_swap_saved(gs_state *, gs_state * ); -void gs_state_swap(gs_state *, gs_state * ); -int gs_initgraphics(gs_state * ); -typedef struct gx_device_s gx_device; -int gs_flushpage(gs_state * ); -int gs_copypage(gs_state * ); -int gs_output_page(gs_state *, int, int ); -int gs_copyscanlines(gx_device *, int, byte *, uint, int *, uint * ); -gx_device * gs_getdevice(int ); -int gs_copydevice(gx_device **, gx_device *, proc_alloc_t ); -int gs_makeimagedevice(gx_device **, gs_matrix *, uint, uint, byte *, int, proc_alloc_t ); -void gs_nulldevice(gs_state * ); -int gs_setdevice(gs_state *, gx_device * ); -gx_device * gs_currentdevice(gs_state * ); -const char * gs_devicename(gx_device * ); -void gs_deviceinitialmatrix(gx_device *, gs_matrix * ); -int gs_closedevice(gx_device * ); -int gs_setlinewidth(gs_state *, floatp ); -float gs_currentlinewidth(const gs_state * ); -int gs_setlinecap(gs_state *, gs_line_cap ); -gs_line_cap gs_currentlinecap(const gs_state * ); -int gs_setlinejoin(gs_state *, gs_line_join ); -gs_line_join gs_currentlinejoin(const gs_state * ); -int gs_setmiterlimit(gs_state *, floatp ); -float gs_currentmiterlimit(const gs_state * ); -int gs_setdash(gs_state *, const float *, uint, floatp ); -uint gs_currentdash_length(const gs_state * ); -int gs_currentdash_pattern(const gs_state *, float * ); -float gs_currentdash_offset(const gs_state * ); -int gs_setflat(gs_state *, floatp ); -float gs_currentflat(const gs_state * ); -int gs_setstrokeadjust(gs_state *, int ); -int gs_currentstrokeadjust(const gs_state * ); -typedef enum { - gs_color_space_DeviceGray = 0, - gs_color_space_DeviceRGB, - gs_color_space_DeviceCMYK -} gs_color_space; -typedef struct gs_color_s gs_color; -extern const uint gs_color_sizeof; -int gs_setgray(gs_state *, floatp ); -float gs_currentgray(gs_state * ); -int gs_sethsbcolor(gs_state *, floatp, floatp, floatp ), - gs_currenthsbcolor(gs_state *, float [3] ), - gs_setrgbcolor(gs_state *, floatp, floatp, floatp ), - gs_currentrgbcolor(gs_state *, float [3] ); -int gs_currentcolorspace(gs_state *, gs_color_space * ); -typedef float (*gs_transfer_proc)(gs_state *, floatp ); -int gs_settransfer(gs_state *, gs_transfer_proc ), - gs_settransfer_remap(gs_state *, gs_transfer_proc, int ); -gs_transfer_proc gs_currenttransfer(gs_state * ); -int gs_setcolortransfer(gs_state *, gs_transfer_proc , - gs_transfer_proc , gs_transfer_proc , - gs_transfer_proc ), - gs_setcolortransfer_remap(gs_state *, gs_transfer_proc , - gs_transfer_proc , gs_transfer_proc , - gs_transfer_proc , int ); -void gs_currentcolortransfer(gs_state *, gs_transfer_proc [4] ); -int gs_setscreen(gs_state *, floatp, floatp, float (*)(floatp, floatp ) ); -int gs_currentscreen(gs_state *, float *, float *, float (**)(floatp, floatp ) ); -int gs_sethalftonephase(gs_state *, int, int ); -int gs_currenthalftonephase(gs_state *, gs_int_point * ); -typedef struct gs_screen_enum_s gs_screen_enum; -extern const uint gs_screen_enum_sizeof; -int gs_screen_init(gs_screen_enum *, gs_state *, floatp, floatp ); -int gs_screen_currentpoint(gs_screen_enum *, gs_point * ); -int gs_screen_next(gs_screen_enum *, floatp ); -struct gs_state_s { - gs_state *saved; - gs_memory_procs memory_procs; - gs_matrix_fixed ctm; - gs_matrix ctm_inverse; - int inverse_valid; - struct gx_path_s *path; - struct gx_clip_path_s *clip_path; - int clip_rule; - struct line_params_s *line_params; - struct halftone_params_s *halftone; - float (*ht_proc)(floatp, floatp ); - gs_int_point ht_phase; - gs_int_point phase_mod; - struct gs_color_s *color; - struct gx_device_color_s *dev_color; - struct gx_transfer_s *transfer; - struct gs_font_s *font; - gs_matrix char_tm; - int char_tm_valid; - byte in_cachedevice; - byte in_charpath; - - - - - int level; - float flatness; - int stroke_adjust; - struct device_s *device; - int device_is_shared; - -}; -typedef unsigned long gx_bitmap_id; -typedef struct gx_bitmap_s { - byte *data; - int raster; - gs_int_point size; - gx_bitmap_id id; - ushort rep_width, rep_height; -} gx_bitmap; -typedef unsigned long gx_color_index; -typedef unsigned short gx_color_value; -typedef struct gx_device_color_info_s { - int num_components; - - int depth; - gx_color_value max_gray; - gx_color_value max_rgb; - - gx_color_value dither_gray; - gx_color_value dither_rgb; - -} gx_device_color_info; -typedef struct gx_device_procs_s gx_device_procs; -struct gx_device_s { - int params_size; gx_device_procs *procs; const char *dname; int width; int height; float x_pixels_per_inch; float y_pixels_per_inch; float l_margin, b_margin, r_margin, t_margin; gx_device_color_info color_info; int is_open; -}; -typedef struct gs_prop_item_s gs_prop_item; -struct gx_device_procs_s { - int (*open_device)(gx_device *dev ); - void (*get_initial_matrix)(gx_device *dev, gs_matrix *pmat ); - int (*sync_output)(gx_device *dev ); - int (*output_page)(gx_device *dev, int num_copies, int flush ); - int (*close_device)(gx_device *dev ); - gx_color_index (*map_rgb_color)(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue ); - int (*map_color_rgb)(gx_device *dev, gx_color_index color, gx_color_value rgb[3] ); - int (*fill_rectangle)(gx_device *dev, int x, int y, int width, int height, gx_color_index color ); - int (*tile_rectangle)(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y ); - int (*copy_mono)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1 ); - int (*copy_color)(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height ); - int (*draw_line)(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color ); - int (*get_bits)(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word ); - int (*get_props)(gx_device *dev, gs_prop_item *plist ); - - int (*put_props)(gx_device *dev, gs_prop_item *plist, int count ); - -}; -extern unsigned int gx_device_bytes_per_scan_line(gx_device *dev, int pad_to_word ); -int gx_default_open_device(gx_device *dev ); -void gx_default_get_initial_matrix(gx_device *dev, gs_matrix *pmat ); -int gx_default_sync_output(gx_device *dev ); -int gx_default_output_page(gx_device *dev, int num_copies, int flush ); -int gx_default_close_device(gx_device *dev ); -gx_color_index gx_default_map_rgb_color(gx_device *dev, gx_color_value red, gx_color_value green, gx_color_value blue ); -int gx_default_map_color_rgb(gx_device *dev, gx_color_index color, gx_color_value rgb[3] ); -int gx_default_tile_rectangle(gx_device *dev, gx_bitmap *tile, int x, int y, int width, int height, gx_color_index color0, gx_color_index color1, int phase_x, int phase_y ); -int gx_default_copy_color(gx_device *dev, unsigned char *data, int data_x, int raster, gx_bitmap_id id, int x, int y, int width, int height ); -int gx_default_draw_line(gx_device *dev, int x0, int y0, int x1, int y1, gx_color_index color ); -int gx_default_get_bits(gx_device *dev, int y, unsigned char *data, unsigned int size, int pad_to_word ); -int gx_default_get_props(gx_device *dev, gs_prop_item *plist ); -int gx_default_put_props(gx_device *dev, gs_prop_item *plist, int count ); -typedef struct device_s { - gx_device *info; - int is_band_device; - gx_color_index white, black; -} device; -int gs_initmatrix(gs_state * ), - gs_defaultmatrix(const gs_state *, gs_matrix * ), - gs_currentmatrix(const gs_state *, gs_matrix * ), - gs_setmatrix(gs_state *, const gs_matrix * ), - gs_translate(gs_state *, floatp, floatp ), - gs_scale(gs_state *, floatp, floatp ), - gs_rotate(gs_state *, floatp ), - gs_concat(gs_state *, const gs_matrix * ); -int gs_transform(gs_state *, floatp, floatp, gs_point * ), - gs_dtransform(gs_state *, floatp, floatp, gs_point * ), - gs_itransform(gs_state *, floatp, floatp, gs_point * ), - gs_idtransform(gs_state *, floatp, floatp, gs_point * ); -static int -ctm_set_inverse(gs_state *pgs) -{ int code = gs_matrix_invert(&*(gs_matrix *)&(pgs)->ctm , &pgs->ctm_inverse); - 0; - if ( code < 0 ) return code; - pgs->inverse_valid = 1; - return 0; -} -void -gs_update_matrix_fixed(gs_matrix_fixed *pmat) -{ (*pmat). tx = ((float)(((*pmat). tx_fixed = ((fixed)(((*pmat). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (*pmat). ty = ((float)(((*pmat). ty_fixed = ((fixed)(((*pmat). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))); -} -int -gs_initmatrix(gs_state *pgs) -{ gx_device *dev = pgs->device->info; - (*dev->procs->get_initial_matrix)(dev, &*(gs_matrix *)&(pgs)->ctm ); - (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return 0; -} -int -gs_defaultmatrix(const gs_state *pgs, gs_matrix *pmat) -{ gx_device *dev = pgs->device->info; - (*dev->procs->get_initial_matrix)(dev, pmat); - return 0; -} -int -gs_currentmatrix(const gs_state *pgs, gs_matrix *pmat) -{ *pmat = *(gs_matrix *)&(pgs)->ctm; - return 0; -} -int -gs_setmatrix(gs_state *pgs, const gs_matrix *pmat) -{ *(gs_matrix *)&(pgs)->ctm = *pmat; - (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return 0; -} -int -gs_translate(gs_state *pgs, floatp dx, floatp dy) -{ gs_point pt; - int code; - if ( (code = gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , &pt)) < 0 ) - return code; - pgs->ctm.tx += pt.x; - pgs->ctm.ty += pt.y; - (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return 0; -} -int -gs_scale(gs_state *pgs, floatp sx, floatp sy) -{ pgs->ctm.xx *= sx; - pgs->ctm.xy *= sx; - pgs->ctm.yx *= sy; - pgs->ctm.yy *= sy; - pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return 0; -} -int -gs_rotate(gs_state *pgs, floatp ang) -{ int code = gs_matrix_rotate(&*(gs_matrix *)&(pgs)->ctm , ang, &*(gs_matrix *)&(pgs)->ctm ); - pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return code; -} -int -gs_concat(gs_state *pgs, const gs_matrix *pmat) -{ int code = gs_matrix_multiply(pmat, &*(gs_matrix *)&(pgs)->ctm , &*(gs_matrix *)&(pgs)->ctm ); - (pgs->ctm). tx = ((float)(((pgs->ctm). tx_fixed = ((fixed)(((pgs->ctm). tx)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , (pgs->ctm). ty = ((float)(((pgs->ctm). ty_fixed = ((fixed)(((pgs->ctm). ty)*(float)(1<<12 ) )) )*(1.0/(1<<12 ) ))) , pgs->inverse_valid = 0, pgs->char_tm_valid = 0; - return code; -} -int -gs_transform(gs_state *pgs, floatp x, floatp y, gs_point *pt) -{ return gs_point_transform(x, y, &*(gs_matrix *)&(pgs)->ctm , pt); -} -int -gs_dtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt) -{ return gs_distance_transform(dx, dy, &*(gs_matrix *)&(pgs)->ctm , pt); -} -int -gs_itransform(gs_state *pgs, floatp x, floatp y, gs_point *pt) -{ - - if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) - { return gs_point_transform_inverse(x, y, &*(gs_matrix *)&(pgs)->ctm , pt); - } - else - { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; - return gs_point_transform(x, y, &pgs->ctm_inverse, pt); - } -} -int -gs_idtransform(gs_state *pgs, floatp dx, floatp dy, gs_point *pt) -{ - - if ( !!(((*(long *)(&((&pgs->ctm)->xy)) | *(long *)(&( (&pgs->ctm)->yx)) ) << 1) == 0) ) - { return gs_distance_transform_inverse(dx, dy, - &*(gs_matrix *)&(pgs)->ctm , pt); - } - else - { if ( !pgs->inverse_valid ) { int code = ctm_set_inverse(pgs); if ( code < 0 ) return code; }; - return gs_distance_transform(dx, dy, &pgs->ctm_inverse, pt); - } -} -int -gs_translate_to_fixed(register gs_state *pgs, fixed px, fixed py) -{ pgs->ctm.tx = ((float)((pgs->ctm.tx_fixed = px)*(1.0/(1<<12 ) ))); - pgs->ctm.ty = ((float)((pgs->ctm.ty_fixed = py)*(1.0/(1<<12 ) ))); - pgs->inverse_valid = 0; - pgs->char_tm_valid = 1; - return 0; -} -int -gx_matrix_to_fixed_coeff(const gs_matrix *pmat, register fixed_coeff *pfc, - int max_bits) -{ gs_matrix ctm; - int scale = -10000; - int expt, shift; - ctm = *pmat; - pfc->skewed = 0; - if ( !((*(long *)(&(ctm.xx)) << 1) == 0) ) - { (void)frexp(ctm.xx, &scale); - } - if ( !((*(long *)(&(ctm.xy)) << 1) == 0) ) - { (void)frexp(ctm.xy, &expt); - if ( expt > scale ) scale = expt; - pfc->skewed = 1; - } - if ( !((*(long *)(&(ctm.yx)) << 1) == 0) ) - { (void)frexp(ctm.yx, &expt); - if ( expt > scale ) scale = expt; - pfc->skewed = 1; - } - if ( !((*(long *)(&(ctm.yy)) << 1) == 0) ) - { (void)frexp(ctm.yy, &expt); - if ( expt > scale ) scale = expt; - } - scale = sizeof(long) * 8 - 1 - max_bits - scale; - shift = scale - 12; - if ( shift > 0 ) - { pfc->shift = shift; - pfc->round = (fixed)1 << (shift - 1); - } - else - { pfc->shift = 0; - pfc->round = 0; - scale -= shift; - } - pfc->xx = (((*(long *)(&(ctm.xx)) << 1) == 0) ? 0 : (long)ldexp(ctm.xx, scale)); - pfc->yy = (((*(long *)(&(ctm.yy)) << 1) == 0) ? 0 : (long)ldexp(ctm.yy, scale)); - if ( pfc->skewed ) - { pfc->xy = (((*(long *)(&(ctm.xy)) << 1) == 0) ? 0 : (long)ldexp(ctm.xy, scale)); - pfc->yx = (((*(long *)(&(ctm.yx)) << 1) == 0) ? 0 : (long)ldexp(ctm.yx, scale)); - } - else - pfc->xy = pfc->yx = 0; - pfc->max_bits = max_bits; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-3.c b/gcc/testsuite/gcc.c-torture/compile/920428-3.c deleted file mode 100644 index 13640c98ad2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-3.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef NO_LABEL_VALUES -x(a){static void*j[]={&&l1,&&l2};goto*j[a];l1:return 0;l2:return 1;} -#else -main(){ exit (0); } -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-4.c b/gcc/testsuite/gcc.c-torture/compile/920428-4.c deleted file mode 100644 index cc5e30c2a80..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-4.c +++ /dev/null @@ -1 +0,0 @@ -x(a){struct{int p[a],i;}l;l.i;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-5.c b/gcc/testsuite/gcc.c-torture/compile/920428-5.c deleted file mode 100644 index ff313799280..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-5.c +++ /dev/null @@ -1 +0,0 @@ -typedef struct{unsigned b0:1;}*t;x(a,b)t a,b;{b->b0=a->b0;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-6.c b/gcc/testsuite/gcc.c-torture/compile/920428-6.c deleted file mode 100644 index e43af7ed3a7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-6.c +++ /dev/null @@ -1,22 +0,0 @@ -typedef struct x -{ - struct x *type; - struct x *chain; - struct x *value; -} *tree; - -int -func (new, old) - register tree new, old; -{ - if (old->type == 0 || new->type == 0) - { - register tree t = old->type; - if (t == 0) - t = new->type; - for (; t; t = t->chain ) - if (t->value) - return 1; - } - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920428-7.c b/gcc/testsuite/gcc.c-torture/compile/920428-7.c deleted file mode 100644 index 69b1d979aa9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920428-7.c +++ /dev/null @@ -1 +0,0 @@ -x(float*x){int a[4],i=0,j;for(j=0;j<2;j++){f(a[i++]);f(a[i++]);}} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-1.c b/gcc/testsuite/gcc.c-torture/compile/920501-1.c deleted file mode 100644 index 29e197341aa..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-1.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef NO_LABEL_VALUES -a(){int**b[]={&&c};c:;} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-10.c b/gcc/testsuite/gcc.c-torture/compile/920501-10.c deleted file mode 100644 index ecb5bb4151c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-10.c +++ /dev/null @@ -1 +0,0 @@ -x(y){return 8193*y;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-11.c b/gcc/testsuite/gcc.c-torture/compile/920501-11.c deleted file mode 100644 index d636357e867..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-11.c +++ /dev/null @@ -1 +0,0 @@ -typedef struct{int s;}S;foo(){int i=(int)&(S){(void*)((int)&(S){1})};} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-12.c b/gcc/testsuite/gcc.c-torture/compile/920501-12.c deleted file mode 100644 index 594e14178b9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-12.c +++ /dev/null @@ -1,5 +0,0 @@ -x(x){ return 3 + x;} -a(x){int y[994]; return 3 + x;} -b(x){int y[999]; return 2*(x + 3);} -A(x){int y[9999];return 2*(x + 3);} -B(x){int y[9949];return 3 + x;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-13.c b/gcc/testsuite/gcc.c-torture/compile/920501-13.c deleted file mode 100644 index b5a6798ecc2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-13.c +++ /dev/null @@ -1 +0,0 @@ -typedef struct{int i;}t;inline y(t u){}x(){t u;y(u);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-15.c b/gcc/testsuite/gcc.c-torture/compile/920501-15.c deleted file mode 100644 index 81fd66401d5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-15.c +++ /dev/null @@ -1 +0,0 @@ -x(a)double a;{int i;return i>a?i:i+1;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-16.c b/gcc/testsuite/gcc.c-torture/compile/920501-16.c deleted file mode 100644 index f82b7524b24..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-16.c +++ /dev/null @@ -1 +0,0 @@ -f(n){struct z{int a,b[n],c[n];};} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-17.c b/gcc/testsuite/gcc.c-torture/compile/920501-17.c deleted file mode 100644 index 05a4d408d50..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-17.c +++ /dev/null @@ -1 +0,0 @@ -x(){static const char x[]="x";char y[2];y[0]=x[1];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-18.c b/gcc/testsuite/gcc.c-torture/compile/920501-18.c deleted file mode 100644 index 70f7c0af505..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-18.c +++ /dev/null @@ -1,2 +0,0 @@ -union u{int i;float f;}; -x(p)int p;{union u x;for(x.i=0;x.i<p;x.i++)if(x.f>(float)3.0)break;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-19.c b/gcc/testsuite/gcc.c-torture/compile/920501-19.c deleted file mode 100644 index 1671cc37e68..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-19.c +++ /dev/null @@ -1 +0,0 @@ -long long x=0;y(){x=0;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-2.c b/gcc/testsuite/gcc.c-torture/compile/920501-2.c deleted file mode 100644 index 905f5ddb627..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-2.c +++ /dev/null @@ -1,11 +0,0 @@ -extern short distdata[64][64], taxidata[64][64]; -extern short PieceList[2][64]; - -int -ScoreKBNK (short int winner, short int king1, short int king2) -{ - register short s; - - s = taxidata[king1][king2] + distdata[PieceList[winner][1]][king2]; - return s; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-20.c b/gcc/testsuite/gcc.c-torture/compile/920501-20.c deleted file mode 100644 index 170d0501761..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-20.c +++ /dev/null @@ -1 +0,0 @@ -int*f(x)int*x;{if(x[4]){int h[1];if(setjmp(h))return x;}} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-21.c b/gcc/testsuite/gcc.c-torture/compile/920501-21.c deleted file mode 100644 index 4a9f05a1b20..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-21.c +++ /dev/null @@ -1,3 +0,0 @@ -typedef unsigned short t; -struct foo{t d;}; -int bar(d)t d;{struct foo u;u.d=d;return(int)(&u);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-22.c b/gcc/testsuite/gcc.c-torture/compile/920501-22.c deleted file mode 100644 index b15d7984b1b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-22.c +++ /dev/null @@ -1 +0,0 @@ -x(){int y[]={};} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-23.c b/gcc/testsuite/gcc.c-torture/compile/920501-23.c deleted file mode 100644 index 291d93e6c5d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-23.c +++ /dev/null @@ -1,16 +0,0 @@ -typedef unsigned char qi; -typedef unsigned short hi; -typedef unsigned long si; -typedef unsigned long long di; -subi(a){return 100-a;} -add(a,b){return a+b;} -mul(a){return 85*a;} -memshift(p)unsigned*p;{unsigned x;for(;;){x=*p++>>16;if(x)return x;}} -ldw(xp)si*xp;{return xp[4];} -ldws_m(xp)si*xp;{si x;do{x=xp[3];xp+=3;}while(x);} -postinc_si(p)si*p;{si x;for(;;){x=*p++;if(x)return x;}} -preinc_si(p)si*p;{si x;for(;;){x=*++p;if(x)return x;}} -postinc_di(p)di*p;{di x;for(;;){x=*p++;if(x)return x;}} -preinc_di(p)di*p;{di x;for(;;){x=*++p;if(x)return x;}} -inc_overlap(p,a)di*p;{do{p=*(di**)p;p=(di*)((int)p+4);}while(*p);} -di move_di(p,p2)di*p,*p2;{di x=p;p2=((di*)x)[1];return p2[1];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-3.c b/gcc/testsuite/gcc.c-torture/compile/920501-3.c deleted file mode 100644 index 41ef87fbf7f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-3.c +++ /dev/null @@ -1,2 +0,0 @@ -struct{long long x:24,y:40;}v; -x(){v.y=0;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-4.c b/gcc/testsuite/gcc.c-torture/compile/920501-4.c deleted file mode 100644 index 9cd2fd7bd7a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-4.c +++ /dev/null @@ -1,49 +0,0 @@ -foo () -{ - int r0[8186 ]; - int r1[2 ]; - int r2[2 ]; - int bitm0[2 ]; - int bitm1[2 ]; - int bitm2[2 ]; - - int i,j,k,m,n,m_max; - int f; - double fm,ft; - - while (1) { - - if (m%4 == 2) - ++m; - - if (m_max != 0 && m > m_max) - break; - - fm=m; - - r0[k=1]=0; - bitm0[0] = 0; - - while ( n%f == 0 ) { - while ( (ft != 0) && (ft < fm )) { - bitm1[i] = 0; - r1[i]=0; - } - - while ( r0[i] != 0 && r1[i] != 0 ) { - if ( r0[i] < r1[i] ) { - bitm2[k] = bitm0[i]; - r2[k++]=0; - } - else if ( r0[i] > r1[j] ) { - bitm2[k] = bitm1[j]; - r2[k++]=r1[j++]; - } - else { - bitm1[k] = bitm0[i]; - r2[k++]=r0[i++]; - } - } - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-6.c b/gcc/testsuite/gcc.c-torture/compile/920501-6.c deleted file mode 100644 index d0a406381ff..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-6.c +++ /dev/null @@ -1 +0,0 @@ -x(y,z)float*y;{*y=z;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-7.c b/gcc/testsuite/gcc.c-torture/compile/920501-7.c deleted file mode 100644 index aed88045e54..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-7.c +++ /dev/null @@ -1,5 +0,0 @@ -#ifndef NO_LABEL_VALUES -x(){if(&&e-&&b<0)x();b:goto*&&b;e:;} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-8.c b/gcc/testsuite/gcc.c-torture/compile/920501-8.c deleted file mode 100644 index 68e33934d21..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-8.c +++ /dev/null @@ -1 +0,0 @@ -x(int*p){int x=p;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920501-9.c b/gcc/testsuite/gcc.c-torture/compile/920501-9.c deleted file mode 100644 index 98a06000bf2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920501-9.c +++ /dev/null @@ -1 +0,0 @@ -short x(a)unsigned a;{a=32987799;return a;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920502-1.c b/gcc/testsuite/gcc.c-torture/compile/920502-1.c deleted file mode 100644 index b576c6c990c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920502-1.c +++ /dev/null @@ -1 +0,0 @@ -extern void*t[];x(i){goto*t[i];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920502-2.c b/gcc/testsuite/gcc.c-torture/compile/920502-2.c deleted file mode 100644 index d3aa1e26d81..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920502-2.c +++ /dev/null @@ -1 +0,0 @@ -x(c){1LL<<c;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920520-1.c b/gcc/testsuite/gcc.c-torture/compile/920520-1.c deleted file mode 100644 index 6b1cd7b17c4..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920520-1.c +++ /dev/null @@ -1 +0,0 @@ -f(){asm("%0"::"r"(1.5F));}g(){asm("%0"::"r"(1.5));} diff --git a/gcc/testsuite/gcc.c-torture/compile/920520-1.x b/gcc/testsuite/gcc.c-torture/compile/920520-1.x deleted file mode 100644 index 3687bf6145d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920520-1.x +++ /dev/null @@ -1,9 +0,0 @@ -set options "-S" - -# This does not work on m68hc11 due to the asm which forces a -# float or a double to go in a register. - -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"] } { - return 1 -} -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/920521-1.c b/gcc/testsuite/gcc.c-torture/compile/920521-1.c deleted file mode 100644 index 95b949798dc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920521-1.c +++ /dev/null @@ -1 +0,0 @@ -f(){asm("f":::"cc");}g(x,y){asm("g"::"%r"(x), "r"(y));} diff --git a/gcc/testsuite/gcc.c-torture/compile/920521-1.x b/gcc/testsuite/gcc.c-torture/compile/920521-1.x deleted file mode 100644 index 4cfce33b2dc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920521-1.x +++ /dev/null @@ -1,2 +0,0 @@ -set options "-S" -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/920529-1.c b/gcc/testsuite/gcc.c-torture/compile/920529-1.c deleted file mode 100644 index 0f50309a27c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920529-1.c +++ /dev/null @@ -1,21 +0,0 @@ -void -f (a, b, m, n) - unsigned short *a, *b; - int m, n; -{ - unsigned long acc; - int qn; - int j; - - abort (); - - acc = a[m - 1]; - a += 0; - for (j = qn - 1; j >= 0; j = j - 1) - { - acc = (acc << 16) | a[j]; - acc = acc % *b; - } - - return; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920608-1.c b/gcc/testsuite/gcc.c-torture/compile/920608-1.c deleted file mode 100644 index cae1978e6c0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920608-1.c +++ /dev/null @@ -1,25 +0,0 @@ -foo (p) - int *p; -{ - int x; - int a; - - a = p[0]; - x = a + 5; - a = -1; - p[0] = x - 5; - return a; -} - -bar (p) -{ - short x; - int a; - - x = ((short *) p)[1]; -#if INHIBIT_COMBINE - ((short *) p)[0] = x; -#endif - - return (x < 45); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920611-2.c b/gcc/testsuite/gcc.c-torture/compile/920611-2.c deleted file mode 100644 index e54b1cda5fc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920611-2.c +++ /dev/null @@ -1,53 +0,0 @@ -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; - -static unsigned long S[1][1]={0x00820200}; - -static int body(out0,out1,ks,Eswap0,Eswap1) -ulong *out0,*out1; -int *ks; -ulong Eswap0,Eswap1; -{ - register unsigned long l,r,t,u,v; - register unsigned long *s; - register int i,j; - register unsigned long E0,E1; - - l=0; - r=0; - - s=(ulong *)ks; - E0=Eswap0; - E1=Eswap1; - - for (i=0; i<(16 *2); i+=4) - { - v=(r^(r>>16)); - u=(v&E0); - v=(v&E1); - u=(u^(u<<16))^r^s[ i ]; - t=(v^(v<<16))^r^s[ i+1]; - t=(t>>4)|(t<<28); - l^=S[1][(t)&0x3f]| S[3][(t>> 8)&0x3f]| S[5][(t>>16)&0x3f]| S[7][(t>>24)&0x3f]| S[0][(u)&0x3f]| S[2][(u>> 8)&0x3f]| S[4][(u>>16)&0x3f]| S[6][(u>>24)&0x3f]; - v=(l^(l>>16)); - u=(v&E0); - v=(v&E1); - u=(u^(u<<16))^l^s[ i+2 ]; - t=(v^(v<<16))^l^s[ i+2+1]; - t=(t>>4)|(t<<28); - r^= S[1][(t )&0x3f]; - } - t=l; - l=r; - r=t; - - t=r; - r=(l>>1)|(l<<31); - l=(t>>1)|(t<<31); - - *out0=l; - *out1=r; - return(0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920615-1.c b/gcc/testsuite/gcc.c-torture/compile/920615-1.c deleted file mode 100644 index 9b1c6aceef3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920615-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f() -{ - int x[20] = {[0] = 5, [10] = 12}; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920617-1.c b/gcc/testsuite/gcc.c-torture/compile/920617-1.c deleted file mode 100644 index 2d84e8d84f8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920617-1.c +++ /dev/null @@ -1 +0,0 @@ -f(){double*xp,y;*xp++=sqrt(y);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920617-2.c b/gcc/testsuite/gcc.c-torture/compile/920617-2.c deleted file mode 100644 index 3a5450982c0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920617-2.c +++ /dev/null @@ -1 +0,0 @@ -f(a,b,c,d)float a[],d;int b[],c;{} diff --git a/gcc/testsuite/gcc.c-torture/compile/920623-1.c b/gcc/testsuite/gcc.c-torture/compile/920623-1.c deleted file mode 100644 index 9b6ad51e102..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920623-1.c +++ /dev/null @@ -1,2 +0,0 @@ -int f(int c){return f(c--);} -g(){} diff --git a/gcc/testsuite/gcc.c-torture/compile/920624-1.c b/gcc/testsuite/gcc.c-torture/compile/920624-1.c deleted file mode 100644 index 8b4d2979d26..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920624-1.c +++ /dev/null @@ -1,2 +0,0 @@ -int B[],Q[]; -f(){int s;for(s=0;s<=1;s++)switch(s){case 2:case 3:++B[s];case 4:case 5:++Q[s];}} diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-1.c b/gcc/testsuite/gcc.c-torture/compile/920625-1.c deleted file mode 100644 index 720d43fd42f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920625-1.c +++ /dev/null @@ -1,279 +0,0 @@ -typedef unsigned long int unsigned_word; -typedef signed long int signed_word; -typedef unsigned_word word; - -typedef enum { ADD, ADD_CI, ADD_CO, ADD_CIO, SUB, SUB_CI, SUB_CO, -SUB_CIO, ADC_CI, ADC_CO, ADC_CIO, AND, IOR, XOR, ANDC, IORC, EQV, -NAND, NOR, AND_RC, IOR_RC, XOR_RC, ANDC_RC, IORC_RC, EQV_RC, NAND_RC, -NOR_RC, AND_CC, IOR_CC, XOR_CC, ANDC_CC, IORC_CC, EQV_CC, NAND_CC, -NOR_CC, LSHIFTR, ASHIFTR, SHIFTL, LSHIFTR_CO, ASHIFTR_CO, SHIFTL_CO, -ROTATEL, ROTATEL_CO, ROTATEXL_CIO, ASHIFTR_CON, EXTS1, EXTS2, EXTU1, -EXTU2, CLZ, CTZ, FF1, FF0, ABSVAL, NABSVAL, CMP, CPEQ, CPGE, CPGEU, -CPGT, CPGTU, CPLE, CPLEU, CPLT, CPLTU, CPNEQ, CMPPAR, DOZ, COPY, -EXCHANGE, COMCY, } opcode_t; - -typedef struct -{ - opcode_t opcode:8; - unsigned int s1:8; - unsigned int s2:8; - unsigned int d:8; -} insn_t; - -enum prune_flags -{ - NO_PRUNE = 0, - CY_0 = 1, - CY_1 = 2, - CY_JUST_SET = 4, -}; - -int flag_use_carry = 1; - -inline -recurse(opcode_t opcode, - int d, - int s1, - int s2, - word v, - int cost, - insn_t *sequence, - int n_insns, - word *values, - int n_values, - const word goal_value, - int allowed_cost, - int cy, - int prune_flags) -{ - insn_t insn; - - allowed_cost -= cost; - - if (allowed_cost > 0) - { - word old_d; - - old_d = values[d]; - values[d] = v; - - insn.opcode = opcode; - insn.s1 = s1; - insn.s2 = s2; - insn.d = d; - sequence[n_insns] = insn; - - synth(sequence, n_insns + 1, values, n_values, - goal_value, allowed_cost, cy, prune_flags); - - values[d] = old_d; - } - else if (goal_value == v) - { - insn.opcode = opcode; - insn.s1 = s1; - insn.s2 = s2; - insn.d = d; - sequence[n_insns] = insn; - test_sequence(sequence, n_insns + 1); - } -} - -synth(insn_t *sequence, - int n_insns, - word *values, - int n_values, - word goal_value, - int allowed_cost, - int ci, - int prune_hint) -{ - int s1, s2; - word v, r1, r2; - int co; - int last_dest; - - if (n_insns > 0) - last_dest = sequence[n_insns - 1].d; - else - last_dest = -1; - if (ci >= 0 && flag_use_carry) - { - for (s1 = n_values - 1; s1 >= 0; s1--) - { - r1 = values[s1]; - for (s2 = s1 - 1; s2 >= 0; s2--) - { - r2 = values[s2]; - - if (allowed_cost <= 1 && (prune_hint & CY_JUST_SET) == 0) - { - if (last_dest >= 0 && s1 != last_dest && s2 != last_dest) - continue; - } - do { word __d = ( r1) + ( r2) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( r1) + ( r2) + (( ci)); ( co) = ( ci); (v) = __d; } while (0); - recurse(ADD_CI, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - do { word __d = ( r1) - ( r2) - (( ci)); ( co) = ( ci) ? __d >= ( r1) : __d > ( r1); (v) = __d; } while (0); - recurse(SUB_CIO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( r2) - ( r1) - (( ci)); ( co) = ( ci) ? __d >= ( r2) : __d > ( r2); (v) = __d; } while (0); - recurse(SUB_CIO, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - do { word __d = ( r1) - ( r2) - (( ci)); ( co) = ( ci); (v) = __d; } while (0); - recurse(SUB_CI, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - do { word __d = ( r2) - ( r1) - (( ci)); ( co) = ( ci); (v) = __d; } while (0); - recurse(SUB_CI, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - } - } - } - for (s1 = n_values - 1; s1 >= 0; s1--) - { - r1 = values[s1]; - for (s2 = s1 - 1; s2 >= 0; s2--) - { - r2 = values[s2]; - - if (allowed_cost <= 1) - { - if (last_dest >= 0 && s1 != last_dest && s2 != last_dest) - continue; - } - - do { word __d = ( r1) + ( r2); ( co) = __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - ((v) = ( r1) + ( r2), ( co) = ( ci)); - recurse(ADD, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - do { word __d = ( r1) - ( r2); ( co) = __d > ( r1); (v) = __d; } while (0); - recurse(SUB_CO, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( r2) - ( r1); ( co) = __d > ( r2); (v) = __d; } while (0); - recurse(SUB_CO, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - ((v) = ( r1) - ( r2), ( co) = ( ci)); - recurse(SUB, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ( r2) - ( r1), ( co) = ( ci)); - recurse(SUB, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( r1) & ( r2), ( co) = ( ci)); - recurse(AND, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( r1) | ( r2), ( co) = ( ci)); - recurse(IOR, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( r1) ^ ( r2), ( co) = ( ci)); - recurse(XOR, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( r1) & ~( r2), ( co) = ( ci)); - recurse(ANDC, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ( r2) & ~( r1), ( co) = ( ci)); - recurse(ANDC, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ( r1) | ~( r2), ( co) = ( ci)); - recurse(IORC, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ( r2) | ~( r1), ( co) = ( ci)); - recurse(IORC, n_values, s2, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ( r1) ^ ~( r2), ( co) = ( ci)); - recurse(EQV, n_values, s1, s2, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - } - } - if (ci >= 0 && flag_use_carry) - { - for (s1 = n_values - 1; s1 >= 0; s1--) - { - r1 = values[s1]; - - if (allowed_cost <= 1 && (prune_hint & CY_JUST_SET) == 0) - { - - if (last_dest >= 0 && s1 != last_dest) - continue; - } - - do { word __d = ( r1) + ( r1) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - do { word __d = ( r1) + ( r1) + (( ci)); ( co) = ( ci); (v) = __d; } while (0); - recurse(ADD_CI, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - do { word __d = ( r1) + ( -1 ) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, s1, (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - do { word __d = ( r1) + ( 0 ) + (( ci)); ( co) = ( ci) ? __d <= ( r1) : __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, s1, (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( 0 ) - ( r1) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); - recurse(SUB_CIO, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - } - } - for (s1 = n_values - 1; s1 >= 0; s1--) - { - r1 = values[s1]; - - if (allowed_cost <= 1) - { - if (last_dest >= 0 && s1 != last_dest) - continue; - } - do { word __d = ( r1) + ( r1); ( co) = __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CO, n_values, s1, s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - - ((v) = ( r1) & ( 1 ), ( co) = ( ci)); - recurse(AND, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( r1) ^ ( 1 ), ( co) = ( ci)); - recurse(XOR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( -1 ) - ( r1), ( co) = ( ci)); - recurse(SUB, n_values, (0x20 + -1) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - do { word __d = ( r1) + ( 1 ); ( co) = __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CO, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - ((v) = ( r1) + ( 1 ), ( co) = ( ci)); - recurse(ADD, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - do { word __d = ( r1) + ( -1 ); ( co) = __d < ( r1); (v) = __d; } while (0); - recurse(ADD_CO, n_values, s1, (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( r1) - ( 1 ); ( co) = __d > ( r1); (v) = __d; } while (0); - recurse(SUB_CO, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - do { word __d = ( 0 ) - ( r1); ( co) = __d > ( 0 ); (v) = __d; } while (0); - recurse(SUB_CO, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET); - ((v) = ( 0 ) - ( r1), ( co) = ( ci)); - recurse(SUB, n_values, (0x20 + 0) , s1, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ((unsigned_word) ( r1) >> (( 1 ) & (32 - 1)) ), ( co) = ( ci)); - recurse(LSHIFTR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ((signed_word) ( r1) >> (( 1 ) & (32 - 1)) ), ( co) = ( ci)); - recurse(ASHIFTR, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ((signed_word) ( r1) << (( 1 ) & (32 - 1)) ), ( co) = ( ci)); - recurse(SHIFTL, n_values, s1, (0x20 + 1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ((unsigned_word) ( r1) >> (( 32 -1 ) & (32 - 1)) ), ( co) = ( ci)); - recurse(LSHIFTR, n_values, s1, (0x20 + 32 -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - ((v) = ((signed_word) ( r1) >> (( 32 -1 ) & (32 - 1)) ), ( co) = ( ci)); - recurse(ASHIFTR, n_values, s1, (0x20 + 32 -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - } - if (ci >= 0 && flag_use_carry - && (allowed_cost <= 1 ? ((prune_hint & CY_JUST_SET) != 0) : 1)) - { - do { word __d = ( 0 ) + ( 0 ) + (( ci)); ( co) = ( ci) ? __d <= ( 0 ) : __d < ( 0 ); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, (0x20 + 0) , (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET | CY_0); - do { word __d = ( 0 ) - ( 0 ) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); - recurse(SUB_CIO, n_values, (0x20 + 0) , (0x20 + 0) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - do { word __d = ( 0 ) - ( -1 ) - (( ci)); ( co) = ( ci) ? __d >= ( 0 ) : __d > ( 0 ); (v) = __d; } while (0); - recurse(SUB_CIO, n_values, (0x20 + 0) , (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, CY_JUST_SET | CY_1); - do { word __d = ( 0 ) + ( -1 ) + (( ci)); ( co) = ( ci) ? __d <= ( 0 ) : __d < ( 0 ); (v) = __d; } while (0); - recurse(ADD_CIO, n_values, (0x20 + 0) , (0x20 + -1) , v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - } - - if (allowed_cost > 1) - { - ((v) = ( 0x80000000 ), ( co) = ( ci)); - recurse(COPY, n_values, (0x20 - 2) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( -1 ), ( co) = ( ci)); - recurse(COPY, n_values, (0x20 + -1) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - - ((v) = ( 1 ), ( co) = ( ci)); - recurse(COPY, n_values, (0x20 + 1) , 0, v, 1, sequence, n_insns, values, n_values + 1, goal_value, allowed_cost, co, prune_hint & ~CY_JUST_SET); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-1.x b/gcc/testsuite/gcc.c-torture/compile/920625-1.x deleted file mode 100644 index 08a5f6771c7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920625-1.x +++ /dev/null @@ -1,25 +0,0 @@ -# The problem on IA-64 is that if-conversion creates a sequence -# -# (p17) cmp.geu p6, p7 = r48, r15 -# (p16) cmp.gtu p6, p7 = r48, r15 -# -# where p16 and p17 are complemenary, but the assembler DV validation -# code doesn't recognize that p6 and p7 are complimentary, and so -# we end up warning for a later use -# -# (p6) addl r14 = 1, r0 -# (p7) mov r14 = r0 -# -# that appears to be a WAW violation. - -set torture_eval_before_compile { - - set compiler_conditional_xfail_data { - "missing .pred.rel.mutex directive" \ - "ia64-*-*" \ - { "-O1" "-O2" "-O3" "-Os" } \ - { "" } - } -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-2.c b/gcc/testsuite/gcc.c-torture/compile/920625-2.c deleted file mode 100644 index 1466285f88e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920625-2.c +++ /dev/null @@ -1,103 +0,0 @@ -typedef char * caddr_t; -typedef unsigned Cursor; -typedef char *String; -typedef struct _WidgetRec *Widget; -typedef char Boolean; -typedef unsigned int Cardinal; -typedef struct _XedwListReturnStruct { - String string; - int xedwList_index; - struct _XedwListReturnStruct *next; -} XedwListReturnStruct; -static XedwListReturnStruct *return_list; -static String srcdir, dstdir; -char *strcpy(); - extern void setCursor(Cursor); - extern void query_dialog(String, Boolean); - extern Boolean directoryManagerNewDirectory(String); -trashQueryResult(Widget w, Boolean delete, caddr_t call_data) -{ - int execute(String, String, String, Boolean); - extern void destroy_button_dialog(void); - extern void changestate(Boolean); - - extern Cursor busy, left_ptr; - extern String cwd; - static void freeReturnStruct(void); - String rmstring; - int status; - XedwListReturnStruct *tmp; - setCursor(busy); - destroy_button_dialog(); - if (delete == 1) { - rmstring = (("rm -fr") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("rm -fr") + 1), "rm -fr")) : ((void *)0)); - tmp = return_list; - while (tmp != ((void *)0)) { - rmstring = (String) XtRealloc (rmstring, sizeof(char) * - (strlen(rmstring) + - strlen(tmp->string) + 5)); - sprintf(rmstring, "%s '%s'", rmstring, tmp->string); - tmp = tmp->next; - } - if ((status = execute(((void *)0), "rm", rmstring, 1)) != 0) { - XBell(XtDisplay(w), 100); - query_dialog("Can't remove file", 0); - } - XtFree(rmstring); - - directoryManagerNewDirectory(cwd); - } else { - changestate(1); - } - setCursor(left_ptr); - freeReturnStruct(); -} - -copyQueryResult(Widget w, Boolean copy, caddr_t call_data) -{ - extern void destroy_button_dialog(); - extern void changestate(Boolean); - extern Cursor busy, left_ptr; - static void freeReturnStruct(void); - int execute(String, String, String, Boolean); - extern String cwd; - String copystring; - int status; - Cardinal srclen, dstlen; - XedwListReturnStruct *tmp; - destroy_button_dialog(); - setCursor(busy); - if (copy == 1) { - srclen = strlen(srcdir); - dstlen = strlen(dstdir); - copystring = (("cp -r") != ((void *)0) ? (strcpy((char*)XtMalloc((unsigned)strlen("cp -r") + 1), "cp -r")) : ((void *)0)); - tmp = return_list; - while (tmp != ((void *)0)) { - copystring = (String) XtRealloc (copystring, sizeof(char) * - (strlen(copystring) + - strlen(tmp->string) + - srclen + 6)); - sprintf(copystring, "%s '%s/%s'", copystring, srcdir, tmp->string); - tmp = tmp->next; - } - copystring = (String) XtRealloc (copystring, sizeof(char) * - (strlen(copystring) + - dstlen + 5)); - sprintf(copystring, "%s '%s'", copystring, dstdir); - if ((status = execute(((void *)0), "cp", copystring, 1)) != 0) { - XBell(XtDisplay(w), 100); - query_dialog("Can't copy file!", 0); - } - XtFree(copystring); - - directoryManagerNewDirectory(cwd); - } else { - changestate(1); - } - XtFree(srcdir); - XtFree(dstdir); - setCursor(left_ptr); - freeReturnStruct(); -} - -freeReturnStruct(){} diff --git a/gcc/testsuite/gcc.c-torture/compile/920626-1.c b/gcc/testsuite/gcc.c-torture/compile/920626-1.c deleted file mode 100644 index 54419866a1f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920626-1.c +++ /dev/null @@ -1 +0,0 @@ -f(x)unsigned x;{return x>>-5;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920701-1.c b/gcc/testsuite/gcc.c-torture/compile/920701-1.c deleted file mode 100644 index 4302f9ea331..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920701-1.c +++ /dev/null @@ -1 +0,0 @@ -f(char*c){extern char a[],b[];return a+(b-c);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920702-1.c b/gcc/testsuite/gcc.c-torture/compile/920702-1.c deleted file mode 100644 index 23a5395b0cd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920702-1.c +++ /dev/null @@ -1,10 +0,0 @@ -int somevar; -void -yylex () -{ - register int result = 0; - int num_bits = -1; - - if (((result >> -1) & 1)) - somevar = 99; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920706-1.c b/gcc/testsuite/gcc.c-torture/compile/920706-1.c deleted file mode 100644 index 13b0ff1e0ba..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920706-1.c +++ /dev/null @@ -1 +0,0 @@ -f(){float i[2],o[1];g(o);return*o;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920710-2.c b/gcc/testsuite/gcc.c-torture/compile/920710-2.c deleted file mode 100644 index dcaf1bea3cf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920710-2.c +++ /dev/null @@ -1,36 +0,0 @@ -union u -{ - struct {unsigned h, l;} i; - double d; -}; - -foo (union u x) -{ - while (x.i.h++) - { - while (x.i.l-- > 0) - ; - while (x.d++ > 0) - ; - } -} - -union n -{ - long long unsigned i; - double d; -}; - -bar (union n x) -{ - int i; - for (i = 0; i < 100; i++) - { - while (--x.i > 0) - ; - while (++x.d > 0) - ; - } - return x.i; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/920711-1.c b/gcc/testsuite/gcc.c-torture/compile/920711-1.c deleted file mode 100644 index a5aa7df1127..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920711-1.c +++ /dev/null @@ -1 +0,0 @@ -f(a){a=(1,1)/2;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920721-1.c b/gcc/testsuite/gcc.c-torture/compile/920721-1.c deleted file mode 100644 index 7ced611eb6f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920721-1.c +++ /dev/null @@ -1,11 +0,0 @@ -typedef struct{short ttype;float s;}T; -short t[8][8]; - -T f(T t2,T t1) -{ - T x; - if (t1.ttype == 1) - x.ttype = t[t2.ttype][t1.ttype], - x.s = 1; - return x; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920723-1.c b/gcc/testsuite/gcc.c-torture/compile/920723-1.c deleted file mode 100644 index d8734a6796e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920723-1.c +++ /dev/null @@ -1,31 +0,0 @@ -#if defined(STACK_SIZE) && STACK_SIZE < 65536 -# define GITT_SIZE 75 -#endif - -#ifndef GITT_SIZE -# define GITT_SIZE 150 -#endif - -typedef struct { - double x, y; -} vector_t; -double sqrt(); -f(int count,vector_t*pos,double r,double *rho) -{ - int i, j, miny, maxy, hy; - float help, d; - int gitt[GITT_SIZE][GITT_SIZE]; - int *data = (int *)malloc(count*sizeof(int)); - for (i = 0; i < count; i++) - rho[i] = 0; - for (i = 1; i < count; i++) - for (hy = miny; hy<= maxy; hy++) - while(j >=0) { - d = pos[i].y - pos[j].y; - if ( d <= r) { - d = sqrt(d); - rho[i] += help; - } - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/920729-1.c b/gcc/testsuite/gcc.c-torture/compile/920729-1.c deleted file mode 100644 index de00be5af88..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920729-1.c +++ /dev/null @@ -1,2 +0,0 @@ -extern volatile int i; -f(){int j;for(;;)j = i;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920806-1.c b/gcc/testsuite/gcc.c-torture/compile/920806-1.c deleted file mode 100644 index 0928fe8a784..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920806-1.c +++ /dev/null @@ -1 +0,0 @@ -f(){short x=32000;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920808-1.c b/gcc/testsuite/gcc.c-torture/compile/920808-1.c deleted file mode 100644 index 17510a96821..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920808-1.c +++ /dev/null @@ -1 +0,0 @@ -f(i){for(i=1;i<=2;({;}),i++){({;}),g();}} diff --git a/gcc/testsuite/gcc.c-torture/compile/920809-1.c b/gcc/testsuite/gcc.c-torture/compile/920809-1.c deleted file mode 100644 index ad35e121003..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920809-1.c +++ /dev/null @@ -1 +0,0 @@ -f(x,y){memcpy (&x,&y,8192);} diff --git a/gcc/testsuite/gcc.c-torture/compile/920817-1.c b/gcc/testsuite/gcc.c-torture/compile/920817-1.c deleted file mode 100644 index 31a57339ea9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920817-1.c +++ /dev/null @@ -1 +0,0 @@ -int v;static inline f(){return 0;}g(){return f();}void h(){return v++;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920820-1.c b/gcc/testsuite/gcc.c-torture/compile/920820-1.c deleted file mode 100644 index 2bc0dbea07b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920820-1.c +++ /dev/null @@ -1 +0,0 @@ -long long f(double y){return y;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920821-1.c b/gcc/testsuite/gcc.c-torture/compile/920821-1.c deleted file mode 100644 index 40a8c178f10..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920821-1.c +++ /dev/null @@ -1 +0,0 @@ -/* empty */ diff --git a/gcc/testsuite/gcc.c-torture/compile/920821-2.c b/gcc/testsuite/gcc.c-torture/compile/920821-2.c deleted file mode 100644 index a69c0a901ba..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920821-2.c +++ /dev/null @@ -1,4 +0,0 @@ -typedef struct{int p[25];}t1; -struct{t1 x,y;}y; -t1 x[1]; -f(){y.x=*x;y.y=*x;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920825-1.c b/gcc/testsuite/gcc.c-torture/compile/920825-1.c deleted file mode 100644 index 514d63f977f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920825-1.c +++ /dev/null @@ -1,3 +0,0 @@ -#pragma pack(1) -struct{unsigned short f1:5;unsigned short f2:6;}x; -f(){x.f2=1;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920825-2.c b/gcc/testsuite/gcc.c-torture/compile/920825-2.c deleted file mode 100644 index 9834aac1783..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920825-2.c +++ /dev/null @@ -1,3 +0,0 @@ -f(double*a,int m){int j;for(j=0;j<m;j++)a[j]=1;} -g(double*a){int j;for(j=0;j<4;j++)a[j]=1;} - diff --git a/gcc/testsuite/gcc.c-torture/compile/920826-1.c b/gcc/testsuite/gcc.c-torture/compile/920826-1.c deleted file mode 100644 index d19eff2cec6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920826-1.c +++ /dev/null @@ -1 +0,0 @@ -f(int*x){goto*(char)*x;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920828-1.c b/gcc/testsuite/gcc.c-torture/compile/920828-1.c deleted file mode 100644 index 4893173423b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920828-1.c +++ /dev/null @@ -1 +0,0 @@ -char a[]={4,5};f(n){return a[n<2?n:0];} diff --git a/gcc/testsuite/gcc.c-torture/compile/920829-1.c b/gcc/testsuite/gcc.c-torture/compile/920829-1.c deleted file mode 100644 index 593400bac92..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920829-1.c +++ /dev/null @@ -1 +0,0 @@ -f(double x){double y;y=x/0.5;if(y<0.1)y=1.0;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920831-1.c b/gcc/testsuite/gcc.c-torture/compile/920831-1.c deleted file mode 100644 index ff2fd6360bf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920831-1.c +++ /dev/null @@ -1 +0,0 @@ -f(x){goto*(char)x;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920902-1.c b/gcc/testsuite/gcc.c-torture/compile/920902-1.c deleted file mode 100644 index 6f6dcd5bf30..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920902-1.c +++ /dev/null @@ -1,2 +0,0 @@ -void f(int); -void f(x)unsigned char x;{} diff --git a/gcc/testsuite/gcc.c-torture/compile/920909-1.c b/gcc/testsuite/gcc.c-torture/compile/920909-1.c deleted file mode 100644 index 939aaf789e8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920909-1.c +++ /dev/null @@ -1 +0,0 @@ -long long f(long long a,long long b){return a<<b;} diff --git a/gcc/testsuite/gcc.c-torture/compile/920917-1.c b/gcc/testsuite/gcc.c-torture/compile/920917-1.c deleted file mode 100644 index ebe8200d48b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920917-1.c +++ /dev/null @@ -1,2 +0,0 @@ -inline f(x){switch(x){case 6:case 4:case 3:case 1:;}return x;} -g(){f(sizeof("xxxxxx"));} diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-1.c b/gcc/testsuite/gcc.c-torture/compile/920928-1.c deleted file mode 100644 index 137363dc120..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-1.c +++ /dev/null @@ -1,2 +0,0 @@ -struct{int c;}v; -static long i=((char*)&(v.c)-(char*)&v); diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-2.c b/gcc/testsuite/gcc.c-torture/compile/920928-2.c deleted file mode 100644 index a0964f90f44..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-2.c +++ /dev/null @@ -1,19 +0,0 @@ -typedef struct{struct{char*d;int b;}*i;}*t; -double f(); -g(p)t p; -{ - short x,y,delta,s,w,h,fx,fy,tx,ty; - int q1,q2,q3,q4; - h=f((ty-fy)/2.0+0.5); - s=(((int)((short)(tx-fx))<(int)((short)(ty-fy)))?((short)(tx-fx)):((short)(ty-fy)))%2; - delta=(((int)(w)<(int)(h))?(w):(h))-s; - for(x=0;x<=delta;x++) - for(y=1-s;y<=delta;y++){ - q1=((int)((*(p->i->d+(fx+w+x)/8+(fy+h+y)*p->i->b)&(1<<((fx+w+x)%8)))?1:0)); - q2=((int)((*(p->i->d+(fx+w+y)/8+(fy+h-s-x)*p->i->b)&(1<<((fx+w+y)%8)))?1:0)); - q3=((int)((*(p->i->d+(fx+w-s-x)/8+(fy+h-s-y)*p->i->b)&(1<<((fx+w-s-x)%8)))?1:0)); - q4=((int)((*(p->i->d+(fx+w-s-y)/8+(fy+h+x)*p->i->b)&(1<<((fx+w-s-y)%8)))?1:0)); - if(q4!=q1) - ff(p,fx+w-s-y,fy+h+x); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-3.c b/gcc/testsuite/gcc.c-torture/compile/920928-3.c deleted file mode 100644 index 583dc69b74c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-3.c +++ /dev/null @@ -1,19 +0,0 @@ -f (int phaseone) -{ - typedef struct - { - unsigned char *p; - } - FILE; - FILE b[2]; - static unsigned char xchr[2]; - int j; - int for_end; - if (phaseone) - { - if (j <= for_end) - do - *(b[1].p) = xchr[j]; - while (j++ < 10); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-4.c b/gcc/testsuite/gcc.c-torture/compile/920928-4.c deleted file mode 100644 index 348de654f30..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-4.c +++ /dev/null @@ -1,113 +0,0 @@ -typedef unsigned char unsigned8; -typedef unsigned short int unsigned16; -typedef unsigned long int unsigned32; -typedef char signed8; -typedef short int signed16; -typedef long int signed32; -typedef unsigned32 boolean32; -typedef unsigned long int error_status_t; -typedef struct { - unsigned32 time_low; - unsigned16 time_mid; - unsigned16 time_hi_and_version; - unsigned8 clock_seq_hi_and_reserved; - unsigned8 clock_seq_low; - unsigned char node[6]; -} uuid_t; - -typedef unsigned32 bitset; -typedef signed32 sec_timeval_sec_t; -typedef struct { - signed32 sec; - signed32 usec; -} sec_timeval_t; -typedef signed32 sec_timeval_period_t; -typedef signed32 sec_rgy_acct_key_t; - -typedef struct { - uuid_t source; - signed32 handle; - boolean32 valid; -} sec_rgy_cursor_t; -typedef unsigned char sec_rgy_pname_t[257]; -typedef unsigned char sec_rgy_name_t[1025]; - -typedef signed32 sec_rgy_override_t; -typedef signed32 sec_rgy_mode_resolve_t; -typedef unsigned char sec_rgy_unix_gecos_t[292]; -typedef unsigned char sec_rgy_unix_login_name_t[1025]; -typedef unsigned char sec_rgy_member_t[1025]; -typedef unsigned char sec_rgy_unix_passwd_buf_t[16]; -typedef struct sec_rgy_sid_t { - uuid_t person; - uuid_t group; - uuid_t org; -} sec_rgy_sid_t; -typedef struct { - signed32 person; - signed32 group; - signed32 org; -} sec_rgy_unix_sid_t; -typedef struct { - sec_rgy_unix_login_name_t name; - sec_rgy_unix_passwd_buf_t passwd; - signed32 uid; - signed32 gid; - signed32 oid; - sec_rgy_unix_gecos_t gecos; - sec_rgy_pname_t homedir; - sec_rgy_pname_t shell; -} sec_rgy_unix_passwd_t; -typedef unsigned char sec_rgy_member_buf_t[10250]; -typedef struct { - sec_rgy_name_t name; - signed32 gid; - sec_rgy_member_buf_t members; -} sec_rgy_unix_group_t; - -typedef struct { - uuid_t site_id; - sec_timeval_sec_t person_dtm; - sec_timeval_sec_t group_dtm; - sec_timeval_sec_t org_dtm; -} rs_cache_data_t; - -typedef enum { - rs_unix_query_name, - rs_unix_query_unix_num, - rs_unix_query_none -} rs_unix_query_t; - -typedef struct { - rs_unix_query_t query; - union { - struct { - long int name_len; - sec_rgy_name_t name; - } name; - long int unix_num; - } tagged_union; -} rs_unix_query_key_t; - -static unsigned long int IDL_offset_vec[] = -{ - 0, - sizeof(sec_rgy_unix_group_t), - (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->name - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->gid - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_unix_group_t *) 0)->members - (unsigned char *) 0), - sizeof(rs_cache_data_t), - (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_low - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_mid - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((rs_cache_data_t *) 0)->site_id.time_hi_and_version - (unsigned char *) 0), - sizeof(sec_rgy_unix_passwd_t), - (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.clock_seq_hi_and_reserved - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.clock_seq_low - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->source.node - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->handle - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((sec_rgy_cursor_t *) 0)->valid - (unsigned char *) 0), - sizeof(struct {long int name_len; sec_rgy_name_t name;}), - (unsigned long int) ((unsigned char *) &((struct {long int name_len; sec_rgy_name_t name;} *)0)->name_len - - (unsigned char *) 0), - (unsigned long int) ((unsigned char *) &((struct {long int name_len; sec_rgy_name_t name;} *)0)->name - (unsigned char *) 0), -}; diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-5.c b/gcc/testsuite/gcc.c-torture/compile/920928-5.c deleted file mode 100644 index 8c975f0c051..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-5.c +++ /dev/null @@ -1,7 +0,0 @@ -/* REPRODUCED:CC1:SIGNAL MACHINE:m68k OPTIONS:-fpcc-struct-return */ -struct b{}; -f(struct b(*f)()) -{ -struct b d=f(); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/920928-6.c b/gcc/testsuite/gcc.c-torture/compile/920928-6.c deleted file mode 100644 index 692191b1245..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/920928-6.c +++ /dev/null @@ -1,2 +0,0 @@ -struct{int c;}v; -static short i=((char*)&(v.c)-(char*)&v); diff --git a/gcc/testsuite/gcc.c-torture/compile/921004-1.c b/gcc/testsuite/gcc.c-torture/compile/921004-1.c deleted file mode 100644 index a947229089f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921004-1.c +++ /dev/null @@ -1,6 +0,0 @@ -/* REPRODUCED:CC1:SIGNAL MACHINE:i386 OPTIONS: */ -long long f() -{ -long long*g,*s; -return*g+*s; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921011-1.c b/gcc/testsuite/gcc.c-torture/compile/921011-1.c deleted file mode 100644 index 6cc707dc74c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921011-1.c +++ /dev/null @@ -1,27 +0,0 @@ -void -fun (nb) - int nb; -{ - int th, h, em, nlwm, nlwS, nlw, sy; - - while (nb--) - while (h--) - { - nlw = nlwm; - while (nlw) - { - if (nlwS == 1) - { - } - else - if (nlwS == 1) - { - } - nlwS--; nlw--; - } - if (em) - nlwS--; - if (++sy == th) - sy = 0; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921011-2.c b/gcc/testsuite/gcc.c-torture/compile/921011-2.c deleted file mode 100644 index bf11dad979f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921011-2.c +++ /dev/null @@ -1,65 +0,0 @@ -extern int foobar1 (); - -typedef struct - { - unsigned long colormap; - unsigned long red_max; - unsigned long red_mult; - unsigned long green_max; - unsigned long green_mult; - unsigned long blue_max; - unsigned long blue_mult; - unsigned long base_pixel; - unsigned long visualid; - unsigned long killid; - } -frotz; - -int -foobar (stdcmap, count) - frotz **stdcmap; - int *count; -{ - register int i; - frotz *data = ((void *) 0); - - unsigned long nitems; - int ncmaps; - int old_style = 0; - unsigned long def_visual = 0L; - frotz *cmaps; - - - if ( foobar1 (&data) != 0) - return 0; - if (nitems < 10) - { - ncmaps = 1; - if (nitems < 9) - { - } - } - else - ncmaps = (nitems / 10); - - { - register frotz *map; - register frotz *prop; - - for (i = ncmaps, map = cmaps, prop = data; i > 0; i--, map++, prop++) - { - map->colormap = prop->colormap; - map->red_max = prop->red_max; - map->red_mult = prop->red_mult; - map->green_max = prop->green_max; - map->green_mult = prop->green_mult; - map->blue_max = prop->blue_max; - map->blue_mult = prop->blue_mult; - map->base_pixel = prop->base_pixel; - map->visualid = (def_visual ? def_visual : prop->visualid); - map->killid = (old_style ? 0L : prop->killid); - } - } - *stdcmap = cmaps; - *count = ncmaps; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921012-1.c b/gcc/testsuite/gcc.c-torture/compile/921012-1.c deleted file mode 100644 index 7b5cb6b9f17..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921012-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f() -{ -g(({int x;0;})); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921012-2.c b/gcc/testsuite/gcc.c-torture/compile/921012-2.c deleted file mode 100644 index 6f4de779549..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921012-2.c +++ /dev/null @@ -1,7 +0,0 @@ -struct foo { -int a,b,c; -}; -f(struct foo*a,struct foo*b) -{ -*a=*b; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921013-1.c b/gcc/testsuite/gcc.c-torture/compile/921013-1.c deleted file mode 100644 index 0d14cbc6bb6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921013-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f(int x,short y) -{ -long z=y<0?x>0?x:0:y; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921019-1.c b/gcc/testsuite/gcc.c-torture/compile/921019-1.c deleted file mode 100644 index 227bdc276fa..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921019-1.c +++ /dev/null @@ -1,9 +0,0 @@ -struct -{ -int n:1,c:1; -}p; - -f() -{ -p.c=p.n=0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921021-1.c b/gcc/testsuite/gcc.c-torture/compile/921021-1.c deleted file mode 100644 index 18dffeb9dd3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921021-1.c +++ /dev/null @@ -1,12 +0,0 @@ -void g(); - -f() -{ -int x=1; -while(x) -{ -x=h(); -if(x) -g(); -} -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921024-1.c b/gcc/testsuite/gcc.c-torture/compile/921024-1.c deleted file mode 100644 index e723246d6b2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921024-1.c +++ /dev/null @@ -1,9 +0,0 @@ -long long f(s,r) -{ - return *(long long*)(s+r); -} - -g(s,r) -{ - *(long long*)(s+r)=0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921026-1.c b/gcc/testsuite/gcc.c-torture/compile/921026-1.c deleted file mode 100644 index 18238de8332..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921026-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f(unsigned short*a) -{ -a[0]=65535; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921103-1.c b/gcc/testsuite/gcc.c-torture/compile/921103-1.c deleted file mode 100644 index 578e91aaf83..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921103-1.c +++ /dev/null @@ -1,12 +0,0 @@ -struct { - unsigned int f1, f2; -} s; - -f() -{ - unsigned x, y; - x = y = 0; - while (y % 4) - y++; - g(&s.f2, s.f1 + x, 4); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921109-1.c b/gcc/testsuite/gcc.c-torture/compile/921109-1.c deleted file mode 100644 index eda43451f25..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921109-1.c +++ /dev/null @@ -1,28 +0,0 @@ -typedef struct { double x, y; } p; -typedef struct { int s; float r; } t; -t *e, i; -int i1; - -f(t *op) -{ -int i2 = e->r; -p pt; -int c = g(); -t p; - -if (c) -{ -i = *e; -e -= 3; -return 8; -} -if (op > e) -return 1; -op->r = pt.x; -op->r = pt.y; -p = *e; -++e; -e->r = i1, e->s = i1; -*++e = p; -return 3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921111-1.c b/gcc/testsuite/gcc.c-torture/compile/921111-1.c deleted file mode 100644 index 11b467460b3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921111-1.c +++ /dev/null @@ -1,40 +0,0 @@ -int ps; -struct vp { - int wa; -}; -typedef struct vp *vpt; -typedef struct vc { - int o; - vpt py[8]; -} *vct; -struct n { - int a; -}; -struct nh { - int x; -}; -typedef struct np *npt; -struct np { - vct d; - int di; -}; -struct nh xhp; -struct n np[3]; - -f(dp) - npt dp; -{ - vpt *py; - int a, l, o = 0; - a = dp->d->o; - if (dp->di < 0) - l = ps; - - if ((int)o & 3) - g(); - - xhp.x = a; - py = &dp->d->py[dp->di]; - if (o + l > ps) - np[2].a = (int)(py[1])->wa; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921116-2.c b/gcc/testsuite/gcc.c-torture/compile/921116-2.c deleted file mode 100644 index 9eac91cb5c2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921116-2.c +++ /dev/null @@ -1,9 +0,0 @@ -typedef struct { - long l[5]; -} t; - -f(size) -{ - t event; - g(&(event.l[2 + size]), (3 - size) * 4); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921118-1.c b/gcc/testsuite/gcc.c-torture/compile/921118-1.c deleted file mode 100644 index 857c74e74f1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921118-1.c +++ /dev/null @@ -1,8 +0,0 @@ -inline f(i) -{ - h((long long) i * 2); -} -g() -{ - f(9); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921126-1.c b/gcc/testsuite/gcc.c-torture/compile/921126-1.c deleted file mode 100644 index a7b908b2ef0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921126-1.c +++ /dev/null @@ -1,11 +0,0 @@ -f() -{ - long long a0, a1, a0s, val; - int width; - float d; - if (d) - ; - if (a0s & (1LL << width)) - ; - return a0 / a1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921202-1.c b/gcc/testsuite/gcc.c-torture/compile/921202-1.c deleted file mode 100644 index 1287edc57b8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921202-1.c +++ /dev/null @@ -1,22 +0,0 @@ -f () -{ - long dx[2055]; - long dy[2055]; - long s1[2055]; - int x, y; - int i; - long s; - - for (;;) - { - s = 2055; - g (s1, s); - for (i = 0; i < 1; i++); - dy[s] = 0x12345; - for (i = 0; i < 1; i++); - if (x != y || h (dx, dy, s) || dx[s] != 0x12345) - { - j (y);k (dy); - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921202-2.c b/gcc/testsuite/gcc.c-torture/compile/921202-2.c deleted file mode 100644 index 97d482b633c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921202-2.c +++ /dev/null @@ -1,8 +0,0 @@ -f(x, c) -{ - for (;;) - { - if (x << c) break; - x++; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921203-1.c b/gcc/testsuite/gcc.c-torture/compile/921203-1.c deleted file mode 100644 index 50fe3eb0b6f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921203-1.c +++ /dev/null @@ -1,5 +0,0 @@ -char dispstr[]; -f() -{ - strcpy(dispstr,"xxxxxxxxxxx"); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921203-2.c b/gcc/testsuite/gcc.c-torture/compile/921203-2.c deleted file mode 100644 index 929afb1bdde..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921203-2.c +++ /dev/null @@ -1,13 +0,0 @@ -typedef struct -{ - char x; -} s1; - -s1 f (int arg0,...) -{ - int args; - s1 back; - va_start (args, arg0); - va_end (args); - return back; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921206-1.c b/gcc/testsuite/gcc.c-torture/compile/921206-1.c deleted file mode 100644 index 10fa5ea6479..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921206-1.c +++ /dev/null @@ -1,28 +0,0 @@ -double sqrt(double),fabs(double),sin(double); -int sxs; -int sys; -f() -{ - int l; - int sm = -52, sx = 52; - char *smap; - for (l = 0; l < 9; l++) - { - double g; - int cx, cy, gx, gy, x, y; - gx = 2 > g / 3 ? 2 : g / 3; - gy = 2 > g / 3 ? 2 : g / 3; - for (y = 0 > cy - gy ? 0 : cy - gy; y <= (sys - 1 < cy + gy ? sys : cy + gy); y++) - { - int sx = 0 > cx - gx ? 0 : cx - gx; - short *ax = (short *) (y * sxs + sx); - - for (x = sx; x <= (sxs - 1 < cx + gx ? sxs - 1 : cx + gx); x++) - { - double c=2.25, z=sqrt(fabs(1-c)), cz=(c>1?0.0:-10)>z?c>1?0:1:z; - } - } - } - for (l = sm; l <= sx; l++) - smap[l] = l > 0 ? 1 + foo(sin(.1 * l / sx)) : 1 - foo(sin(.1 * l / sm)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/921227-1.c b/gcc/testsuite/gcc.c-torture/compile/921227-1.c deleted file mode 100644 index a49750c81af..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/921227-1.c +++ /dev/null @@ -1,5 +0,0 @@ -#define k(a) #a -char *s = k(k(1,2)); -char *t = k(#) k(#undef k) k(x); - -f(){} diff --git a/gcc/testsuite/gcc.c-torture/compile/930109-1.c b/gcc/testsuite/gcc.c-torture/compile/930109-1.c deleted file mode 100644 index dbd15a1bd0a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930109-1.c +++ /dev/null @@ -1,12 +0,0 @@ -f(x) - unsigned x; -{ - static short c; - return x>>c; -} -g(x) - unsigned x; -{ - static char c; - return x>>c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930109-2.c b/gcc/testsuite/gcc.c-torture/compile/930109-2.c deleted file mode 100644 index 61e3a4df99f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930109-2.c +++ /dev/null @@ -1,11 +0,0 @@ -f(r) -{ - int i; - for (i = 0; i < 2; i++) - { - r+= (4 >> i*2); - r+= (2 >> i*2); - r+= (1 >> i*2); - } - return r; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930111-1.c b/gcc/testsuite/gcc.c-torture/compile/930111-1.c deleted file mode 100644 index 28574191d13..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930111-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* 2.3.3 crashes on 386 with -traditional */ -f(a) - char *a; -{ - int d = strcmp(a,"-"); - - while (vfork() < 0) - ; - return d; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930117-1.c b/gcc/testsuite/gcc.c-torture/compile/930117-1.c deleted file mode 100644 index 83317cdd07b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930117-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f(x) -{ - (*(void (*)())&x)(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930118-1.c b/gcc/testsuite/gcc.c-torture/compile/930118-1.c deleted file mode 100644 index b29543c529e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930118-1.c +++ /dev/null @@ -1,6 +0,0 @@ -f() -{ -__label__ l; -l:p(); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/930120-1.c b/gcc/testsuite/gcc.c-torture/compile/930120-1.c deleted file mode 100644 index 95ac43c07ed..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930120-1.c +++ /dev/null @@ -1,138 +0,0 @@ -union { - short I[2]; - long int L; - char C[4]; -} itolws; -char *errflg; -long int dot; -short dotinc; -long int expvf; - -char * -f(fcount,ifp,itype,ptype) - short fcount; - char *ifp; -{ - unsigned w; - long int savdot, wx; - char *fp; - char c, modifier, longpr; - union { - double dval; - struct { - int i1; - int i2; - } ival; - } dw; - union { - float fval; - int ival; - } fw; - int gotdot = 0; - while (fcount > 0) { - fp = ifp; - c = *fp; - longpr = ((c >= 'A') & (c <= 'Z') | (c == 'f') | (c == '4') | (c == 'p') | (c == 'i')); - if ((itype == 0) || (*fp == 'a')) { - wx = dot; - w = dot; - } else { - gotdot = 1; - wx = get((int)dot, itype); - if (!longpr) { - w = (itolws.L=(wx), itolws.I[((dot)&3)>>1]); - } - } - if (c == 'F') { - dw.ival.i1 = wx; - if (itype == 0) { - dw.ival.i2 = expvf; - } - } - - modifier = *fp++; - switch(modifier) { - case ' ' : - case '\t' : - break; - case 't': - case 'T': - printf("%T",fcount); - return(fp); - case 'r': - case 'R': - printf("%M",fcount); - return(fp); - case 'k': - printf("%k",w); - break; - case 'K': - printf("%K",wx); - break; - case 'a': - psymoff(dot,ptype,":%16t"); - dotinc = 0; - break; - case 'p': - psymoff(0,ptype,"%16t"); - break; - case 'u': - printf("%-8u",w); - break; - case 'U': - printf("%-16U",wx); break; - case 'c': - case 'C': - if (modifier == 'C') { - printesc((int)(itolws.L=(wx), itolws.C[(dot)&3])); - } else { - printc((char)(itolws.L=(wx), itolws.C[(dot)&3])); - } - dotinc = 1; - break; - case 'b': - printf("%-8x", (itolws.L=(wx), itolws.C[(dot)&3])); - dotinc = 1; - break; - case 'B': - printf("%-8o", (itolws.L=(wx), itolws.C[(dot)&3])); - dotinc = 1; - break; - case 's': - case 'S': - savdot = dot; - dotinc = 1; - while ((c = (itolws.L=(wx), itolws.C[(dot)&3])) && (errflg == 0)) { - dot = inkdot(1); - if (modifier == 'S') { - printesc(c); - } else { - printc(c); - } - endline(); - if (!(dot & 3)) - wx = get((int)dot, itype); - } - dotinc = dot - savdot + 1; - dot = savdot; - break; - case 'i': - if (gotdot) { - wx = get((int)(dot & ~3), itype); - } - iDasm((int)(wx), (unsigned int)0, (unsigned int)(dot&~3)); - printc('\n'); - break; - case 'f': - fw.ival = wx; - printf("%-16.9f", fw.fval); - dotinc = 4; - break; - case 'F': - printf("%-32.18F", dw.dval); - dotinc = 8; - break; - } - } - return(fp); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930126-1.c b/gcc/testsuite/gcc.c-torture/compile/930126-1.c deleted file mode 100644 index 8313c5c450b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930126-1.c +++ /dev/null @@ -1,74 +0,0 @@ -typedef unsigned T; -typedef char Tchar; -T mt (long, char *); -T ms (long, char *); -T mv (long, T, char); -T cons (T, T); -T decl (T * (*) (T *), char *); - -T*L92(T*),*L15(T*),*L14(T*),*L13(T*),*L12(T*),*L11(T*),*L10(T*),*L9(T*),*L8(T*),*L7(T*),*L6(T*),*L5(T*),*L4(T*),*L3(T*),*L2(T*),*L1(T*); - -static T * -Ldata (T * my_pc) -{ -int cc = (((* ((T *) (my_pc))) >> 16) & 0xFF); -T B92, B91, B90, B15, B14, B13, B12, B11, B10, B9, B8, B7, B6, B5, B4, B3, B2, B1, tO7, tO6, tO5, tO4, tO3, tO2, tO1, tO0; -T object = mv (168, 0, ((Tchar) 1)); -T * cb = (T *) (((T) (object & 0x3FF)) | 0x400); -tO0 = mv (92, 0, ((Tchar) 1)); -B92 = decl (L92, ""); -B15 = decl (L15, ""); -B14 = decl (L14, ""); -B13 = decl (L13, ""); -B12 = decl (L12, ""); -B11 = decl (L11, ""); -B10 = decl (L10, ""); -B9 = decl (L9, ""); -B8 = decl (L8, ""); -B7 = decl (L7, ""); -B6 = decl (L6, ""); -B5 = decl (L5, ""); -B4 = decl (L4, ""); -B3 = decl (L3, ""); -B2 = decl (L2, ""); -B1 = decl (L1, ""); -cb[19] = ((((cc) & 0xFF) << 16) | (9 & 0xFF)); -cb[21] = ((((cc) & 0xFF) << 16) | ((10) & 0xFF)); -cb[23] = ((((cc) & 0xFF) << 16) | (11 & 0xFF)); -cb[25] = ((((cc) & 0xFF) << 16) | (12 & 0xFF)); -cb[27] = ((((cc) & 0xFF) << 16) | (13 & 0xFF)); -cb[29] = ((((cc) & 0xFF) << 16) | (14 & 0xFF)); -cb[31] = ((((cc) & 0xFF) << 16) | (15 & 0xFF)); -cb[35] = ((((cc) & 0xFF) << 16) | (17 & 0xFF)); -cb[36] = ((0x1A) << 26) | (((0x39) << 26) | 1) & 0x3FF; -cb[39] = ms (24, ((char *) "")); -cb[41] = ((0x1A) << 26) | (((0x39) << 26) | 1) & 0x3FF; -cb[44] = 3; -cb[46] = 2; -cb[48] = 3; -cb[50] = 6; -cb[52] = 4; -cb[146] = tO0; -((T *) (((tO0 & 0x3FF)) | 0x400))[92] = B1; -((T *) (((tO0 & 0x3FF)) | 0x400))[91] = B2; -((T *) (((tO0 & 0x3FF)) | 0x400))[2] = B90; -((T *) (((tO0 & 0x3FF)) | 0x400))[2] = B91; -((T *) (((tO0 & 0x3FF)) | 0x400))[1] = B92; -cb[58] = 0x2800 | (T) ((T *) ((B6 & 0x3FF) | 0x400) + 3); -cb[57] = 0x2800 | (T) ((T *) ((B7 & 0x3FF) | 0x400) + 3) & ~0xC00; -cb[56] = 0x2800 | (T) ((T *) ((B8 & 0x3FF) | 0x400) + 3) & ~0xC00; -cb[55] = 0x2800 | (T) ((T *) ((B9 & 0x3FF) | 0x400) + 3) & ~0xC00; -tO7 = mv (8, 0, ((Tchar) 1)); -tO4 = ms (9, ((char *) "")); -tO3 = mv (58, 0, ((Tchar) 1)); -tO6 = ms (4, ((char *) "")); -tO2 = mv (4, 0, ((Tchar) 1)); -tO5 = ms (4, ((char *) "")); -tO1 = mv (28, 0, ((Tchar) 1)); -cb[165] = tO1; -cb[163] = cons (((ms (10, ((char *) "")))), (cons (tO5, 0))); -cb[162] = cons (1, (cons (2, 0))); -cb[150] = cons (1, (cons (2, (cons (3, (cons (4, (cons (5, (cons (6, 0))))))))))); -cb[148] = tO7; -return cb; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930210-1.c b/gcc/testsuite/gcc.c-torture/compile/930210-1.c deleted file mode 100644 index 47d2da2aca5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930210-1.c +++ /dev/null @@ -1,11 +0,0 @@ -f() -{ - char c1, c2; - char *p1, *p2; - - do { - c1 = c2 = *p1++; - while (c1--) - *p2++ = *p1++; - } while (c2); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930217-1.c b/gcc/testsuite/gcc.c-torture/compile/930217-1.c deleted file mode 100644 index 70f4a4897c4..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930217-1.c +++ /dev/null @@ -1,14 +0,0 @@ -double g (); -typedef union { - struct { - unsigned s:1, e:8, f:23; - } u; - float f; -} s; - -f(x, n) - float x; -{ - ((s *)&x)->u.e -= n; - x = g((double)x, -n); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930222-1.c b/gcc/testsuite/gcc.c-torture/compile/930222-1.c deleted file mode 100644 index c6d6aa3b47d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930222-1.c +++ /dev/null @@ -1,16 +0,0 @@ -typedef struct - { - long i; - double f; - } T; - -f (T *n1, T *n2) -{ - if (g (n2)) - return n1->i - n2->i; - else - { - double f = n1->f - n2->i; - return f == 0.0 ? 0 : (f > 0.0 ? 1 : -1); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930325-1.c b/gcc/testsuite/gcc.c-torture/compile/930325-1.c deleted file mode 100644 index 24cea5027ab..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930325-1.c +++ /dev/null @@ -1,23 +0,0 @@ -typedef unsigned uint; - -inline -g (uint *s, uint *d, uint c) -{ - while (c != 0) - { - *--d = *--s; - c--; - } -} - -f (uint *p1, uint c, uint *p2) -{ - while (c > 0 && *p1 == 0) - { - p1++; - c--; - } - if (c == 0) - return 1; - g (p2, p1, c); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930326-1.c b/gcc/testsuite/gcc.c-torture/compile/930326-1.c deleted file mode 100644 index 97313d86aa9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930326-1.c +++ /dev/null @@ -1,6 +0,0 @@ -struct -{ - char a, b, f[3]; -} s; - -long i = s.f-&s.b; diff --git a/gcc/testsuite/gcc.c-torture/compile/930411-1.c b/gcc/testsuite/gcc.c-torture/compile/930411-1.c deleted file mode 100644 index bb03c13fa07..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930411-1.c +++ /dev/null @@ -1,36 +0,0 @@ -int heap; - -g(){} - -f(int i1, int i2) -{ - i1 = *(int*)(i1 + 4); - if (i1 == 0) - goto L4; - else - goto L9; - L3: - i2 = heap - 8; - *(int*)i2 = 3; - *(int*)(i2 + 4) = i1; - heap -= 8; - return i2; - L4: - i1 = g(i2); - goto L5; - L5: - i1 = *(int*)(i1 + 4); - if (i1 == 0) - goto L7; - else - goto L8; - L7: - i1 = 0; - goto L3; - L8: - i1 = 1; - goto L3; - L9: - i1 = 1; - goto L3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930421-1.c b/gcc/testsuite/gcc.c-torture/compile/930421-1.c deleted file mode 100644 index 01b465f7fec..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930421-1.c +++ /dev/null @@ -1,19 +0,0 @@ -double q(double); - -f (int **x, int *r, int *s, int a, int b, int c, int d) -{ - int i, j, k, m, e, f, g, z[1024], y[2]; - - e = g = 0; - for (i = 0; i < a; i++) - for (j = 0; j < b; j++) - if (x[i][j]) - for (k = 0; k < c; k++) - { - f = q(1.5) + q(2.5); - if (g < y[f]) - g = e; - } - for (m = 0; m < 1; m++) - z[0] = m*2*d/3.0 - d; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930427-2.c b/gcc/testsuite/gcc.c-torture/compile/930427-2.c deleted file mode 100644 index 53b633785ae..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930427-2.c +++ /dev/null @@ -1,9 +0,0 @@ -struct s { - int f; -}; - -f (w, v0, v1, v2, v3) - struct s *w; -{ - g (v0 ? 1 : w->f, v1 ? v3 : v2); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930503-1.c b/gcc/testsuite/gcc.c-torture/compile/930503-1.c deleted file mode 100644 index 6889e8b7aed..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930503-1.c +++ /dev/null @@ -1,8 +0,0 @@ -f (const char *s, char *d, unsigned l) -{ - if (0) - while (1); - else - while (--l >= 0) - *d++ = *s++; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930503-2.c b/gcc/testsuite/gcc.c-torture/compile/930503-2.c deleted file mode 100644 index 1b0ea34f038..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930503-2.c +++ /dev/null @@ -1,5 +0,0 @@ -f() -{ - struct { char x; } r; - g(r); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930506-1.c b/gcc/testsuite/gcc.c-torture/compile/930506-1.c deleted file mode 100644 index 8c26ea3670c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930506-1.c +++ /dev/null @@ -1,12 +0,0 @@ -long long -f (a) - double a; -{ - double b; - unsigned long long v; - - b = a / 2.0; - v = (unsigned) b; - a -= (double) v; - return v; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930506-2.c b/gcc/testsuite/gcc.c-torture/compile/930506-2.c deleted file mode 100644 index e11e62f026f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930506-2.c +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef NO_TRAMPOLINES -int f1() -{ - { int ___() { foo(1); } bar(___); } - return( { int ___() { foo(2); } bar(___);} ); -} - -int f2(int j) -{ - { int ___() { foo(j); } bar(___); } - return( { int ___() { foo(j); } bar(___);} ); -} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/930510-1.c b/gcc/testsuite/gcc.c-torture/compile/930510-1.c deleted file mode 100644 index 8c46282626c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930510-1.c +++ /dev/null @@ -1,18 +0,0 @@ -typedef long time_t; -static __const int mon_lengths[2][12] = { - 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31, - 31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 -}; -static time_t -f (janfirst, year, rulep, offset) - __const time_t janfirst; - __const int year; - register __const struct rule * __const rulep; - __const long offset; -{ - register int leapyear; - register time_t value; - register int i; - - value += mon_lengths[leapyear][i] * ((long) (60 * 60) * 24); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930513-1.c b/gcc/testsuite/gcc.c-torture/compile/930513-1.c deleted file mode 100644 index 2e106ae43a9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930513-1.c +++ /dev/null @@ -1,9 +0,0 @@ -struct s { - int f1 : 26; - int f2 : 8; -}; - -f (struct s *x) -{ - return x->f2++ == 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930513-2.c b/gcc/testsuite/gcc.c-torture/compile/930513-2.c deleted file mode 100644 index a7f508c8266..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930513-2.c +++ /dev/null @@ -1,9 +0,0 @@ -double g (); - -f (x) - double x; -{ - x = .85; - while (g () < x) - ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930513-3.c b/gcc/testsuite/gcc.c-torture/compile/930513-3.c deleted file mode 100644 index f8d4e60341c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930513-3.c +++ /dev/null @@ -1,9 +0,0 @@ -test () -{ - short *p, q[3]; - int x; - - p = q; - for (x = 0; x < 3; x++) - *p++ = 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930523-1.c b/gcc/testsuite/gcc.c-torture/compile/930523-1.c deleted file mode 100644 index 5f2b5b5d7e3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930523-1.c +++ /dev/null @@ -1,54 +0,0 @@ -int v; - -f () -{ - unsigned long *a1, *a2; - int vertex2; - int c, x1, x2, dx1, dx2, dy1, dy2, e1, e2, s2; - unsigned long m, b; - int n; - unsigned long r; - int aba; - - do - { - if (dx2 >= dy2) - dx2 = dx2 % dy2; - - if (dx2 >= dy2) - { - s2 = - (dx2 / dy2); - dx2 = dx2 % dy2; - } - } - while (vertex2 / 65536); - - for (;;) - { - c = x2; - a2 = a1; - if (v) - a2 = 0; - - if (c + n) - { - m = b << (c * 8); - *a2 = (*a2 & ~m) | (r & m); - n += c; - - while (--n) - { - { - } - } - } - - a1 = 0; - x1 += 0; - if (e1 += dx1) - e1 -= dy1; - x2 += s2; - if (e2 += dx2) - e2 -= dy2; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930525-1.c b/gcc/testsuite/gcc.c-torture/compile/930525-1.c deleted file mode 100644 index 00c2e263b82..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930525-1.c +++ /dev/null @@ -1,7 +0,0 @@ -typedef struct foo foo_t; -foo_t x; -struct foo { - int i; -}; - -foo_t x = { 10 }; diff --git a/gcc/testsuite/gcc.c-torture/compile/930527-1.c b/gcc/testsuite/gcc.c-torture/compile/930527-1.c deleted file mode 100644 index 53e00e65ed1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930527-1.c +++ /dev/null @@ -1,16 +0,0 @@ -enum {e0, e1}; - -int x[] = -{ - [e0] = 0 -}; - -f () -{ - switch (1) - { - case e0: - case e1: - break; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930529-1.c b/gcc/testsuite/gcc.c-torture/compile/930529-1.c deleted file mode 100644 index 70b2cb8f90c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930529-1.c +++ /dev/null @@ -1,83 +0,0 @@ -struct r -{ - int d1, d2; -}; - -struct km -{ - int d; -}; - -struct f1 -{ - char *fn; - char *fd; - char *fs; - char *ic; - void (*ff) (); -}; - -int g (); - -int y; -struct r *bs; -int bv; - -void b (); -char *w (); - -struct km **q; -char **mns; -int nm; -struct f1 **z; - -f (char *km, char *h) -{ - struct f1 *t; - int map = midn(km, strlen(km)); - int V; - int c; - struct r r; - struct f1 *cm; - - if (!g(&V, &cm, h, strlen(h))) - { - c = (cm - z[V]); - goto L; - } - - for (c = 0; c < nm; c++) - if (!strcmp (h, mns[c])) - { - V = -1; - goto L; - } - - for (c = 0; c < y; c++) - { - if (!memcmp (&bs[c], &r, 8)) - goto L; - } - - h = w (&r); - if (!bv) - { - bs = g (8); - t = (struct f1 *)g (20); - } - else - { - bs = g (bs, y * 8); - z[bv] = cr (z[bv], (1 + y) * 20); - t = &z[bv][y - 1]; - } - bs[y - 1] = r; - t->fs[0] = sp (y - 1); - t->fs[1] = 0; - t->ic = 0; - t->fd = 0; - t->fn = cs (h); - t->ff = b; - L: - g (q[map], V, c); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930530-1.c b/gcc/testsuite/gcc.c-torture/compile/930530-1.c deleted file mode 100644 index 848e0400ece..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930530-1.c +++ /dev/null @@ -1,5 +0,0 @@ -f () -{ - struct { char a, b; } x; - g (x, x, x, x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930602-1.c b/gcc/testsuite/gcc.c-torture/compile/930602-1.c deleted file mode 100644 index 5a0eb2189ba..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930602-1.c +++ /dev/null @@ -1,13 +0,0 @@ -typedef struct { - int f[8]; -} T; - -f (w, l, r) - T *w; - unsigned short l, r; -{ - int i; - - for (i = l; i < r; i++) - g (w->f[i]); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930603-1.c b/gcc/testsuite/gcc.c-torture/compile/930603-1.c deleted file mode 100644 index 643cc52d4c2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930603-1.c +++ /dev/null @@ -1,10 +0,0 @@ -union u { union u *a; double d; }; -union u *s, g(); - -f() -{ - union u x = g(); - - s[0] = *x.a; - s[1] = g(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930607-1.c b/gcc/testsuite/gcc.c-torture/compile/930607-1.c deleted file mode 100644 index 97c94b25ec3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930607-1.c +++ /dev/null @@ -1,9 +0,0 @@ -typedef void f (); -typedef f *pf; -long long i; - -g () -{ - long long p = i; - ((pf) (long) p) (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930611-1.c b/gcc/testsuite/gcc.c-torture/compile/930611-1.c deleted file mode 100644 index c216c096523..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930611-1.c +++ /dev/null @@ -1,7 +0,0 @@ -float -f (float a1) -{ - union { float f; int l; } fl1; - fl1.f = a1; - return fl1.l ? 1.0 : a1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930618-1.c b/gcc/testsuite/gcc.c-torture/compile/930618-1.c deleted file mode 100644 index 74c21572550..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930618-1.c +++ /dev/null @@ -1,8 +0,0 @@ -f (s) -{ - int r; - - r = (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)) | (!g(s)); - - return r; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930621-1.c b/gcc/testsuite/gcc.c-torture/compile/930621-1.c deleted file mode 100644 index 4199bbe0870..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930621-1.c +++ /dev/null @@ -1,38 +0,0 @@ -#if defined(STACK_SIZE) && (STACK_SIZE < 65536) -# define BYTEMEM_SIZE 10000L -#endif - -#ifndef BYTEMEM_SIZE -# define BYTEMEM_SIZE 45000L -#endif - -int bytestart[5000 + 1]; -unsigned char modtext[400 + 1]; -unsigned char bytemem[2][BYTEMEM_SIZE + 1]; - -long -modlookup (int l) -{ - signed char c; - long j; - long k; - signed char w; - long p; - while (p != 0) - { - while ((k < bytestart[p + 2]) && (j <= l) && (modtext[j] == bytemem[w][k])) - { - k = k + 1; - j = j + 1; - } - if (k == bytestart[p + 2]) - if (j > l) - c = 1; - else c = 4; - else if (j > l) - c = 3; - else if (modtext[j] < bytemem[w][k]) - c = 0; - else c = 2; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930623-1.c b/gcc/testsuite/gcc.c-torture/compile/930623-1.c deleted file mode 100644 index 4b5b90bd848..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930623-1.c +++ /dev/null @@ -1,7 +0,0 @@ -g (a, b) {} - -f (xx) - void* xx; -{ - __builtin_apply ((void*)g, xx, 200); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930702-1.c b/gcc/testsuite/gcc.c-torture/compile/930702-1.c deleted file mode 100644 index 9f51dd876ee..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930702-1.c +++ /dev/null @@ -1,5 +0,0 @@ -f () -{ - {({});} - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930926-1.c b/gcc/testsuite/gcc.c-torture/compile/930926-1.c deleted file mode 100644 index fcfa4fbc499..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930926-1.c +++ /dev/null @@ -1,7 +0,0 @@ -int f () { return 0; } - -void -test () -{ - int j = { f() }; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/930927-1.c b/gcc/testsuite/gcc.c-torture/compile/930927-1.c deleted file mode 100644 index 81a4979f482..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/930927-1.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stddef.h> - -wchar_t s[5] = L"abcd"; diff --git a/gcc/testsuite/gcc.c-torture/compile/931003-1.c b/gcc/testsuite/gcc.c-torture/compile/931003-1.c deleted file mode 100644 index 922b14379c9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931003-1.c +++ /dev/null @@ -1,15 +0,0 @@ -f (n, a) - int n; - double a[]; -{ - double b[51]; - int i, j; - - i = 0; - - for (j = n - 1; j > 0; j--) - b[i++] = 0; - - if (b[0] > b[i - 1]) - a[i] = b[i - 1]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931004-1.c b/gcc/testsuite/gcc.c-torture/compile/931004-1.c deleted file mode 100644 index 0e741fd4ac0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931004-1.c +++ /dev/null @@ -1,8 +0,0 @@ -#define A "This is a long test that tests the structure initialization" -#define B A,A -#define C B,B,B,B -#define D C,C,C,C -int main() -{ - char *subs[]={ D, D, D, D, D, D, D, D, D, D, D, D, D, D, D}; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931013-1.c b/gcc/testsuite/gcc.c-torture/compile/931013-1.c deleted file mode 100644 index c237c0b7341..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931013-1.c +++ /dev/null @@ -1,10 +0,0 @@ -g (); - -f () -{ - long ldata[2]; - int seed; - - seed = (ldata[0]) + (ldata[1] << 16); - g (seed); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931013-2.c b/gcc/testsuite/gcc.c-torture/compile/931013-2.c deleted file mode 100644 index 8fc0db492ab..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931013-2.c +++ /dev/null @@ -1,20 +0,0 @@ -f (unsigned short Z[48]) -{ - int j; - unsigned short t1, t2, t3, T[48]; - unsigned short *p = T + 48; - - for (j = 1; j < 8; j++) - { - t1 = *Z++; - *--p = *Z++; - *--p = t1; - t1 = inv(*Z++); - t2 = -*Z++; - t3 = -*Z++; - *--p = inv(*Z++); - *--p = t2; - *--p = t3; - *--p = t1; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931013-3.c b/gcc/testsuite/gcc.c-torture/compile/931013-3.c deleted file mode 100644 index e663b9acc1c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931013-3.c +++ /dev/null @@ -1,11 +0,0 @@ -struct s -{ - int f; -}; - -struct s -f () -{ - int addr; - return *(struct s *) &addr; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931018-1.c b/gcc/testsuite/gcc.c-torture/compile/931018-1.c deleted file mode 100644 index 7efe40ec094..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931018-1.c +++ /dev/null @@ -1,14 +0,0 @@ -typedef struct -{ - int a, b; -} T; - -f (T *bs) -{ - long long x; - x = ({ - union { T s; long long l; } u; - u.s = *bs; - u.l; - }); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931031-1.c b/gcc/testsuite/gcc.c-torture/compile/931031-1.c deleted file mode 100644 index 9015f54f7bf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931031-1.c +++ /dev/null @@ -1,9 +0,0 @@ -struct s -{ - int pad:1, no:1; -}; - -f (struct s *b, int c) -{ - char d = b->no && c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931102-1.c b/gcc/testsuite/gcc.c-torture/compile/931102-1.c deleted file mode 100644 index a039c26331c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931102-1.c +++ /dev/null @@ -1,111 +0,0 @@ -char *e (); - -#define SET \ - if (d > *b++) d |= a; \ - if (b) b = e(b); - -xxx() -{ - int a, d; - char *b, *c; - - while (1) { - while (1) { - while (1) { - if (a) { - switch (a) { - case 1: - while (1) { - SET - do { - SET - } while (1); - } - case 2: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - case 3: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - case 4: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - } - } - else { - switch (a) { - case 2: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - case 3: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - case 4: - while (1) { - if (d) { - do { - SET - } while (1); - } - else { - do { - SET - } while (1); - } - } - } - } - } - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931102-2.c b/gcc/testsuite/gcc.c-torture/compile/931102-2.c deleted file mode 100644 index f39b271645d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931102-2.c +++ /dev/null @@ -1,21 +0,0 @@ -typedef struct { - int a; -} VCR; - -typedef struct { - VCR vcr[8]; -} VCRC; - -typedef struct { - char vcr; -} OWN; - -OWN Own[16]; - -f (x, own) - VCRC *x; - OWN *own; -{ - x[own->vcr / 8].vcr[own->vcr % 8].a--; - x[own->vcr / 8].vcr[own->vcr % 8].a = x[own->vcr / 8].vcr[own->vcr % 8].a; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/931203-1.c b/gcc/testsuite/gcc.c-torture/compile/931203-1.c deleted file mode 100644 index 3007ff582e0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/931203-1.c +++ /dev/null @@ -1,5 +0,0 @@ -v (a, i) - unsigned *a, i; -{ - a++[i] = 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/940611-1.c b/gcc/testsuite/gcc.c-torture/compile/940611-1.c deleted file mode 100644 index 90f72486ada..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/940611-1.c +++ /dev/null @@ -1,10 +0,0 @@ -f () -{ - do -L:; - while (0); - do - ; - while (0); - goto L; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/940712-1.c b/gcc/testsuite/gcc.c-torture/compile/940712-1.c deleted file mode 100644 index 10a6961dcb7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/940712-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f () -{ - return (*(volatile unsigned int *)8000) / 3; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/940718-1.c b/gcc/testsuite/gcc.c-torture/compile/940718-1.c deleted file mode 100644 index 505280fa91e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/940718-1.c +++ /dev/null @@ -1,7 +0,0 @@ -extern double log (double) __attribute__ ((const)); - -f (double x) -{ - for (;;) - exp(log(x)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/941014-1.c b/gcc/testsuite/gcc.c-torture/compile/941014-1.c deleted file mode 100644 index d31701572fc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941014-1.c +++ /dev/null @@ -1,11 +0,0 @@ -f (to) - char *to; -{ - unsigned int wch; - register length; - unsigned char tmp; - unsigned int mult = 10; - - tmp = (wch>>(unsigned int)(length * mult)); - *to++ = (unsigned char)tmp; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/941014-2.c b/gcc/testsuite/gcc.c-torture/compile/941014-2.c deleted file mode 100644 index 01e9a672e88..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941014-2.c +++ /dev/null @@ -1,37 +0,0 @@ -void -f (n, ppt, xrot) -{ - int tileWidth; - int nlwSrc; - int srcx; - int v3, v4; - register unsigned long ca1, cx1, ca2, cx2; - unsigned long *pSrcLine; - register unsigned long *pDst; - register unsigned long *pSrc; - register unsigned long b, tmp; - unsigned long tileEndMask; - int v1, v2; - int tileEndPart; - int needFirst; - tileEndPart = 0; - v1 = tileEndPart << 5; - v2 = 32 - v1; - while (n--) - { - if ((srcx = (ppt - xrot) % tileWidth) < 0) - if (needFirst) - if (nlwSrc == 1) - { - tmp = b; - if (tileEndPart) - b = (*pSrc & tileEndMask) | (*pSrcLine >> v1); - } - if (tileEndPart) - b = (tmp << v1) | (b >> v2); - if (v4 != 32) - *pDst = (*pDst & ((tmp << v3) | (b >> v4) & ca1 ^ cx1) - ^ (((tmp << v3) | (b >> v4)) & ca2 ^ cx2)); - *pDst = *pDst & tmp; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/941014-3.c b/gcc/testsuite/gcc.c-torture/compile/941014-3.c deleted file mode 100644 index 6dcb89395e3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941014-3.c +++ /dev/null @@ -1,72 +0,0 @@ -typedef unsigned char byte; -typedef unsigned int uint; -typedef unsigned long ulong; -typedef ulong gs_char; -typedef struct gs_show_enum_s gs_show_enum; -typedef struct gs_font_s gs_font; -typedef struct gx_font_stack_item_s { - gs_font *font; -} gx_font_stack_item; -typedef struct gx_font_stack_s { - gx_font_stack_item items[1 + 5 ]; -} gx_font_stack; -struct gs_show_enum_s { - gx_font_stack fstack; -}; -typedef enum { - ft_composite = 0, -} font_type; -struct gs_font_s { - font_type FontType; -}; -typedef enum { - fmap_escape = 3, - fmap_shift = 8 - } fmap_type; -typedef struct gs_type0_data_s { - fmap_type FMapType; -} gs_type0_data; -gs_type0_next_char(register gs_show_enum *penum) -{ - const byte *p; - int fdepth; - gs_font *pfont; - gs_type0_data *pdata; - uint fidx; - gs_char chr; - for (; pfont->FontType == ft_composite; ) - { - fmap_type fmt; - switch ( fmt ) - { - do {} while (0); - rdown: - continue; - case fmap_shift: - p++; - do {} while (0); - goto rdown; - } - break; - } - up: - while ( fdepth > 0 ) - { - switch ( pdata->FMapType ) - { - default: - continue; - case fmap_escape: - fidx = *++p; - do {} while (0); - if ( fidx == chr && fdepth > 1 ) - goto up; - down: - fdepth--; - do {} while (0); - } - break; - } - while ( (pfont = penum->fstack.items[fdepth].font)->FontType == ft_composite ) - ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/941014-4.c b/gcc/testsuite/gcc.c-torture/compile/941014-4.c deleted file mode 100644 index 9e673f37833..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941014-4.c +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef NO_LABEL_VALUES -f (int *re) -{ - int *loops = 0, *loope = 0; - unsigned dat0 = 0; - static void *debug = &&firstdebug; - - firstdebug: - g (loops, loope); - - if (dat0 & 1) - re[(dat0 >> 2) & 3] = 0; -} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/941019-1.c b/gcc/testsuite/gcc.c-torture/compile/941019-1.c deleted file mode 100644 index 257b594c1b6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941019-1.c +++ /dev/null @@ -1 +0,0 @@ -__complex__ long double sub (__complex__ long double cld) { return cld; } diff --git a/gcc/testsuite/gcc.c-torture/compile/941111-1.c b/gcc/testsuite/gcc.c-torture/compile/941111-1.c deleted file mode 100644 index 3f0c28bef12..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941111-1.c +++ /dev/null @@ -1,8 +0,0 @@ -main () -{ - struct S { int i; char c; } obj1, obj2; - - foo (); - if (obj1.c != obj2.c) - bar (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/941113-1.c b/gcc/testsuite/gcc.c-torture/compile/941113-1.c deleted file mode 100644 index 5c2e0b68c56..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/941113-1.c +++ /dev/null @@ -1,12 +0,0 @@ -typedef void foo (void); - -f (x) -{ - if (x) - { - const foo* v; - (*v)(); - } - else - g (0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950122-1.c b/gcc/testsuite/gcc.c-torture/compile/950122-1.c deleted file mode 100644 index 8dea7905093..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950122-1.c +++ /dev/null @@ -1,5 +0,0 @@ -int -foo (int i, unsigned short j) -{ - return j *= i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950124-1.c b/gcc/testsuite/gcc.c-torture/compile/950124-1.c deleted file mode 100644 index e723954a0c1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950124-1.c +++ /dev/null @@ -1,15 +0,0 @@ -f () -{ - if (g ()) - h (); - else - { - do - { - return 0; - break; - } - while (1); - } - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950221-1.c b/gcc/testsuite/gcc.c-torture/compile/950221-1.c deleted file mode 100644 index 14147638668..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950221-1.c +++ /dev/null @@ -1,16 +0,0 @@ -short v = -1; - -typedef struct -{ - short network; -} atype; - -void f () -{ - static atype config; - atype *cp; - short net; - cp = &config; - cp->network = (v == -1) ? 100 : v; - net = cp->network; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950329-1.c b/gcc/testsuite/gcc.c-torture/compile/950329-1.c deleted file mode 100644 index 7c047f5a59c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950329-1.c +++ /dev/null @@ -1,19 +0,0 @@ -f () -{ - int i; - for (i = 1;; i = 0) - { - if (h ()) - { - if (i) - g (); - g (h ()); - g (h ()); - } - else - { - g (); - break; - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950512-1.c b/gcc/testsuite/gcc.c-torture/compile/950512-1.c deleted file mode 100644 index e43ec48d165..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950512-1.c +++ /dev/null @@ -1,6 +0,0 @@ -typedef unsigned short uint16; -f (unsigned char *w) -{ - w[2] = (uint16) ((((g (0) % 10000 + 42) & 0xFF) << 8) | (((g (0) % 10000 + 42) >> 8) & 0xFF)) & 0xFF, - w[3] = (uint16) ((((g (0) % 10000 + 42) & 0xFF) << 8) | (((g (0) % 10000 + 42) >> 8) & 0xFF)) >> 8; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950530-1.c b/gcc/testsuite/gcc.c-torture/compile/950530-1.c deleted file mode 100644 index 2b714e059bc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950530-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f (int *s, int *t) -{ - return (t - s) / 2; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950607-1.c b/gcc/testsuite/gcc.c-torture/compile/950607-1.c deleted file mode 100644 index 851defce34c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950607-1.c +++ /dev/null @@ -1,38 +0,0 @@ -typedef struct { - int component_id; - int component_index; - int h_samp_factor; - int v_samp_factor; -} jpeg_component_info; -struct jpeg_common_struct { - struct jpeg_error_mgr * err; -}; -typedef struct jpeg_common_struct * j_common_ptr; -typedef struct jpeg_compress_struct * j_compress_ptr; -struct jpeg_compress_struct { - struct jpeg_error_mgr * err; - int num_components; - jpeg_component_info * comp_info; - int max_h_samp_factor; - int max_v_samp_factor; -}; -struct jpeg_error_mgr { - int msg_code; -}; - -void -jinit_downsampler (j_compress_ptr cinfo) -{ - int ci; - jpeg_component_info * compptr; - - for (ci = 0, compptr = cinfo->comp_info; ci < cinfo->num_components; - ci++, compptr++) { - if (compptr->h_samp_factor == cinfo->max_h_samp_factor && - compptr->v_samp_factor == cinfo->max_v_samp_factor) { - } else if ((cinfo->max_h_samp_factor % compptr->h_samp_factor) == 0 && - (cinfo->max_v_samp_factor % compptr->v_samp_factor) == 0) { - } else - cinfo->err->msg_code = 0; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950610-1.c b/gcc/testsuite/gcc.c-torture/compile/950610-1.c deleted file mode 100644 index 16d0d0e60f5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950610-1.c +++ /dev/null @@ -1 +0,0 @@ -f (int n, int a[2][n]) {} diff --git a/gcc/testsuite/gcc.c-torture/compile/950612-1.c b/gcc/testsuite/gcc.c-torture/compile/950612-1.c deleted file mode 100644 index cb3cb0a59d6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950612-1.c +++ /dev/null @@ -1,134 +0,0 @@ -typedef enum -{ - LODI, - STO, - ADDI, - ADD, - SUBI, - SUB, - MULI, - MUL, - DIVI, - DIV, - INC, - DEC -} INSN; - -f (pc) - short *pc; -{ - long long stack[16], *sp = &stack[16], acc = 0; - - for (;;) - { - switch ((INSN)*pc++) - { - case LODI: - *--sp = acc; - acc = ((long long)*pc++) << 32; - break; - case STO: - return (acc >> 32) + (((((unsigned long long) acc) & 0xffffffff) & (1 << 31)) != 0); - break; - case ADDI: - acc += ((long long)*pc++) << 32; - break; - case ADD: - acc = *sp++ + acc; - break; - case SUBI: - acc -= ((long long)*pc++) << 32; - break; - case SUB: - acc = *sp++ - acc; - break; - case MULI: - acc *= *pc++; - break; - case MUL: - { - long long aux; - unsigned char minus; - - minus = 0; - aux = *sp++; - if (aux < 0) - { - minus = ~minus; - aux = -aux; - } - if (acc < 0) - { - minus = ~minus; - acc = -acc; - } - acc = ((((((unsigned long long) acc) & 0xffffffff) * (((unsigned long long) aux) & 0xffffffff)) >> 32) - + ((((unsigned long long) acc) >> 32) * (((unsigned long long) aux) & 0xffffffff) + (((unsigned long long) acc) & 0xffffffff) + (((unsigned long long) aux) >> 32)) - + (((((unsigned long long) acc) >> 32) * (((unsigned long long) aux) >> 32)) << 32)); - if (minus) - acc = -acc; - } - break; - case DIVI: - { - short aux; - - aux = *pc++; - acc = (acc + aux / 2) / aux; - } - break; - case DIV: - { - long long aux; - unsigned char minus; - - minus = 0; - aux = *sp++; - if (aux < 0) - { - minus = ~minus; - aux = -aux; - } - if (acc < 0) - { - minus = ~minus; - acc = -acc; - } - - if (((unsigned long long)acc) == 0) - acc = (unsigned long long)-1 / 2; - else if ((((unsigned long long) ((unsigned long long)acc)) & 0xffffffff) == 0) - acc = ((unsigned long long)aux) / (((unsigned long long) ((unsigned long long)acc)) >> 32); - else if ((((unsigned long long) ((unsigned long long)acc)) >> 32) == 0) - acc = ((((unsigned long long)aux) / ((unsigned long long)acc)) << 32) - + ((((unsigned long long)aux) % ((unsigned long long)acc)) << 32) / ((unsigned long long)acc); - else - { - unsigned char shift; - unsigned long hi; - - shift = 32; - hi = (((unsigned long long) ((unsigned long long)acc)) >> 32); - do { - if (hi & ((unsigned long)1 << (shift - 1))) - break; - } while (--shift != 0); - printf("shift = %d\n", shift); - acc = ((((unsigned long long)aux) / ((unsigned long long)acc)) << 32) - + (((((unsigned long long)aux) % ((unsigned long long)acc)) << (32 - shift)) + ((((unsigned long long)acc) >> shift) / 2)) / (((unsigned long long)acc) >> shift); - } - - if (minus) - acc = -acc; - } - break; - case INC: - acc += 1; - break; - case DEC: - acc -= 1; - break; - } - printf("%08lx.%08lx\n", (long)(((unsigned long long) acc) >> 32) , (long)(((unsigned long long) acc) & 0xffffffff)); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950613-1.c b/gcc/testsuite/gcc.c-torture/compile/950613-1.c deleted file mode 100644 index 8aa757f476c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950613-1.c +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef NO_LABEL_VALUES -f () -{ - long *sp; - long *pc; - - static void *dummy[] = - { - &&L1, - &&L2, - }; - - L1: - { - float val; - val = *(float *) sp; - val = -val; - *(float *) sp = val; - goto *pc++; - } - - L2: - { - float from; - *(long long *) sp = from; - goto *pc++; - } -} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/950618-1.c b/gcc/testsuite/gcc.c-torture/compile/950618-1.c deleted file mode 100644 index 4229da4e9bf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950618-1.c +++ /dev/null @@ -1,2 +0,0 @@ -static __inline__ int f () { return g (); } -int g () { return f (); } diff --git a/gcc/testsuite/gcc.c-torture/compile/950719-1.c b/gcc/testsuite/gcc.c-torture/compile/950719-1.c deleted file mode 100644 index d3277fada4e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950719-1.c +++ /dev/null @@ -1,11 +0,0 @@ -typedef struct -{ - int Header; - char data[4092]; -} t_node; - -f (unsigned short rid, unsigned short record_length) -{ - t_node tnode; - g (rid, tnode.data + rid * record_length); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950729-1.c b/gcc/testsuite/gcc.c-torture/compile/950729-1.c deleted file mode 100644 index cfdbad9206f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950729-1.c +++ /dev/null @@ -1,39 +0,0 @@ -static const char * const lcset = "0123456789abcdef"; -static const char * const ucset = "0123456789ABCDEF"; - -char * -f (char *buffer, long long value, char type) -{ - int base, i; - - i = 128 - 1; - buffer[i--] = '\0'; - - switch (type) - { - case 'u': - case 'o': - case 'x': - case 'X': - if (type == 'u') - base = 10; - else if (type == 'o') - base = 8; - else - base = 16; - - while (i >= 0) - { - if (type == 'X') - buffer[i--] = ucset[((unsigned long long) value) % base]; - else - buffer[i--] = lcset[((unsigned long long) value) % base]; - - if ((value = ((unsigned long long) value) / base) == 0) - break; - } - break; - } - - return &buffer[++i]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950816-1.c b/gcc/testsuite/gcc.c-torture/compile/950816-1.c deleted file mode 100644 index da849bbad0a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950816-1.c +++ /dev/null @@ -1,7 +0,0 @@ -f () -{ - unsigned char b[2]; - float f; - b[0] = (unsigned char) f / 256; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950816-2.c b/gcc/testsuite/gcc.c-torture/compile/950816-2.c deleted file mode 100644 index 41e770d177d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950816-2.c +++ /dev/null @@ -1,8 +0,0 @@ -f () -{ - int i; - float a,b,c; - unsigned char val[2]; - i = func (&c); - val[0] = c < a ? a : c >= 1.0 ? b : c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950816-3.c b/gcc/testsuite/gcc.c-torture/compile/950816-3.c deleted file mode 100644 index b3cb0fca377..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950816-3.c +++ /dev/null @@ -1,8 +0,0 @@ -f () -{ - int i; - short x, z; - for (i = 0; i <= 1; i++) - x = i; - return x + z; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950910-1.c b/gcc/testsuite/gcc.c-torture/compile/950910-1.c deleted file mode 100644 index 1be2aa55e68..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950910-1.c +++ /dev/null @@ -1,22 +0,0 @@ -f (char *p) -{ - char c; - - c = *++p; - if (c != ' ') - return 0; - for (;;) - { - c = *p; - if (g (c)) - p++; - else - { - if (c == ' ') - break; - else - return 0; - } - } - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950919-1.c b/gcc/testsuite/gcc.c-torture/compile/950919-1.c deleted file mode 100644 index 8320f6d025a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950919-1.c +++ /dev/null @@ -1,5 +0,0 @@ -#define empty -#if empty#cpu(m68k) -#endif - -f (){} diff --git a/gcc/testsuite/gcc.c-torture/compile/950921-1.c b/gcc/testsuite/gcc.c-torture/compile/950921-1.c deleted file mode 100644 index 371c7d569c5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950921-1.c +++ /dev/null @@ -1,12 +0,0 @@ -f () -{ - union - { - signed char c; - double d; - } u; - - u.c = 1; - u.c = 1; - return u.c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/950922-1.c b/gcc/testsuite/gcc.c-torture/compile/950922-1.c deleted file mode 100644 index 73574f33e68..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/950922-1.c +++ /dev/null @@ -1,68 +0,0 @@ -struct sw { - const void *x; - int r; -}; -struct sq { - struct sw *q_w; - int t; - int z; -}; - -int -f (int ch, char *fp, char *ap) -{ - register int n; - register char *cp; - register struct sw *p; - register int f; - int prec; - double _double; - int expt; - int ndig; - char expstr[7]; - unsigned long long _uquad; - struct sq q; - struct sw w[8]; - static char zeroes[16]; - - for (;;) { - switch (ch) { - case 'd': - _double = (double) (ap += 8, *((double *) (ap - 8))); - break; - case 'o': - goto nosign; - case 'u': - _uquad = (f & 0x020 ? (ap += 8, *((long long *) (ap - 8))) : f & 0x010 ? (ap += 4, *((long *) (ap - 4))) : f & 0x040 ? (long)(short)(ap += 4, *((int *) (ap - 4))) : (long)(ap += 4, *((int *) (ap - 4)))); - goto nosign; - case 'x': - _uquad = (f & 0x020 ? (ap += 8, *((long long *) (ap - 8))) : f & 0x010 ? (ap += 4, *((long *) (ap - 4))) : f & 0x040 ? (long)(unsigned short)(ap += 4, *((int *) (ap - 4))) : (long)(ap += 4, *((int *) (ap - 4)))); - nosign: - if (_uquad != 0 || prec != 0); - break; - default: - } - if ((f & 0x100) == 0) { - } else { - if (ch >= 'f') { - if (_double == 0) { - if (expt < ndig || (f & 0x001) != 0) { - { if ((n = (ndig - 1)) > 0) { while (n > 16) {{ p->x = (zeroes); p->r = 16; q.z += 16; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} n -= 16; }{ p->x = (zeroes); p->r = n; q.z += n; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }}}} - } - } else if (expt <= 0) { - { p->x = ("0"); p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - { p->x = 0; p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - { if ((n = (-expt)) > 0) { while (n > 16) {{ p->x = (zeroes); p->r = 16; q.z += 16; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} n -= 16; }{ p->x = (zeroes); p->r = n; q.z += n; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} }} - { p->x = cp; p->r = ndig; q.z += ndig; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - } else { - { p->x = cp; p->r = expt; q.z += expt; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - cp += expt; - { p->x = ("."); p->r = 1; q.z += 1; p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - { p->x = cp; p->r = (ndig-expt); q.z += (ndig-expt); p++; if (++q.t >= 8) { if (g(fp, &q)) goto error; p = w; }} - } - } - } - } - - error: -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951004-1.c b/gcc/testsuite/gcc.c-torture/compile/951004-1.c deleted file mode 100644 index 1ca60819cdd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951004-1.c +++ /dev/null @@ -1,23 +0,0 @@ -typedef struct -{ - short v, h; -} S; - -S a; - -f (S pnt) -{ - S mpnt, mtp; - - (&pnt)->v -= 1; - mpnt = pnt; - mtp = a; - if (mtp.v != mpnt.v) - { - S tpnt; - - tpnt = mtp; - mtp = mpnt; - mpnt = tpnt; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951106-1.c b/gcc/testsuite/gcc.c-torture/compile/951106-1.c deleted file mode 100644 index 09cba20c1d0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951106-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f (double a, double b) -{ - g (a, 0, b); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951116-1.c b/gcc/testsuite/gcc.c-torture/compile/951116-1.c deleted file mode 100644 index 100d6902a72..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951116-1.c +++ /dev/null @@ -1,9 +0,0 @@ -f () -{ - long long i; - int j; - long long k = i = j; - - int inner () {return j + i;} - return k; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951128-1.c b/gcc/testsuite/gcc.c-torture/compile/951128-1.c deleted file mode 100644 index 5e4dc7093c8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951128-1.c +++ /dev/null @@ -1,5 +0,0 @@ -char a[]; -f (const int i) -{ - a[i] = 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951220-1.c b/gcc/testsuite/gcc.c-torture/compile/951220-1.c deleted file mode 100644 index 33e98f6221e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951220-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f (char *x) -{ - return (*x & 2) || (*x & 3); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/951222-1.c b/gcc/testsuite/gcc.c-torture/compile/951222-1.c deleted file mode 100644 index b8246f5fe81..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/951222-1.c +++ /dev/null @@ -1,15 +0,0 @@ -extern long long foo (); - -long long -sub1 () -{ - char junk[10000]; - register long long a, b, c; - - b = foo (); - - setjmp (); - a = foo (); - c = a - b; - return c; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960106-1.c b/gcc/testsuite/gcc.c-torture/compile/960106-1.c deleted file mode 100644 index c8228aab587..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960106-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f (a) -{ - return (a & 1) && !(a & 2 & 4); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960130-1.c b/gcc/testsuite/gcc.c-torture/compile/960130-1.c deleted file mode 100644 index ed8dab45988..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960130-1.c +++ /dev/null @@ -1,8 +0,0 @@ -int a[1]; - -int -main() -{ - extern int a[]; - return *a; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960201-1.c b/gcc/testsuite/gcc.c-torture/compile/960201-1.c deleted file mode 100644 index adc462389d2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960201-1.c +++ /dev/null @@ -1,5 +0,0 @@ -union foo -{ - char a; - int x[2]; -} __attribute__ ((transparent_union)); diff --git a/gcc/testsuite/gcc.c-torture/compile/960218-1.c b/gcc/testsuite/gcc.c-torture/compile/960218-1.c deleted file mode 100644 index 46fbf778524..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960218-1.c +++ /dev/null @@ -1,2 +0,0 @@ -#define X(x) x -int main() { return X(0/* *//* */); } diff --git a/gcc/testsuite/gcc.c-torture/compile/960220-1.c b/gcc/testsuite/gcc.c-torture/compile/960220-1.c deleted file mode 100644 index 766a066c449..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960220-1.c +++ /dev/null @@ -1,6 +0,0 @@ -f () -{ - unsigned long long int a = 0, b; - while (b > a) - ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960221-1.c b/gcc/testsuite/gcc.c-torture/compile/960221-1.c deleted file mode 100644 index 0e02496c104..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960221-1.c +++ /dev/null @@ -1,11 +0,0 @@ -struct s1 { int f1; }; - -struct s2 { - struct s1 a; - int f2; -}; - -foo (struct s2 *ptr) -{ - *ptr = (struct s2) {{}, 0}; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960319-1.c b/gcc/testsuite/gcc.c-torture/compile/960319-1.c deleted file mode 100644 index f3d95ab6e8e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960319-1.c +++ /dev/null @@ -1,10 +0,0 @@ -static void -f() -{ - long long a[2]; - int i; - if (g()) - if (h()) - ; - *a |= (long long)i << 65 ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960514-1.c b/gcc/testsuite/gcc.c-torture/compile/960514-1.c deleted file mode 100644 index 1d38cfd1a0b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960514-1.c +++ /dev/null @@ -1,12 +0,0 @@ -struct s { - unsigned long long t[5]; -}; - -void -f (struct s *d, unsigned long long *l) -{ - int i; - - for (i = 0; i < 5; i++) - d->t[i] += l[i]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960704-1.c b/gcc/testsuite/gcc.c-torture/compile/960704-1.c deleted file mode 100644 index 5a9d35cfd9a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960704-1.c +++ /dev/null @@ -1,10 +0,0 @@ -struct A { - double d; -}; - -struct A f (); - -main () -{ - struct A a = f(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/960829-1.c b/gcc/testsuite/gcc.c-torture/compile/960829-1.c deleted file mode 100644 index 8c6163dfaf0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/960829-1.c +++ /dev/null @@ -1,4 +0,0 @@ -f () -{ - g (0, 0.0, 0.0, 0.0, 0.0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961004-1.c b/gcc/testsuite/gcc.c-torture/compile/961004-1.c deleted file mode 100644 index 6407b625d66..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961004-1.c +++ /dev/null @@ -1,37 +0,0 @@ -void -f1 (o1, o2, o3, i, j, k) - long long *o1, *o2, *o3; - int i, j, k; -{ - while (--i) - o1[i] = o2[j >>= 1] + o3[k >>= 1]; -} - -void -f2 (o1, o2, o3, i, j, k) - long long *o1, *o2, *o3; - int i, j, k; -{ - while (--i) - o1[i] = o2[j >>= 1] - o3[k >>= 1]; -} - -void -f3 (o1, o2, o3, i, j, k) - long long *o1, *o3; - unsigned *o2; - int i, j, k; -{ - while (--i) - o1[i] = o2[j >>= 1] + o3[k >>= 1]; -} - -void -f4 (o1, o2, o3, i, j, k) - long long *o1, *o2; - unsigned *o3; - int i, j, k; -{ - while (--i) - o1[i] = o2[j >>= 1] - o3[k >>= 1]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961010-1.c b/gcc/testsuite/gcc.c-torture/compile/961010-1.c deleted file mode 100644 index d6145bc4233..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961010-1.c +++ /dev/null @@ -1 +0,0 @@ -double f (double x) { return x == 0 ? x : 0.0; } diff --git a/gcc/testsuite/gcc.c-torture/compile/961019-1.c b/gcc/testsuite/gcc.c-torture/compile/961019-1.c deleted file mode 100644 index 0ea6ec6e280..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961019-1.c +++ /dev/null @@ -1,11 +0,0 @@ -char _hex_value[256]; - -void -hex_init () -{ - int i; - for (i = 0; i < 256; i++) - _hex_value[i] = 99; - for (i = 0; i < 10; i++) - _hex_value['0' + i] = i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961031-1.c b/gcc/testsuite/gcc.c-torture/compile/961031-1.c deleted file mode 100644 index ea8718f763b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961031-1.c +++ /dev/null @@ -1,16 +0,0 @@ -struct s { - double d; -} sd; - -struct s g () __attribute__ ((const)); - -struct s -g () -{ - return sd; -} - -f () -{ - g (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961126-1.c b/gcc/testsuite/gcc.c-torture/compile/961126-1.c deleted file mode 100644 index f3b6af55595..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961126-1.c +++ /dev/null @@ -1,107 +0,0 @@ -int *p; - -main() -{ - int i = sub (); - - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - i = -i; - if (*p != i) - goto quit; - - i = -i; -quit: - sub2 (i); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961203-1.c b/gcc/testsuite/gcc.c-torture/compile/961203-1.c deleted file mode 100644 index 0f066ace617..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961203-1.c +++ /dev/null @@ -1,14 +0,0 @@ -struct s { - char a[0x32100000]; - int x:30, y:30; -}; - -int -main () -{ - struct s* p; - - p = (struct s*) 0; - if (p->x == p->y) - exit (1); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/961203-1.x b/gcc/testsuite/gcc.c-torture/compile/961203-1.x deleted file mode 100644 index e705ffe167a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/961203-1.x +++ /dev/null @@ -1,17 +0,0 @@ -# The structure is too large for the xstormy16 - won't fit in 16 bits. - -if { [istarget "xstormy16-*-*"] } { - return 1; -} - -if { [istarget "h8300-*-*"] } { - return 1 -} - -# Array 'a' in this test is too large to fit in 64K. - -if { [istarget "m6811-*-*"] || [istarget "m6812-*-*"]} { - return 1 -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/970206-1.c b/gcc/testsuite/gcc.c-torture/compile/970206-1.c deleted file mode 100644 index 95196cd6a54..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/970206-1.c +++ /dev/null @@ -1,13 +0,0 @@ -struct Rect -{ - int iA; - int iB; - int iC; - int iD; -}; - -void -f (int * const this, struct Rect arect) -{ - g (*this, arect); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/970214-1.c b/gcc/testsuite/gcc.c-torture/compile/970214-1.c deleted file mode 100644 index 508ea9e92b6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/970214-1.c +++ /dev/null @@ -1,3 +0,0 @@ -#include <stddef.h> -#define L 264 -wchar_t c = L'X'; diff --git a/gcc/testsuite/gcc.c-torture/compile/980329-1.c b/gcc/testsuite/gcc.c-torture/compile/980329-1.c deleted file mode 100644 index d11b49b01c7..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980329-1.c +++ /dev/null @@ -1,72 +0,0 @@ -typedef unsigned long int size_t; -struct re_pattern_buffer - { - unsigned char *buffer; - unsigned long int used; - }; -struct re_registers - { - int *start; - }; - -static const char **regstart, **regend; -static const char **old_regend; - -static int -re_match_2_internal (struct re_pattern_buffer *bufp, - struct re_registers *regs) -{ - unsigned char *p = bufp->buffer; - unsigned char *pend = p + bufp->used; - - for (;;) - { - int highest_active_reg = 1; - if (bufp) - { - int i; - for (i = 1;; i++) - regs->start[i] = 0; - } - - switch ((unsigned int) *p++) - { - case 1: - { - unsigned char r = *p; - if (r) - highest_active_reg = r; - } - if (p + 2 == pend) - { - char is_a_jump_n = 0; - int mcnt = 0; - unsigned char *p1; - - p1 = p + 2; - switch (*p1++) - { - case 2: - is_a_jump_n = 1; - case 1: - do { do { mcnt = *p1; } while (0); p1 += 2; } while (0); - if (is_a_jump_n) - p1 = 0; - } - - if (mcnt && *p1 == 0) - { - unsigned r; - for (r = 0; r < (unsigned) *p + (unsigned) *(p + 1); r++) - { - if (regend[0] >= regstart[r]) - regend[r] = old_regend[r]; - } - do { while (0 < highest_active_reg + 1) { } } while (0); - } - } - } - } - - return -1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980408-1.c b/gcc/testsuite/gcc.c-torture/compile/980408-1.c deleted file mode 100644 index 09bf430406e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980408-1.c +++ /dev/null @@ -1,129 +0,0 @@ -typedef struct _RunlengthPacket -{ - unsigned short - red, - green, - blue, - length; - unsigned short - index; -} RunlengthPacket; -typedef struct _Image -{ - int - status, - temporary; - char - filename[1664 ]; - long int - filesize; - int - pipe; - char - magick[1664 ], - *comments, - *label, - *text; - unsigned int - matte; - unsigned int - columns, - rows, - depth; - unsigned int - scene, - number_scenes; - char - *montage, - *directory; - unsigned int - colors; - double - gamma; - float - x_resolution, - y_resolution; - unsigned int - mean_error_per_pixel; - double - normalized_mean_error, - normalized_maximum_error; - unsigned long - total_colors; - char - *signature; - unsigned int - packets, - runlength, - packet_size; - unsigned char - *packed_pixels; - long int - magick_time; - char - magick_filename[1664 ]; - unsigned int - magick_columns, - magick_rows; - char - *geometry, - *page; - unsigned int - dispose, - delay, - iterations; - unsigned int - orphan; - struct _Image - *previous, - *list, - *next; -} Image; - Image *MinifyImage(Image *image) -{ - Image - *minified_image; - register RunlengthPacket - *q, - *s, - *s0, - *s1, - *s2, - *s3; - register unsigned int - x; - unsigned int - blue, - green, - red; - unsigned long - total_matte, - total_blue, - total_green, - total_red; - unsigned short - index; - for (x=0; x < (image->columns-1); x+=2) - { - total_red=0; - total_green=0; - total_blue=0; - total_matte=0; - s=s0; - total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; - s=s1; - total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; - s=s2; - total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 15 )*(s->red); total_green+=( 15 )*(s->green); total_blue+=( 15 )*(s->blue); total_matte+=( 15 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; - s=s3; - total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 7 )*(s->red); total_green+=( 7 )*(s->green); total_blue+=( 7 )*(s->blue); total_matte+=( 7 )*(s->index); s++; ; total_red+=( 3 )*(s->red); total_green+=( 3 )*(s->green); total_blue+=( 3 )*(s->blue); total_matte+=( 3 )*(s->index); s++; ; - red=(unsigned short) ((total_red+63) >> 7); - green=(unsigned short) ((total_green+63) >> 7); - blue=(unsigned short) ((total_blue+63) >> 7); - index=(unsigned short) ((total_matte+63) >> 7); - if ((red == q->red) && (green == q->green) && (blue == q->blue) && - (index == q->index) && ((int) q->length < 65535L )) - q->length++; - } - return(minified_image); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980504-1.c b/gcc/testsuite/gcc.c-torture/compile/980504-1.c deleted file mode 100644 index 7b757ccd2e8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980504-1.c +++ /dev/null @@ -1,28 +0,0 @@ -typedef struct _geom_elem { - double coeffs[6]; -} pGeomDefRec, *pGeomDefPtr; -typedef struct _mpgeombanddef { - int yOut; - int in_width; -} mpGeometryBandRec, *mpGeometryBandPtr; -typedef void *pointer; -typedef unsigned char CARD8; -typedef CARD8 BytePixel; -void BiGL_B (OUTP,srcimg,width,sline,pedpvt,pvtband) pointer OUTP; -pointer *srcimg; -register int width; -int sline; -pGeomDefPtr pedpvt; mpGeometryBandPtr pvtband; -{ - register float s, t, st; - register int isrcline,isrcpix; - register int srcwidth = pvtband->in_width - 1; - register BytePixel val; - register BytePixel *ptrIn, *ptrJn; - register double a = pedpvt->coeffs[0]; - register double c = pedpvt->coeffs[2]; - register double srcpix = a * ((double)(0.0000)) + pedpvt->coeffs[1] * (pvtband->yOut + ((double)(0.0000)) ) + pedpvt->coeffs[4]; - register double srcline = c * ((double)(0.0000)) + pedpvt->coeffs[3] * (pvtband->yOut + ((double)(0.0000)) ) + pedpvt->coeffs[5]; - if ( (isrcpix >= 0) && (isrcpix < srcwidth) ) - val = ptrIn[isrcpix] * ((float)1. - s - t + st) + ptrIn[isrcpix+1] * (s - st) + ptrJn[isrcpix] * (t - st) + ptrJn[isrcpix+1] * (st) + (float)0.5 ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980506-1.c b/gcc/testsuite/gcc.c-torture/compile/980506-1.c deleted file mode 100644 index 6ef7796261f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980506-1.c +++ /dev/null @@ -1,63 +0,0 @@ -unsigned char TIFFFax2DMode[20][256]; -unsigned char TIFFFax2DNextState[20][256]; -unsigned char TIFFFaxUncompAction[20][256]; -unsigned char TIFFFaxUncompNextState[20][256]; -unsigned char TIFFFax1DAction[230][256]; -unsigned char TIFFFax1DNextState[230][256]; - -typedef struct tableentry { - unsigned short length; - unsigned short code; - short runlen; -} tableentry; - -extern tableentry TIFFFaxWhiteCodes[]; -extern tableentry TIFFFaxBlackCodes[]; - -static short sp_data, sp_bit; - -static unsigned char -fetchByte (inbuf) - -unsigned char **inbuf; - -{ - unsigned char byte = **inbuf; - (*inbuf)++; - return (byte); -} - -static int -decode_white_run (inbuf) - -unsigned char **inbuf; - -{ - short state = sp_bit; - short action; - int runlen = 0; - - for (;;) - { - if (sp_bit == 0) - { - nextbyte: - sp_data = fetchByte (inbuf); - } - - action = TIFFFax1DAction[state][sp_data]; - state = TIFFFax1DNextState[state][sp_data]; - if (action == 0 ) - goto nextbyte; - if (action == 1 ) - return (-1 ); - if (action == 210 ) - return (-3 ); - sp_bit = state; - action = (TIFFFaxWhiteCodes[ action - 2 ].runlen) ; - runlen += action; - if (action < 64) - return (runlen); - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/980506-1.x b/gcc/testsuite/gcc.c-torture/compile/980506-1.x deleted file mode 100644 index 056ef463835..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980506-1.x +++ /dev/null @@ -1,10 +0,0 @@ -# The arrays are too large for the xstormy16 - won't fit in 16 bits. -if { [istarget "xstormy16-*-*"] } { - return 1; -} - -if { [istarget "h8300-*-*"] } { - return 1; -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/980506-2.c b/gcc/testsuite/gcc.c-torture/compile/980506-2.c deleted file mode 100644 index 6f6fe19270c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980506-2.c +++ /dev/null @@ -1,89 +0,0 @@ -/* - * inspired by glibc-2.0.6/sysdeps/libm-ieee754/s_nextafterf.c - * - * gcc -O2 -S -DOP=+ gives faddp %st(1),%st - * gcc -O2 -S -DOP=* gives fmulp %st(1),%st - * gcc -O2 -S -DOP=- gives fsubrp %st(1),%st - * gcc -O2 -S -DOP=/ gives fdivrp %st(1),%st - */ - -#ifndef OP -#define OP * -#endif - -typedef int int32_t __attribute__ ((__mode__ ( __SI__ ))) ; -typedef unsigned int u_int32_t __attribute__ ((__mode__ ( __SI__ ))) ; - -typedef union -{ - float value; - u_int32_t word; -} ieee_float_shape_type; - -float __nextafterf(float x, float y) -{ - int32_t hx,hy,ix,iy; - - { - ieee_float_shape_type gf_u; - gf_u.value = x; - hx = gf_u.word; - } - { - ieee_float_shape_type gf_u; - gf_u.value = y; - hy = gf_u.word; - } - ix = hx&0x7fffffff; - iy = hy&0x7fffffff; - - if ( ix > 0x7f800000 || iy > 0x7f800000 ) - return x+y; - if (x == y) return x; - if (ix == 0) - { - { - ieee_float_shape_type sf_u; - sf_u.word = (hy&0x80000000) | 1; - x = sf_u.value; - } - y = x*x; - if (y == x) return y; else return x; - } - if (hx >= 0) - { - if (hx > hy) - hx -= 1; - else - hx += 1; - } - else - { - if (hy >= 0 || hx > hy) - hx -= 1; - else - hx += 1; - } - hy = hx & 0x7f800000; - if (hy >= 0x7f800000) - return x+x; - if (hy < 0x00800000) - { - y = x OP x; - if (y != x) - { - ieee_float_shape_type sf_u; - sf_u.word = hx; - y = sf_u.value; - return y; - } - } - { - ieee_float_shape_type sf_u; - sf_u.word = hx; - x = sf_u.value; - } - return x; -} - - diff --git a/gcc/testsuite/gcc.c-torture/compile/980511-1.c b/gcc/testsuite/gcc.c-torture/compile/980511-1.c deleted file mode 100644 index f1bac0c434a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980511-1.c +++ /dev/null @@ -1,20 +0,0 @@ -typedef unsigned int __kernel_dev_t; -typedef __kernel_dev_t dev_t; -struct ustat { -}; -typedef unsigned int kdev_t; -static inline kdev_t to_kdev_t(int dev) -{ - int major, minor; - major = (dev >> 8); - minor = (dev & 0xff); - return ((( major ) << 22 ) | ( minor )) ; -} -struct super_block { -}; -struct super_block * get_super (kdev_t dev); -int sys_ustat(dev_t dev, struct ustat * ubuf) -{ - struct super_block *s; - s = get_super(to_kdev_t(dev)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980701-1.c b/gcc/testsuite/gcc.c-torture/compile/980701-1.c deleted file mode 100644 index 82dd16d6be2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980701-1.c +++ /dev/null @@ -1,9 +0,0 @@ - -short -func(void) -{ - unsigned char x, y; - - return y | x << 8; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/980706-1.c b/gcc/testsuite/gcc.c-torture/compile/980706-1.c deleted file mode 100644 index 214f36d5311..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980706-1.c +++ /dev/null @@ -1,10 +0,0 @@ -void g(long long); - -long long f(long long v1, long long v2, long long v3, long long v4) -{ - g(v1); - g(v2); - g(v3); - g(v4); - return v1 && v2; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980726-1.c b/gcc/testsuite/gcc.c-torture/compile/980726-1.c deleted file mode 100644 index 3d4daa203de..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980726-1.c +++ /dev/null @@ -1,10 +0,0 @@ -static __inline__ unsigned char BCD(unsigned char binval) -{ - if (binval > 99) return 0x99; - return (((binval/10) << 4) | (binval%10)); -} - -void int1a(unsigned char i) -{ - (*((unsigned char *)1)) = BCD(i); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980729-1.c b/gcc/testsuite/gcc.c-torture/compile/980729-1.c deleted file mode 100644 index 973372b2ea3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980729-1.c +++ /dev/null @@ -1,14 +0,0 @@ -static int -regex_compile () -{ - int c, c1; - char str[6 + 1]; - c1 = 0; - for (;;) - { - do { } while (0) ; - if (c1 == 6 ) - break; - str[c1++] = c; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980816-1.c b/gcc/testsuite/gcc.c-torture/compile/980816-1.c deleted file mode 100644 index c56b6c9b92c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980816-1.c +++ /dev/null @@ -1,51 +0,0 @@ -typedef unsigned int size_t; -typedef void *XtPointer; - -typedef struct _WidgetRec *Widget; -typedef struct _WidgetClassRec *WidgetClass; - -extern WidgetClass commandWidgetClass; - -typedef void (*XtCallbackProc)( - Widget , - XtPointer , - XtPointer -); - -extern const char XtStrings[]; - - -typedef struct -{ - char *Name, - *Label; - XtCallbackProc Callback; - XtPointer ClientData; - Widget W; -} DialogButtonType, *DialogButtonTypePtr; - - -Widget AddButtons(Widget Parent, Widget Top, - DialogButtonTypePtr Buttons, size_t Count) -{ - int i; - - for (i = 0; i < Count; i++) - { - if (!Buttons[i].Label) - continue; - Buttons[i].W = XtVaCreateManagedWidget(Buttons[i].Name, - commandWidgetClass, - Parent, - ((char*)&XtStrings[429]) , Buttons[i].Label, - "fromHoriz" , i ? Buttons[i-1].W : ((void *)0) , - "fromVert" , Top, - "resizable" , 1 , - ((void *)0) ); - - XtAddCallback(((char*)&XtStrings[136]), - Buttons[i].Callback, Buttons[i].ClientData); - } - return(Buttons[Count-1].W); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/980821-1.c b/gcc/testsuite/gcc.c-torture/compile/980821-1.c deleted file mode 100644 index 9eb1ac4ca1c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980821-1.c +++ /dev/null @@ -1,15 +0,0 @@ -typedef int __int32_t; -int __kernel_rem_pio2(int prec) -{ - __int32_t i, jz; - double fw, fq[20]; - switch(prec) { - case 2: - fw = 0.0; - case 3: - for (i=jz;i>0;i--) { - fw = fq[i-1] +fq[i]; - fq[i-1] = fw; - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/980825-1.c b/gcc/testsuite/gcc.c-torture/compile/980825-1.c deleted file mode 100644 index 34e35bf83c4..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/980825-1.c +++ /dev/null @@ -1,30 +0,0 @@ -typedef enum { FALSE, TRUE } boolean; -enum _errorTypes { FATAL = 1, WARNING = 2, PERROR = 4 }; -typedef struct _optionValues { - struct _include { - boolean classNames; - boolean defines; - boolean enumerators; - } include; -} optionValues; -extern optionValues Option; -static void applyTagInclusionList( list ) - const char *const list; -{ - boolean mode = TRUE; - const char *p; - for (p = list ; *p != '\0' ; ++p) - switch (*p) - { - case '=': - clearTagList(); - mode = TRUE; - break; - case '+': mode = TRUE; break; - case '-': mode = FALSE; break; - case 'c': Option.include.classNames = mode; break; - case 'd': Option.include.defines = mode; break; - case 'e': Option.include.enumerators = mode; break; - default: error(FATAL, "-i: Invalid tag option '%c'", *p); break; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981001-1.c b/gcc/testsuite/gcc.c-torture/compile/981001-1.c deleted file mode 100644 index d7cf0dc64b0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981001-1.c +++ /dev/null @@ -1,18 +0,0 @@ -unsigned short code = 0x0000; -unsigned short low = 0x4000; -unsigned short high = 0xb000; - -int main (void) -{ - if ( - (high & 0x8000) != (low & 0x8000) - && ( low & 0x4000) == 0x4000 - && (high & 0x4000) == 0 - ) - { - code ^= 0x4000; - low |= 0x4000; - } - - exit (0); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981001-2.c b/gcc/testsuite/gcc.c-torture/compile/981001-2.c deleted file mode 100644 index 9ade1d92aef..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981001-2.c +++ /dev/null @@ -1,12 +0,0 @@ -#define weak_alias(func, aliasname) \ - extern __typeof (func) aliasname __attribute__ ((weak, alias (#func))); - -#define add3(d, m, c) ((d) + (m) + (c)) - -int -__add3(int d, int m, int c) -{ - return d + m + c; -} - -weak_alias (__add3, add3) diff --git a/gcc/testsuite/gcc.c-torture/compile/981001-3.c b/gcc/testsuite/gcc.c-torture/compile/981001-3.c deleted file mode 100644 index 5f6458757ac..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981001-3.c +++ /dev/null @@ -1,14 +0,0 @@ -#define P(a, b) P1(a,b) -#define P1(a,b) a##b - -#define FLT_MIN_EXP (-125) -#define DBL_MIN_EXP (-1021) - -#define MIN_EXP P(FLT,_MIN_EXP) - -#define FLT FLT -int f1 = MIN_EXP; - -#undef FLT -#define FLT DBL -int f2 = MIN_EXP; diff --git a/gcc/testsuite/gcc.c-torture/compile/981001-4.c b/gcc/testsuite/gcc.c-torture/compile/981001-4.c deleted file mode 100644 index dd3df9cce4b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981001-4.c +++ /dev/null @@ -1,14 +0,0 @@ -#define P(a,b) P1(a,b) -#define P1(a,b) a##b - -#define ONCE(x, y) (x ?: (x = y())) -#define PREFIX - -extern int P(PREFIX, init) (void); - -int -fun(void) -{ - static int memo; - return ONCE(memo, P(PREFIX, init)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981006-1.c b/gcc/testsuite/gcc.c-torture/compile/981006-1.c deleted file mode 100644 index 6af6d9a8ea5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981006-1.c +++ /dev/null @@ -1,50 +0,0 @@ -/* Test that tablejump insns are correctly handled. If the compiler - loses track of the jump targets, it will report that x and y can be - used uninitialized. - - This is broken in egcs 1998/10/06 for mips in pic mode. */ -/* { dg-do compile } */ - -int foo (int a, int b) -{ - __label__ z; - int x; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */ - int y; /* { dg-bogus "warning: `.' might be used uninitialized in this function" } */ - static void *p; - - switch (a) { - case 2: - x = 4; - break; - case 4: - x = 6; - break; - case 8: case 10: case 13: case 11: case 17: case 19: - x = 7; - break; - default: - x = -1; - break; - } - switch (b) { - case 2: - y = 4; - break; - case 4: - y = 6; - break; - case 8: case 10: case 13: case 11: case 17: case 19: - y = 7; - break; - default: - y = -1; - break; - } - z: - p = &&z; - return x * y; -} -int main (int argc, char *argv[]) -{ - return 1 == foo (argc, argc + 1); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981006-1.x b/gcc/testsuite/gcc.c-torture/compile/981006-1.x deleted file mode 100644 index a27a67bcaee..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981006-1.x +++ /dev/null @@ -1,20 +0,0 @@ -# For MIPS at least, pic is needed to trigger the problem. -if { [istarget rs6000-*-aix*] - || [istarget powerpc*-*-aix*] - || [istarget arm*-*-*] - || [istarget xscale-*-*] - || [istarget strongarm*-*-*] - || [istarget fr30-*-*] - || [istarget sh-*-hms] - || [istarget sh-*-coff] - || [istarget h8300*-*-*] - || [istarget mn10200*-*-*] - || [istarget cris-*-elf*] - || [istarget cris-*-aout*] - || [istarget mmix-*-*] -} { - set options "-Wuninitialized -Werror" -} else { - set options "-Wuninitialized -Werror -fpic" -} -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/981007-1.c b/gcc/testsuite/gcc.c-torture/compile/981007-1.c deleted file mode 100644 index d41400b7832..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981007-1.c +++ /dev/null @@ -1,21 +0,0 @@ -extern double fabs (double); -extern double sqrt (double); - -typedef struct complexm { - double re,im; -} complex; - -static complex -setCom (double r, double i) -{ - complex ct; - ct.re=fabs(r)<1E-300?0.0:r; - ct.im=fabs(i)<1E-300?0.0:i; - return ct; -} - -static complex -csqrt_crash (double x) -{ - return (x>=0) ? setCom(sqrt(x),0) : setCom(0,sqrt(-x)); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981022-1.c b/gcc/testsuite/gcc.c-torture/compile/981022-1.c deleted file mode 100644 index 6256673804a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981022-1.c +++ /dev/null @@ -1,9 +0,0 @@ -/* This tests a combination of two gcc extensions. Omitting the middle - operand of ?: and using ?: as an lvalue. */ -int x, y; - -int main () -{ - (x ?: y) = 0; - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981022-1.x b/gcc/testsuite/gcc.c-torture/compile/981022-1.x deleted file mode 100644 index f41cdc29913..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981022-1.x +++ /dev/null @@ -1,2 +0,0 @@ -set torture_compile_xfail "*-*-*" -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/981107-1.c b/gcc/testsuite/gcc.c-torture/compile/981107-1.c deleted file mode 100644 index 987ec180f9f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981107-1.c +++ /dev/null @@ -1,9 +0,0 @@ -unsigned long seed(void) -{ - unsigned long u; - - call(); - - u = 26107 * (unsigned long)&u; - return u; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981223-1.c b/gcc/testsuite/gcc.c-torture/compile/981223-1.c deleted file mode 100644 index d207ff10bb3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981223-1.c +++ /dev/null @@ -1,8 +0,0 @@ -__complex__ float -func (__complex__ float x) -{ - if (__real__ x == 0.0) - return 1.0; - else - return 0.0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/981223-1.x b/gcc/testsuite/gcc.c-torture/compile/981223-1.x deleted file mode 100644 index f8d2aa6f938..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/981223-1.x +++ /dev/null @@ -1,20 +0,0 @@ -# The problem on IA-64 is that the assembler emits -# -# Warning: Additional NOP may be necessary to workaround Itanium -# processor A/B step errata -# -# This can be fixed by adding "-mb-step" to the command line, which -# does in fact add the extra nop, if someone can tell me how to do -# that for a c-torture compile test. - -set torture_eval_before_compile { - - set compiler_conditional_xfail_data { - "need -mb-step" \ - "ia64-*-*" \ - { "-O2" "-O3" "-Os" } \ - { "" } - } -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/990107-1.c b/gcc/testsuite/gcc.c-torture/compile/990107-1.c deleted file mode 100644 index a123ce9cbf3..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990107-1.c +++ /dev/null @@ -1,7 +0,0 @@ -static int -java_double_finite (d) - double d; -{ - long long *ip = (long long *) &d; - return (*ip & 0x7ff0000000000000LL ) != 0x7ff0000000000000LL ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990117-1.c b/gcc/testsuite/gcc.c-torture/compile/990117-1.c deleted file mode 100644 index dda52205988..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990117-1.c +++ /dev/null @@ -1,13 +0,0 @@ -static void -__bb_init_prg () -{ - const char *p; - - { - unsigned long l; - - (__extension__ (__builtin_constant_p (p) && __builtin_constant_p (l) - ? 5 : 2)); - } - -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990203-1.c b/gcc/testsuite/gcc.c-torture/compile/990203-1.c deleted file mode 100644 index 2c69a8fe086..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990203-1.c +++ /dev/null @@ -1,7 +0,0 @@ -int -f (f) - float f; -{ - long long *ip = (long long *) &f; - return (*ip & 0x7ff0000000000000LL ) != 0x7ff0000000000000LL ; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990517-1.c b/gcc/testsuite/gcc.c-torture/compile/990517-1.c deleted file mode 100644 index c738d4be760..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990517-1.c +++ /dev/null @@ -1,30 +0,0 @@ -/* Extracted from the sdm module in perl. */ -typedef struct { - char *dptr; - int dsize; -} datum; -extern long sdbm_hash (char *, int) ; -extern void sdbm__putpair (char *, datum, datum) ; -void -sdbm__splpage (char *pag, char *New, long int sbit) -{ - datum key; - datum val; - register int n; - register int off = 1024 ; - char cur[1024 ]; - register short *ino = (short *) cur; - (void) memcpy(cur, pag, 1024 ); - (void) ({ void *__s = ( pag ); __builtin_memset ( __s , '\0', 1024 ) ; __s; }); - (void) ({ void *__s = ( New ); __builtin_memset ( __s , '\0', 1024 ) ; __s; }); - n = ino[0]; - for (ino++; n > 0; ino += 2) { - key.dptr = cur + ino[0]; - key.dsize = off - ino[0]; - val.dptr = cur + ino[1]; - val.dsize = ino[0] - ino[1]; - (void) sdbm__putpair ((sdbm_hash(( key ).dptr, ( key ).dsize) & sbit) ? New : pag, key, val); - off = ino[1]; - n -= 2; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990519-1.c b/gcc/testsuite/gcc.c-torture/compile/990519-1.c deleted file mode 100644 index 9c116178230..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990519-1.c +++ /dev/null @@ -1,10 +0,0 @@ - typedef int gboolean; - - typedef struct{ - gboolean names : 1; - gboolean types : 1; - } ParamOptions; - - int p_param(ParamOptions* o){ - return o->types && o->names; - } diff --git a/gcc/testsuite/gcc.c-torture/compile/990523-1.c b/gcc/testsuite/gcc.c-torture/compile/990523-1.c deleted file mode 100644 index 5ab61f36c65..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990523-1.c +++ /dev/null @@ -1,30 +0,0 @@ -extern float decwin[512+32]; - -int synth_1to1(float *bandPtr,int channel,unsigned char *out,int *pnt) -{ - static const int step = 2; - short *samples = (short *) (out+*pnt); - - float *b0; - int clip = 0; - int bo1; - - { - register int j; - float *window = decwin + 16 - bo1; - for (j=15;j;j--,b0-=0x20,window-=0x10,samples+=step) - { - float sum; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - sum -= *(--window) * *b0++; - - if( ( sum ) > 32767.0) *( samples ) = 0x7fff; ( clip )++; ; - } - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990527-1.c b/gcc/testsuite/gcc.c-torture/compile/990527-1.c deleted file mode 100644 index 4744030307a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990527-1.c +++ /dev/null @@ -1,37 +0,0 @@ -typedef struct { - int dummy; - int width, height; -} XWindowAttributes; - -typedef struct { - short x, y; -} XPoint; - -extern unsigned int ya_random (void); -extern int XDrawPoints(XPoint*, int); - -static int iterations, offset; -static int xsym, ysym; - -static void -hurm (void) -{ - XWindowAttributes xgwa; - int xlim, ylim, x, y, i; - XPoint points [4]; - - - for (i = 0; i < iterations; i++) - { - int j = 0; - j++; - if (xsym) - { - points [j].x = xlim - x; - j++; - } - points [j].x = x; - j++; - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/990617-1.c b/gcc/testsuite/gcc.c-torture/compile/990617-1.c deleted file mode 100644 index 1404b793505..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990617-1.c +++ /dev/null @@ -1,17 +0,0 @@ - -int main() -{ - do { - long l; - long *p = &l; - - *p = 0x0000000070000000L; - p += 2; - { - unsigned int *addr = (unsigned int *)0x70000000; - printf("%d, %d\n", addr[1], addr[0]); - } - - } while (1); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/990617-1.x b/gcc/testsuite/gcc.c-torture/compile/990617-1.x deleted file mode 100644 index b326395523b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990617-1.x +++ /dev/null @@ -1,7 +0,0 @@ -# 0x70000000 is too large a constant to become a pointer on xstormy16. - -if { [istarget "xstormy16-*-*"] } { - return 1; -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/990625-1.c b/gcc/testsuite/gcc.c-torture/compile/990625-1.c deleted file mode 100644 index 97a2331c7a5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990625-1.c +++ /dev/null @@ -1,12 +0,0 @@ -#define __USE_STRING_INLINES -#include <string.h> - -void test() -{ - char *p, *a; - const char *s; - - while ( (s = a) ) - p = strcpy(strcpy(p,"/"), s); -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/990625-2.c b/gcc/testsuite/gcc.c-torture/compile/990625-2.c deleted file mode 100644 index 92c33742b85..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990625-2.c +++ /dev/null @@ -1,12 +0,0 @@ -void -broken030599(int *n) -{ - int i, x; - for (i = 0; i < 32; i++) { - x=0; - x++; - if (i & 4) - x++; - x++; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990801-1.c b/gcc/testsuite/gcc.c-torture/compile/990801-1.c deleted file mode 100644 index d35ec87b948..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990801-1.c +++ /dev/null @@ -1,26 +0,0 @@ -extern int getch(); -extern int class(); - -int -token() -{ - int state = 1; - - while (1) { - int c=0; - c = getch(); - switch (state) { - case 1: break; - case 4: break; - case 5: break; - case 6: - { - switch (class(c)) { - default: break; - } - } break; - case 7: break; - } - } -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/990801-2.c b/gcc/testsuite/gcc.c-torture/compile/990801-2.c deleted file mode 100644 index 0a575ea17aa..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990801-2.c +++ /dev/null @@ -1,11 +0,0 @@ -void f() -{ - extern char* p; - int ch; - while (!(ch = 0)) { - if ((ch == 0) || (ch == 2)) { - break; - } - *p = 0; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990829-1.c b/gcc/testsuite/gcc.c-torture/compile/990829-1.c deleted file mode 100644 index 2252821938e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990829-1.c +++ /dev/null @@ -1,13 +0,0 @@ -struct x -{ - int a:16; - int b:16; - int c; -}; - -bar() -{ - struct x y; - y.b = 1 < y.a; - foo(&y); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990913-1.c b/gcc/testsuite/gcc.c-torture/compile/990913-1.c deleted file mode 100644 index cad31a02203..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990913-1.c +++ /dev/null @@ -1,10 +0,0 @@ - -int f() -{ - unsigned char hrs, min; - - min = ((min / 10) << 4) + min % 10; - hrs = ((hrs / 10) << 4) + hrs % 10; - - return hrs + min; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/990928-1.c b/gcc/testsuite/gcc.c-torture/compile/990928-1.c deleted file mode 100644 index 5658e360567..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/990928-1.c +++ /dev/null @@ -1,10 +0,0 @@ -/* Make sure that debug information can be generated - for inline functions containing incomplete type - declarations. */ -inline int foo (void) -{ - struct imcomplete1 * ptr1; - union incomplete2 * ptr2; - enum incomplete3 * ptr3; - return 1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991008-1.c b/gcc/testsuite/gcc.c-torture/compile/991008-1.c deleted file mode 100644 index ba668fe25b2..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991008-1.c +++ /dev/null @@ -1,23 +0,0 @@ -typedef struct { - int x; -} FILE; -extern void fputs (const char *, FILE *); - -int mView; -void foo (FILE * out, int aIndent) -{ - if (0 != mView) { - aIndent++; - aIndent--; - { - int __t = aIndent; - while (--__t >= 0) - fputs (" ", out); - } - - } { - int __t = aIndent; - while (--__t >= 0) - fputs (" ", out); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991026-1.c b/gcc/testsuite/gcc.c-torture/compile/991026-1.c deleted file mode 100644 index 191742112bd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991026-1.c +++ /dev/null @@ -1,13 +0,0 @@ -void something_f(float); - -int foo(void) -{ - union - { - float f; - double d; - } u, *pu = &u; - - u.f = 1.0; - something_f(u.f); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991026-2.c b/gcc/testsuite/gcc.c-torture/compile/991026-2.c deleted file mode 100644 index bb358f411ec..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991026-2.c +++ /dev/null @@ -1,33 +0,0 @@ -typedef int __pid_t; -extern __pid_t fork (void) ; -extern int printf (__const char *__restrict __format, ...) ; -extern char *strerror (int __errnum) ; -extern int errno; -extern int *__errno_location (void) __attribute__ ((__const__)); -extern void _exit (int __status) __attribute__ ((__noreturn__)); -extern void exit (int __status) __attribute__ ((__noreturn__)); -extern int close (int __fd) ; -extern int dup (int __fd) ; -extern int open (__const char *__file, int __oflag, ...) ; - - -char myname[]="foo"; - -detach() -{ - switch(fork()) { - case -1: - printf("%s: Error: fork - %s\n",myname, strerror((*__errno_location ()) )); - exit(255); - case 0: - - close(0); - close(1); - close(2); - dup(dup(open("/dev/null", 02 ))); - return; - default: - - _exit(0); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991127-1.c b/gcc/testsuite/gcc.c-torture/compile/991127-1.c deleted file mode 100644 index 86098d883a5..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991127-1.c +++ /dev/null @@ -1,12 +0,0 @@ - -extern void foo (int *); - -static void bar (char *buf) -{ - int a; - foo (&a); - while (a > 0) { - *buf++ = '0'; - a--; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991202-1.c b/gcc/testsuite/gcc.c-torture/compile/991202-1.c deleted file mode 100644 index cc4f478f520..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991202-1.c +++ /dev/null @@ -1,18 +0,0 @@ -extern float A[], B[]; -extern float MAXNUMF; -float chbevlf(float, float *, int); -float expf(float), i1f(float), logf(float), sqrtf(float); - -float k1f(float xx) -{ - float x, y; - - x = xx; - if( x <= 2.0 ) - { - y = x * x - 2.0; - y = logf( 0.5f * x ) * i1f(x) + chbevlf( y, A, 7 ) / x; - return( y ); - } - return( expf(-x) * chbevlf( (float)(8.0/x - 2.0), B, 10 ) / sqrtf(x) ); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991208-1.c b/gcc/testsuite/gcc.c-torture/compile/991208-1.c deleted file mode 100644 index 1bee1e84b37..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991208-1.c +++ /dev/null @@ -1,4 +0,0 @@ -void fn (char *ptr) -{ - void *p = ptr - 8 - 4; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991213-1.c b/gcc/testsuite/gcc.c-torture/compile/991213-1.c deleted file mode 100644 index 4803d13915f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991213-1.c +++ /dev/null @@ -1,13 +0,0 @@ -typedef __complex__ double double_complex; - - - -void -p (const double_complex *t, int n) -{ - int i; - double s = ({ typeof ( t[n/2] ) arg = ( t[n/2] ); (__imag__ arg); }) ; - for (i = 1; i < n/2; i++) - s += 2* ({ typeof ( t[i] ) arg = ( t[i] ); (__imag__ arg); }) ; -} - diff --git a/gcc/testsuite/gcc.c-torture/compile/991213-2.c b/gcc/testsuite/gcc.c-torture/compile/991213-2.c deleted file mode 100644 index 98385d56263..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991213-2.c +++ /dev/null @@ -1,15 +0,0 @@ -typedef long __kernel_time_t; -typedef __kernel_time_t time_t; -time2( - void (* const (funcp)(time_t)), - const long offset, int * const okayp) -{ - register int bits; - time_t t; - for (bits = 0, t = 1; t > 0; ++bits, t <<= 1) - ; - t = (t < 0) ? 0 : ((time_t) 1 << bits); - for ( ; ; ) { - (*funcp)((time_t)&t); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991213-3.c b/gcc/testsuite/gcc.c-torture/compile/991213-3.c deleted file mode 100644 index ce8347f5ddf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991213-3.c +++ /dev/null @@ -1,2 +0,0 @@ -int jump () { goto * (int (*) ()) 0xbabebec0; } - diff --git a/gcc/testsuite/gcc.c-torture/compile/991214-1.c b/gcc/testsuite/gcc.c-torture/compile/991214-1.c deleted file mode 100644 index 2748a15af84..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991214-1.c +++ /dev/null @@ -1,11 +0,0 @@ -void foo(double bar[], double *zp, int n) -{ - int i, j; - - i = 0; - for(j = 0; j < n; j++) - { - i += j+1; - bar[i] *= (1.0 + *zp); - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991214-2.c b/gcc/testsuite/gcc.c-torture/compile/991214-2.c deleted file mode 100644 index 3e18d215e13..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991214-2.c +++ /dev/null @@ -1,28 +0,0 @@ -#if defined(STACK_SIZE) && (STACK_SIZE < 65536) -# define HISTO_SIZE 9 -#else -# define HISTO_SIZE 36 -#endif - -extern int N; -extern int nrows; -extern int or_num_angles; - -typedef struct -{ - double value; - int count; -}Histo; - -Histo add_histo[10][2][HISTO_SIZE][HISTO_SIZE]; - -void cmd_connection_statistics( ) -{ - int i,j,k,m; - - for(i=0; i<nrows; i++){ - for(j=0; j< 2; j++) - for(k=0; k< or_num_angles; k++) - ; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991229-1.c b/gcc/testsuite/gcc.c-torture/compile/991229-1.c deleted file mode 100644 index d11fd91fcbd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991229-1.c +++ /dev/null @@ -1,23 +0,0 @@ -static int parse (int, int); -static int parseStmt (int, int); - -ejEval() -{ - int state; - state = parse(8 , 0x1 ); -} -static int parse(int state, int flags) -{ - switch (state) { - case 8 : - case 18 : - case 6 : - case 2 : - state = parseStmt(state, flags); - break; - } -} -static int parseStmt(int state, int flags) -{ - parse (2, flags); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991229-2.c b/gcc/testsuite/gcc.c-torture/compile/991229-2.c deleted file mode 100644 index 0c562199f68..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991229-2.c +++ /dev/null @@ -1,10 +0,0 @@ -void foo (); - -void update (double* r) -{ - foo (); - { - register double y1; - y1 = r[ 4] - r[11]; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/991229-3.c b/gcc/testsuite/gcc.c-torture/compile/991229-3.c deleted file mode 100644 index 710e4c99593..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/991229-3.c +++ /dev/null @@ -1,17 +0,0 @@ -int m[8],b[8]; - -int main(){ - int i; - - for(;;){ - m[0] = rand(); - if(m[0] == 0){ - for(i=0;i<8;i++){ - m[i] = b[i]; - } - break; - } - } -} - - diff --git a/gcc/testsuite/gcc.c-torture/compile/calls.c b/gcc/testsuite/gcc.c-torture/compile/calls.c deleted file mode 100644 index 1582c0e92fa..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/calls.c +++ /dev/null @@ -1,22 +0,0 @@ -typedef void *(*T)(void); -f1 () -{ - ((T) 0)(); -} -f2 () -{ - ((T) 1000)(); -} -f3 () -{ - ((T) 10000000)(); -} -f4 (r) -{ - ((T) r)(); -} -f5 () -{ - int (*r)() = f3; - ((T) r)(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c b/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c deleted file mode 100644 index 9e1b659c7cf..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/cmpdi-1.c +++ /dev/null @@ -1,15 +0,0 @@ -f (long long d) -{ - int i = 0; - if (d == 1) - i = 1; - return i; -} - -g (long long d) -{ - int i = 0; - if (d <= 0) - i = 1; - return i; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/combine-hang.c b/gcc/testsuite/gcc.c-torture/compile/combine-hang.c deleted file mode 100644 index 7cc57afe603..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/combine-hang.c +++ /dev/null @@ -1,26 +0,0 @@ -typedef union -{ - double value; - struct - { - unsigned long msw; - unsigned long lsw; - } parts; -} ieee_double_shape_type; - -double f (int iy) -{ - double z, t; - ieee_double_shape_type u, v; - - if (iy == 1) - return 0; - - u.parts.msw = iy; - u.parts.lsw = 0; - z = u.value; - v.parts.msw = iy; - v.parts.lsw = 0; - t = v.value; - return 1.0+z+t+t; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/compile.exp b/gcc/testsuite/gcc.c-torture/compile/compile.exp deleted file mode 100644 index 1b075a8b798..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/compile.exp +++ /dev/null @@ -1,35 +0,0 @@ -# Expect driver script for GCC Regression Tests -# Copyright (C) 1993, 1995, 1997 Free Software Foundation -# -# This file 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -# These tests come from Torbjorn Granlund's (tege@cygnus.com) -# C torture test suite, and other contributors. - -if $tracelevel then { - strace $tracelevel -} - -# load support procs -load_lib c-torture.exp - -foreach testcase [glob -nocomplain $srcdir/$subdir/*.c] { - # If we're only testing specific files and this isn't one of them, skip it. - if ![runtest_file_p $runtests $testcase] then { - continue - } - - c-torture $testcase -} diff --git a/gcc/testsuite/gcc.c-torture/compile/cpp-1.c b/gcc/testsuite/gcc.c-torture/compile/cpp-1.c deleted file mode 100644 index 09d49bc61fd..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/cpp-1.c +++ /dev/null @@ -1,8 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation. - - by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */ - -#define foo/**/1 -#if foo != 1 -# error "foo not properly defined" -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/cpp-2.c b/gcc/testsuite/gcc.c-torture/compile/cpp-2.c deleted file mode 100644 index ae9425f09f4..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/cpp-2.c +++ /dev/null @@ -1,5 +0,0 @@ -/* Copyright (C) 2000 Free Software Foundation. - - by Alexandre Oliva <oliva@lsd.ic.unicamp.br> */ - -#pragma /* the token after #pragma is optional. */ diff --git a/gcc/testsuite/gcc.c-torture/compile/dll.c b/gcc/testsuite/gcc.c-torture/compile/dll.c deleted file mode 100644 index bf0d1544ad0..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/dll.c +++ /dev/null @@ -1,21 +0,0 @@ -__declspec (dllimport) int foo; -extern int (* import) (void) __attribute__((dllimport)); -int func2 (void) __attribute__((dllexport)); - -__declspec(dllexport) int -func1 (int a) -{ - return a + foo; -} - -static int -internal (void) -{ - return 77; -} - -int -func2 (void) -{ - return import (); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/dll.x b/gcc/testsuite/gcc.c-torture/compile/dll.x deleted file mode 100644 index 63a1e180e2c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/dll.x +++ /dev/null @@ -1,20 +0,0 @@ -# This test examines the attribute support for DLLs. -# Only COFF/PE formats support DLLs, (plus, as a special case -# the mcore-elf toolchain), so the code here tries to determine -# the file format and decide whether the test should be marked -# as unsupported. - -set torture_eval_before_compile { - - if ![istarget "mcore-*-elf"] { - - set objformat [gcc_target_object_format] - - if { $objformat != "pe" } { - unsupported "dll.c" - return 1 - } - } -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c b/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c deleted file mode 100644 index 79687c9c005..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/funcptr-1.c +++ /dev/null @@ -1,19 +0,0 @@ -extern int (*gp)(const char*); - -int -g (const char* d) -{ - printf ("g"); - return 0; -} - -f () -{ - int errcnt=0; - - if (gp != g) - { - printf ("f"); - errcnt++; - } -} diff --git a/gcc/testsuite/gcc.c-torture/compile/goto-1.c b/gcc/testsuite/gcc.c-torture/compile/goto-1.c deleted file mode 100644 index caeed3aa0ba..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/goto-1.c +++ /dev/null @@ -1,16 +0,0 @@ -f () -{ - do - { - if (0) - { - L1:; - } - else - goto L2; - L2:; - } - while (0); - - goto L1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c b/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c deleted file mode 100644 index a0adc78cf82..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/iftrap-1.c +++ /dev/null @@ -1,99 +0,0 @@ -/* Verify that ifcvt doesn't crash under a number of interesting conditions. */ - -void f1(int p) -{ - if (p) - __builtin_trap(); -} - -void f2(int p) -{ - if (p) - __builtin_trap(); - else - bar(); -} - -void f3(int p) -{ - if (p) - bar(); - else - __builtin_trap(); -} - -void f4(int p, int q) -{ - if (p) - { - bar(); - if (q) - bar(); - } - else - __builtin_trap(); -} - -void f5(int p) -{ - if (p) - __builtin_trap(); - else - abort(); -} - -void f6(int p) -{ - if (p) - abort(); - else - __builtin_trap(); -} - -void f7(int p) -{ - if (p) - __builtin_trap(); - else - __builtin_trap(); -} - -void f8(int p) -{ - if (p) - __builtin_trap(); - else - { - bar(); - __builtin_trap(); - } -} - -void f9(int p) -{ - if (p) - { - bar(); - __builtin_trap(); - } - else - __builtin_trap(); -} - -void f10(int p) -{ - if (p) - __builtin_trap(); - while (1) - bar(); -} - -void f11(int p) -{ - if (p) - __builtin_trap(); - else - bar(); - while (1) - baz(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c b/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c deleted file mode 100644 index bb7bb5726b1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/iftrap-2.c +++ /dev/null @@ -1,10 +0,0 @@ -void foo(int p, int q) -{ - if (p) - { - if (q) - __builtin_trap (); - } - else - bar(); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/init-1.c b/gcc/testsuite/gcc.c-torture/compile/init-1.c deleted file mode 100644 index 38db9ad87d9..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/init-1.c +++ /dev/null @@ -1,19 +0,0 @@ -typedef struct -{ - char *key; - char *value; -} T1; - -typedef struct -{ - long type; - char *value; -} T3; - -T1 a[] = -{ - { - "", - ((char *)&((T3) {1, (char *) 1})) - } -}; diff --git a/gcc/testsuite/gcc.c-torture/compile/init-2.c b/gcc/testsuite/gcc.c-torture/compile/init-2.c deleted file mode 100644 index 63a7f5849d6..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/init-2.c +++ /dev/null @@ -1,4 +0,0 @@ -struct -{ - int e1, e2; -} v = { e2: 0 }; diff --git a/gcc/testsuite/gcc.c-torture/compile/init-3.c b/gcc/testsuite/gcc.c-torture/compile/init-3.c deleted file mode 100644 index be3d9b49679..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/init-3.c +++ /dev/null @@ -1,11 +0,0 @@ -struct empty { }; -struct something { - int spacer; - struct empty foo; - int bar; -}; - -struct something X = { - foo: { }, - bar: 1, -}; diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-1.c b/gcc/testsuite/gcc.c-torture/compile/labels-1.c deleted file mode 100644 index fae6ab8f400..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/labels-1.c +++ /dev/null @@ -1,13 +0,0 @@ -#ifndef NO_LABEL_VALUES -f () -{ - void *x = &&L2; - if (&&L3 - &&L1 > 1) - abort(); - L1: return 1; - L2: abort (); - L3:; -} -#else -int x; -#endif diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-2.c b/gcc/testsuite/gcc.c-torture/compile/labels-2.c deleted file mode 100644 index cf4f116e6a8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/labels-2.c +++ /dev/null @@ -1,10 +0,0 @@ -struct bp { void *v, *b, *e; }; -f () -{ - struct bp x = { &&L2 }; - if (&&L3 - &&L1 > 1) - abort (); -L1:return 1; -L2:abort (); -L3:; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-3.c b/gcc/testsuite/gcc.c-torture/compile/labels-3.c deleted file mode 100644 index 51ac88380b8..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/labels-3.c +++ /dev/null @@ -1,12 +0,0 @@ -/* Verify that we can narrow the storage associated with label diffs. */ - -int foo (int a) -{ - static const short ar[] = { &&l1 - &&l1, &&l2 - &&l1 }; - void *p = &&l1 + ar[a]; - goto *p; - l1: - return 1; - l2: - return 2; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/labels-3.x b/gcc/testsuite/gcc.c-torture/compile/labels-3.x deleted file mode 100644 index e9b4118ff44..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/labels-3.x +++ /dev/null @@ -1,7 +0,0 @@ -# This test does not compile on mips-irix6 using the native assembler, -# though it does work with gas. See PR6200. Since we cannot (???) -# distinguish which assembler is being used, always pass -S for irix. - -if { [istarget "mips*-*-irix*"] } { set options "-S" } - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c deleted file mode 100644 index 13be5142d94..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.c +++ /dev/null @@ -1,10 +0,0 @@ -register unsigned int cp0count asm ("$c0r1"); - -int -main (int argc, char *argv[]) -{ - unsigned int d; - - d = cp0count + 3; - printf ("%d\n", d); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.x b/gcc/testsuite/gcc.c-torture/compile/mipscop-1.x deleted file mode 100644 index 66601ea91f1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-1.x +++ /dev/null @@ -1,10 +0,0 @@ -global target_triplet - -if { ![istarget "*mips*"] } { - return 1 -} else { - set torture_compile_xfail "$target_triplet" -} - -return 0 - diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c deleted file mode 100644 index 88e95db12cc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.c +++ /dev/null @@ -1,16 +0,0 @@ -register unsigned int c3r1 asm ("$c3r1"); - -extern unsigned int b, c; - -void -foo () -{ - unsigned int a, d; - - c3r1 = a; - b = c3r1; - - c3r1 = c; - d = c3r1; - printf ("%d\n", d); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.x b/gcc/testsuite/gcc.c-torture/compile/mipscop-2.x deleted file mode 100644 index 66601ea91f1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-2.x +++ /dev/null @@ -1,10 +0,0 @@ -global target_triplet - -if { ![istarget "*mips*"] } { - return 1 -} else { - set torture_compile_xfail "$target_triplet" -} - -return 0 - diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c deleted file mode 100644 index eb602c8a54f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.c +++ /dev/null @@ -1,16 +0,0 @@ -register unsigned int c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2"); - -extern unsigned int b, c; - -void -foo () -{ - unsigned int a, d; - - c3r1 = a; - b = c3r1; - - c3r2 = c; - d = c3r1; - printf ("%d\n", d); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.x b/gcc/testsuite/gcc.c-torture/compile/mipscop-3.x deleted file mode 100644 index 66601ea91f1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-3.x +++ /dev/null @@ -1,10 +0,0 @@ -global target_triplet - -if { ![istarget "*mips*"] } { - return 1 -} else { - set torture_compile_xfail "$target_triplet" -} - -return 0 - diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c b/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c deleted file mode 100644 index 368db5e90dc..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.c +++ /dev/null @@ -1,16 +0,0 @@ -register unsigned long c3r1 asm ("$c3r1"), c3r2 asm ("$c3r2"); - -extern unsigned long b, c; - -void -foo () -{ - unsigned long a, d; - - c3r1 = a; - b = c3r1; - - c3r2 = c; - d = c3r1; - printf ("%d\n", d); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.x b/gcc/testsuite/gcc.c-torture/compile/mipscop-4.x deleted file mode 100644 index 66601ea91f1..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/mipscop-4.x +++ /dev/null @@ -1,10 +0,0 @@ -global target_triplet - -if { ![istarget "*mips*"] } { - return 1 -} else { - set torture_compile_xfail "$target_triplet" -} - -return 0 - diff --git a/gcc/testsuite/gcc.c-torture/compile/packed-1.c b/gcc/testsuite/gcc.c-torture/compile/packed-1.c deleted file mode 100644 index 709fc3cb102..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/packed-1.c +++ /dev/null @@ -1,14 +0,0 @@ -struct s -{ - int e; -} x; - -struct rbuf -{ - struct s *p __attribute__ ((packed)); -} *b; - -f () -{ - b->p = &x; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-1.c b/gcc/testsuite/gcc.c-torture/compile/simd-1.c deleted file mode 100644 index c113bd4fa2d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-1.c +++ /dev/null @@ -1,7 +0,0 @@ -typedef int v2si __attribute__ ((mode(V2SI))); -typedef unsigned di __attribute__ ((mode(DI))); -void foo(unsigned long); -void bar() { - v2si x = { 1, 2 }; - foo((di) x); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-2.c b/gcc/testsuite/gcc.c-torture/compile/simd-2.c deleted file mode 100644 index 694e94f0105..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-2.c +++ /dev/null @@ -1,17 +0,0 @@ -typedef float floatvect2 __attribute__((mode(V2SF))); - -typedef union -{ - floatvect2 vector; - float f[2]; -}resfloatvect2; - -void tempf(float *x, float *y) -{ - floatvect2 temp={x[0],x[1]}; - floatvect2 temp1={y[0],y[1]}; - resfloatvect2 temp2; - temp2.vector=temp+temp1; - x[0]=temp2.f[0]; - x[1]=temp2.f[1]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-3.c b/gcc/testsuite/gcc.c-torture/compile/simd-3.c deleted file mode 100644 index 24d2f489e8c..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-3.c +++ /dev/null @@ -1,17 +0,0 @@ -typedef float floatvect2 __attribute__((mode(V2DF))); - -typedef union -{ - floatvect2 vector; - double f[2]; -}resfloatvect2; - -void tempf(double *x, double *y) -{ - floatvect2 temp={x[0],x[1]}; - floatvect2 temp1={y[0],y[1]}; - resfloatvect2 temp2; - temp2.vector=temp+temp1; - x[0]=temp2.f[0]; - x[1]=temp2.f[1]; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-4.c b/gcc/testsuite/gcc.c-torture/compile/simd-4.c deleted file mode 100644 index 6ede943c47d..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-4.c +++ /dev/null @@ -1,15 +0,0 @@ -typedef float floatvect2 __attribute__((mode(V4SF))); - -typedef union -{ - floatvect2 vector; - float f[2]; -}resfloatvect2; - -void tempf(floatvect2 *x, floatvect2 *y) -{ - floatvect2 temp= *x; - floatvect2 temp1=*y; - resfloatvect2 temp2; - *x=temp+temp1; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.c b/gcc/testsuite/gcc.c-torture/compile/simd-5.c deleted file mode 100644 index 016cccd1e9f..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-5.c +++ /dev/null @@ -1,12 +0,0 @@ -#define vector64 __attribute__((vector_size(8))) - -main(){ - - vector64 int c; -vector64 int a = {1, -1}; -vector64 int b = {2, -2}; -c = -a + b*b*(-1LL); -/* c is now {5, 3} */ - - printf("result is %llx\n", (long long)c); -} diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.x b/gcc/testsuite/gcc.c-torture/compile/simd-5.x deleted file mode 100644 index b7612f78787..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/simd-5.x +++ /dev/null @@ -1,6 +0,0 @@ -# h8300 does not have long long -if { [istarget "h8300-*-*"] } { - return 1; -} - -return 0 diff --git a/gcc/testsuite/gcc.c-torture/compile/structs.c b/gcc/testsuite/gcc.c-torture/compile/structs.c deleted file mode 100644 index 356f0729f1e..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/structs.c +++ /dev/null @@ -1,263 +0,0 @@ -/* Copyright 1996, 1999 Free Software Foundation, Inc. - - 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - - Please email any bugs, comments, and/or additions to this file to: - bug-gdb@prep.ai.mit.edu */ - -struct struct1 { char a;}; -struct struct2 { char a, b;}; -struct struct3 { char a, b, c; }; -struct struct4 { char a, b, c, d; }; -struct struct5 { char a, b, c, d, e; }; -struct struct6 { char a, b, c, d, e, f; }; -struct struct7 { char a, b, c, d, e, f, g; }; -struct struct8 { char a, b, c, d, e, f, g, h; }; -struct struct9 { char a, b, c, d, e, f, g, h, i; }; -struct struct10 { char a, b, c, d, e, f, g, h, i, j; }; -struct struct11 { char a, b, c, d, e, f, g, h, i, j, k; }; -struct struct12 { char a, b, c, d, e, f, g, h, i, j, k, l; }; -struct struct16 { char a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p; }; - -struct struct1 foo1 = {'1'}, L1; -struct struct2 foo2 = { 'a', 'b'}, L2; -struct struct3 foo3 = { 'A', 'B', 'C'}, L3; -struct struct4 foo4 = {'1', '2', '3', '4'}, L4; -struct struct5 foo5 = {'a', 'b', 'c', 'd', 'e'}, L5; -struct struct6 foo6 = {'A', 'B', 'C', 'D', 'E', 'F'}, L6; -struct struct7 foo7 = {'1', '2', '3', '4', '5', '6', '7'}, L7; -struct struct8 foo8 = {'1', '2', '3', '4', '5', '6', '7', '8'}, L8; -struct struct9 foo9 = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i'}, L9; -struct struct10 foo10 = { - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J'}, L10; -struct struct11 foo11 = { - '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B'}, L11; -struct struct12 foo12 = { - 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L'}, L12; -struct struct16 foo16 = { - 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p'}, L16; - -struct struct1 fun1() -{ - return foo1; -} -struct struct2 fun2() -{ - return foo2; -} -struct struct3 fun3() -{ - return foo3; -} -struct struct4 fun4() -{ - return foo4; -} -struct struct5 fun5() -{ - return foo5; -} -struct struct6 fun6() -{ - return foo6; -} -struct struct7 fun7() -{ - return foo7; -} -struct struct8 fun8() -{ - return foo8; -} -struct struct9 fun9() -{ - return foo9; -} -struct struct10 fun10() -{ - return foo10; -} -struct struct11 fun11() -{ - return foo11; -} -struct struct12 fun12() -{ - return foo12; -} -struct struct16 fun16() -{ - return foo16; -} - -#ifdef PROTOTYPES -void Fun1(struct struct1 foo1) -#else -void Fun1(foo1) - struct struct1 foo1; -#endif -{ - L1 = foo1; -} -#ifdef PROTOTYPES -void Fun2(struct struct2 foo2) -#else -void Fun2(foo2) - struct struct2 foo2; -#endif -{ - L2 = foo2; -} -#ifdef PROTOTYPES -void Fun3(struct struct3 foo3) -#else -void Fun3(foo3) - struct struct3 foo3; -#endif -{ - L3 = foo3; -} -#ifdef PROTOTYPES -void Fun4(struct struct4 foo4) -#else -void Fun4(foo4) - struct struct4 foo4; -#endif -{ - L4 = foo4; -} -#ifdef PROTOTYPES -void Fun5(struct struct5 foo5) -#else -void Fun5(foo5) - struct struct5 foo5; -#endif -{ - L5 = foo5; -} -#ifdef PROTOTYPES -void Fun6(struct struct6 foo6) -#else -void Fun6(foo6) - struct struct6 foo6; -#endif -{ - L6 = foo6; -} -#ifdef PROTOTYPES -void Fun7(struct struct7 foo7) -#else -void Fun7(foo7) - struct struct7 foo7; -#endif -{ - L7 = foo7; -} -#ifdef PROTOTYPES -void Fun8(struct struct8 foo8) -#else -void Fun8(foo8) - struct struct8 foo8; -#endif -{ - L8 = foo8; -} -#ifdef PROTOTYPES -void Fun9(struct struct9 foo9) -#else -void Fun9(foo9) - struct struct9 foo9; -#endif -{ - L9 = foo9; -} -#ifdef PROTOTYPES -void Fun10(struct struct10 foo10) -#else -void Fun10(foo10) - struct struct10 foo10; -#endif -{ - L10 = foo10; -} -#ifdef PROTOTYPES -void Fun11(struct struct11 foo11) -#else -void Fun11(foo11) - struct struct11 foo11; -#endif -{ - L11 = foo11; -} -#ifdef PROTOTYPES -void Fun12(struct struct12 foo12) -#else -void Fun12(foo12) - struct struct12 foo12; -#endif -{ - L12 = foo12; -} -#ifdef PROTOTYPES -void Fun16(struct struct16 foo16) -#else -void Fun16(foo16) - struct struct16 foo16; -#endif -{ - L16 = foo16; -} - -int main() -{ -#ifdef usestubs - set_debug_traps(); - breakpoint(); -#endif - - /* TEST C FUNCTIONS */ - L1 = fun1(); - L2 = fun2(); - L3 = fun3(); - L4 = fun4(); - L5 = fun5(); - L6 = fun6(); - L7 = fun7(); - L8 = fun8(); - L9 = fun9(); - L10 = fun10(); - L11 = fun11(); - L12 = fun12(); - L16 = fun16(); - - foo1.a = foo2.a = foo3.a = foo4.a = foo5.a = foo6.a = foo7.a = foo8.a = - foo9.a = foo10.a = foo11.a = foo12.a = foo16.a = '$'; - - Fun1(foo1); - Fun2(foo2); - Fun3(foo3); - Fun4(foo4); - Fun5(foo5); - Fun6(foo6); - Fun7(foo7); - Fun8(foo8); - Fun9(foo9); - Fun10(foo10); - Fun11(foo11); - Fun12(foo12); - Fun16(foo16); - - return 0; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/trunctfdf.c b/gcc/testsuite/gcc.c-torture/compile/trunctfdf.c deleted file mode 100644 index 29d6ed0dc9a..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/trunctfdf.c +++ /dev/null @@ -1,14 +0,0 @@ -/* Sparc w/128-bit long double bombed on this because even though - the trunctfdf libcall passed the long double by reference, the - libcall was still marked as LCT_CONST instead of LCT_PURE. */ - -double *copy(long double *first, long double *last, double *result) -{ - int n; - for (n = last - first; n > 0; --n) { - *result = *first; - ++first; - ++result; - } - return result; -} diff --git a/gcc/testsuite/gcc.c-torture/compile/widechar-1.c b/gcc/testsuite/gcc.c-torture/compile/widechar-1.c deleted file mode 100644 index 5d89f33a864..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/widechar-1.c +++ /dev/null @@ -1 +0,0 @@ -char *s = L"a" "b"; diff --git a/gcc/testsuite/gcc.c-torture/compile/zero-strct-1.c b/gcc/testsuite/gcc.c-torture/compile/zero-strct-1.c deleted file mode 100644 index d3db812691b..00000000000 --- a/gcc/testsuite/gcc.c-torture/compile/zero-strct-1.c +++ /dev/null @@ -1,7 +0,0 @@ -typedef struct { } empty_t; - -f () -{ - empty_t i; - bar (i); -} diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java deleted file mode 100644 index 45690b06669..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java +++ /dev/null @@ -1,108 +0,0 @@ -/* GdkFontMetrics.java - Copyright (C) 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -import java.awt.*; - -public class GdkFontMetrics extends FontMetrics -{ - private final int native_state = GtkGenericPeer.getUniqueInteger(); - - private static final int ASCENT = 0, MAX_ASCENT = 1, - DESCENT = 2, MAX_DESCENT = 3, - MAX_ADVANCE = 4; - - private int[] metrics; - private native int[] initState (String xlfd, int pts); - - public GdkFontMetrics (Font font) - { - super (font); - metrics = initState (((GtkFontPeer)font.getPeer ()).getXLFD (), - font.getSize ()); - } - - native public int stringWidth (String str); - - public int charWidth (char ch) - { - return stringWidth (new String (new char[] { ch })); - } - - public int charsWidth (char data[], int off, int len) - { - return stringWidth (new String (data, off, len)); - } - - /* - Sun's Motif implementation always returns 0 or 1 here (???), but - going by the X11 man pages, it seems as though we should return - font.ascent + font.descent. - */ - public int getLeading () - { - return 1; -// return metrics[ASCENT] + metrics[DESCENT]; - } - - public int getAscent () - { - return metrics[ASCENT]; - } - - public int getMaxAscent () - { - return metrics[MAX_ASCENT]; - } - - public int getDescent () - { - return metrics[DESCENT]; - } - - public int getMaxDescent () - { - return metrics[MAX_DESCENT]; - } - - public int getMaxAdvance () - { - return metrics[MAX_ADVANCE]; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java deleted file mode 100644 index 3e3d04bbb70..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics.java +++ /dev/null @@ -1,322 +0,0 @@ -/* GdkGraphics.java - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.awt.image.*; - -public class GdkGraphics extends Graphics -{ - private final int native_state = GtkGenericPeer.getUniqueInteger(); - - Color color, xorColor; - GtkComponentPeer component; - Font font; - Rectangle clip; - - int xOffset = 0; - int yOffset = 0; - - static final int GDK_COPY = 0, GDK_XOR = 2; - - native int[] initState (GtkComponentPeer component); - native void initState (int width, int height); - native void copyState (GdkGraphics g); - - GdkGraphics (GdkGraphics g) - { - color = g.color; - xorColor = g.xorColor; - font = g.font; - clip = new Rectangle (g.clip); - component = g.component; - - copyState (g); - } - - GdkGraphics (int width, int height) - { - initState (width, height); - color = Color.black; - clip = new Rectangle (0, 0, width, height); - font = new Font ("Dialog", Font.PLAIN, 10); - } - - GdkGraphics (GtkComponentPeer component) - { - this.component = component; - int rgb[] = initState (component); - color = new Color (rgb[0], rgb[1], rgb[2]); - font = new Font ("Dialog", Font.PLAIN, 10); - Dimension d = component.awtComponent.getSize (); - clip = new Rectangle (0, 0, d.width, d.height); - } - - public native void clearRect (int x, int y, int width, int height); - - public void clipRect (int x, int y, int width, int height) - { - clip = clip.intersection (new Rectangle (x, y, width, height)); - setClipRectangle (clip.x, clip.y, clip.width, clip.height); - } - - native public void copyArea (int x, int y, int width, int height, - int dx, int dy); - - public Graphics create () - { - return new GdkGraphics (this); - } - -// public Graphics create (int x, int y, int width, int height) -// { -// GdkGraphics g = new GdkGraphics (this); -// System.out.println ("translating by: " + x +" " + y); -// g.translate (x, y); -// g.clipRect (0, 0, width, height); - -// return g; -// } - - native public void dispose (); - - native void copyPixmap (Graphics g, int x, int y, int width, int height); - public boolean drawImage (Image img, int x, int y, - Color bgcolor, ImageObserver observer) - { - if (img instanceof GtkOffScreenImage) - { - copyPixmap (img.getGraphics (), - x, y, img.getWidth (null), img.getHeight (null)); - return true; - } - - GtkImage image = (GtkImage) img; - new GtkImagePainter (image, this, x, y, -1, -1, bgcolor); - return image.isLoaded (); - } - - public boolean drawImage (Image img, int x, int y, ImageObserver observer) - { - if (img instanceof GtkOffScreenImage) - { - copyPixmap (img.getGraphics (), - x, y, img.getWidth (null), img.getHeight (null)); - return true; - } - - return drawImage (img, x, y, component.getBackground (), observer); - } - - public boolean drawImage (Image img, int x, int y, int width, int height, - Color bgcolor, ImageObserver observer) - { - if (img instanceof GtkOffScreenImage) - { - throw new RuntimeException (); - } - - GtkImage image = (GtkImage) img; - new GtkImagePainter (image, this, x, y, width, height, bgcolor); - return image.isLoaded (); - } - - public boolean drawImage (Image img, int x, int y, int width, int height, - ImageObserver observer) - { - return drawImage (img, x, y, width, height, component.getBackground (), - observer); - } - - public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bgcolor, ImageObserver observer) - { - if (img instanceof GtkOffScreenImage) - { - throw new RuntimeException (); - } - - GtkImage image = (GtkImage) img; - new GtkImagePainter (image, this, dx1, dy1, dx2, dy2, - sx1, sy1, sx2, sy2, bgcolor); - return image.isLoaded (); - } - - public boolean drawImage (Image img, int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - ImageObserver observer) - { - return drawImage (img, dx1, dy1, dx2, dy2, sx1, sy1, sx2, sy2, - component.getBackground (), observer); - } - - native public void drawLine (int x1, int y1, int x2, int y2); - - native public void drawArc (int x, int y, int width, int height, - int startAngle, int arcAngle); - native public void fillArc (int x, int y, int width, int height, - int startAngle, int arcAngle); - native public void drawOval(int x, int y, int width, int height); - native public void fillOval(int x, int y, int width, int height); - - native public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints); - native public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints); - - native public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints); - - native public void drawRect(int x, int y, int width, int height); - native public void fillRect (int x, int y, int width, int height); - - native void drawString (String str, int x, int y, String fname, int size); - public void drawString (String str, int x, int y) - { - drawString (str, x, y, - ((GtkFontPeer)font.getPeer ()).getXLFD (), font.getSize ()); - } - - public void drawRoundRect(int x, int y, int width, int height, - int arcWidth, int arcHeight) - { - // System.out.println ("drawRoundRect called [UNIMPLEMENTED]"); - } - - public void fillRoundRect (int x, int y, int width, int height, - int arcWidth, int arcHeight) - { - // System.out.println ("fillRoundRect called [UNIMPLEMENTED]"); - } - - public Shape getClip () - { - return getClipBounds (); - } - - public Rectangle getClipBounds () - { -// System.out.println ("returning CLIP: " + clip); - return new Rectangle (clip.x, clip.y, clip.width, clip.height); - } - - public Color getColor () - { - return color; - } - - public Font getFont () - { - return font; - } - - public FontMetrics getFontMetrics (Font font) - { - return new GdkFontMetrics (font); - } - - native void setClipRectangle (int x, int y, int width, int height); - - public void setClip (int x, int y, int width, int height) - { - clip.x = x; - clip.y = y; - clip.width = width; - clip.height = height; - - setClipRectangle (x, y, width, height); - } - - public void setClip (Rectangle clip) - { - setClip (clip.x, clip.y, clip.width, clip.height); - } - - public void setClip (Shape clip) - { - setClip (clip.getBounds ()); - } - - native private void setFGColor (int red, int green, int blue); - - public void setColor (Color c) - { - color = c; - - if (xorColor == null) /* paint mode */ - setFGColor (color.getRed (), color.getGreen (), color.getBlue ()); - else /* xor mode */ - setFGColor (color.getRed () ^ xorColor.getRed (), - color.getGreen () ^ xorColor.getGreen (), - color.getBlue () ^ xorColor.getBlue ()); - } - - public void setFont (Font font) - { - this.font = font; - } - - native void setFunction (int gdk_func); - - public void setPaintMode () - { - xorColor = null; - - setFunction (GDK_COPY); - setFGColor (color.getRed (), color.getGreen (), color.getBlue ()); - } - - public void setXORMode (Color c) - { - xorColor = c; - - setFunction (GDK_XOR); - setFGColor (color.getRed () ^ xorColor.getRed (), - color.getGreen () ^ xorColor.getGreen (), - color.getBlue () ^ xorColor.getBlue ()); - } - - native public void translateNative (int x, int y); - - public void translate (int x, int y) - { - clip.x -= x; - clip.y -= y; - - translateNative (x, y); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkArg.java b/libjava/gnu/java/awt/peer/gtk/GtkArg.java deleted file mode 100644 index 0491856849c..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkArg.java +++ /dev/null @@ -1,61 +0,0 @@ -/* GtkArg.java - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -public class GtkArg -{ - String name; - Object value; - - public GtkArg (String name, Object value) - { - this.name = name; - this.value = value; - } - - public String getName () - { - return name; - } - - public Object getValue () - { - return value; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkArgList.java b/libjava/gnu/java/awt/peer/gtk/GtkArgList.java deleted file mode 100644 index c7770472e7e..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkArgList.java +++ /dev/null @@ -1,75 +0,0 @@ -/* GtkArgList.java - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.util.Vector; - -public class GtkArgList extends Vector -{ - void add (GtkArg arg) - { - addElement (arg); - } - - void add (String name, boolean value) - { - addElement (new GtkArg (name, new Boolean (value))); - } - - void add (String name, int value) - { - addElement (new GtkArg (name, new Integer (value))); - } - - void add (String name, float value) - { - addElement (new GtkArg (name, new Float (value))); - } - - void add (String name, Object value) - { - addElement (new GtkArg (name, value)); - } - - synchronized void setArgs (GtkComponentPeer cp) - { - for (int i = 0; i < elementCount; i++) - cp.set ((GtkArg)elementData[i]); - } -} - diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java deleted file mode 100644 index 94603c0d3c9..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java +++ /dev/null @@ -1,89 +0,0 @@ -/* GtkButtonPeer.java -- Implements ButtonPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.MouseEvent; -import java.awt.event.KeyEvent; -import java.awt.peer.*; - -public class GtkButtonPeer extends GtkComponentPeer - implements ButtonPeer -{ - native void create (); - - public GtkButtonPeer (Button b) - { - super (b); - } - - public void setLabel (String label) - { - set ("label", label); - } - - public void handleEvent (AWTEvent e) - { - if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled () - && !modalHasGrab ()) - { - MouseEvent me = (MouseEvent) e; - if (!me.isConsumed () - && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0) - postActionEvent (((Button)awtComponent).getActionCommand (), - me.getModifiers ()); - } - - if (e.getID () == KeyEvent.KEY_PRESSED) - { - KeyEvent ke = (KeyEvent) e; - if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_SPACE) - postActionEvent (((Button)awtComponent).getActionCommand (), - ke.getModifiers ()); - } - - super.handleEvent (e); - } - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - - args.add ("label", ((Button)component).getLabel ()); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java deleted file mode 100644 index 59c28f9fd5f..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkCanvasPeer.java +++ /dev/null @@ -1,92 +0,0 @@ -/* GtkCanvasPeer.java - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.PaintEvent; -import java.awt.peer.*; - -public class GtkCanvasPeer extends GtkComponentPeer implements CanvasPeer -{ - native void create (); - - public GtkCanvasPeer (Canvas c) - { - super (c); - } - - public Graphics getGraphics () - { - return new GdkGraphics (this); - } - - public void handleEvent (AWTEvent event) - { - int id = event.getID(); - - switch (id) - { - case PaintEvent.PAINT: - case PaintEvent.UPDATE: - { - try - { - Graphics g = getGraphics (); - g.setClip (((PaintEvent)event).getUpdateRect()); - - if (id == PaintEvent.PAINT) - awtComponent.paint (g); - else - awtComponent.update (g); - - g.dispose (); - } - catch (InternalError e) - { - System.err.println (e); - } - } - break; - } - } - - /* Preferred size for a drawing widget is always what the user requested */ - public Dimension getPreferredSize () - { - return awtComponent.getSize (); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java deleted file mode 100644 index 9903c310425..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.java +++ /dev/null @@ -1,86 +0,0 @@ -/* GtkCheckboxGroupPeer.java - Wrap a CheckboxGroup - Copyright (C) 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.*; -import java.util.*; - -// Note that there is no peer interface for a CheckboxGroup. We -// introduce our own in order to make it easier to keep a piece of -// native state for each one. -public class GtkCheckboxGroupPeer extends GtkGenericPeer -{ - // This maps from a CheckboxGroup to the native peer. - private static WeakHashMap map = new WeakHashMap (); - - // Find the native peer corresponding to a CheckboxGroup. - public static synchronized GtkCheckboxGroupPeer - getCheckboxGroupPeer (CheckboxGroup group) - { - if (group == null) - return null; - GtkCheckboxGroupPeer nat = (GtkCheckboxGroupPeer) map.get (group); - if (nat == null) - { - nat = new GtkCheckboxGroupPeer (); - map.put (group, nat); - } - return nat; - } - - private GtkCheckboxGroupPeer () - { - // We don't need any special state here. Note that we can't store - // a reference to the java-side CheckboxGroup. That would mean - // they could never be collected. - super (null); - } - - // Dispose of our native resources. - public native void dispose (); - - // Remove a given checkbox from this group. - public native void remove (GtkCheckboxPeer box); - - // When collected, clean up the native state. - protected void finalize () - { - dispose (); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java deleted file mode 100644 index 1bff7069602..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxMenuItemPeer.java +++ /dev/null @@ -1,56 +0,0 @@ -/* GtkCheckboxMenuItemPeer.java -- Implements CheckboxMenuItemPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.CheckboxMenuItemPeer; -import java.awt.peer.MenuItemPeer; - -public class GtkCheckboxMenuItemPeer extends GtkMenuItemPeer - implements CheckboxMenuItemPeer -{ - native void create (String label); - - public GtkCheckboxMenuItemPeer (CheckboxMenuItem menu) - { - super (menu); - setState (menu.getState ()); - } - - native public void setState (boolean t); -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java deleted file mode 100644 index 48f8804007d..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java +++ /dev/null @@ -1,114 +0,0 @@ -/* GtkCheckboxPeer.java -- Implements CheckboxPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkCheckboxPeer extends GtkComponentPeer - implements CheckboxPeer -{ - // Group from last time it was set. - public GtkCheckboxGroupPeer old_group; - - public native void nativeCreate (GtkCheckboxGroupPeer group); - public native void nativeSetCheckboxGroup (GtkCheckboxGroupPeer group); - public native void connectHooks (); - - public GtkCheckboxPeer (Checkbox c) - { - super (c); - } - - // We can't fully use the ordinary getArgs code here, due to - // oddities of this particular widget. In particular we must be - // able to switch between a checkbutton and a radiobutton - // dynamically. - public void create () - { - CheckboxGroup g = ((Checkbox) awtComponent).getCheckboxGroup (); - old_group = GtkCheckboxGroupPeer.getCheckboxGroupPeer (g); - nativeCreate (old_group); - } - - public void setState (boolean state) - { - set ("active", state); - } - - public void setLabel (String label) - { - set ("label", label); - } - - public void setCheckboxGroup (CheckboxGroup group) - { - GtkCheckboxGroupPeer gp - = GtkCheckboxGroupPeer.getCheckboxGroupPeer (group); - if (gp != old_group) - { - if (old_group != null) - old_group.remove (this); - nativeSetCheckboxGroup (gp); - old_group = gp; - } - } - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - args.add ("active", ((Checkbox) component).getState ()); - args.add ("label", ((Checkbox) component).getLabel ()); - } - - // Override the superclass postItemEvent so that the peer doesn't - // need information that we have. - public void postItemEvent (Object item, int stateChange) - { - super.postItemEvent (awtComponent, stateChange); - } - - public void dispose () - { - // Notify the group so that the native state can be cleaned up - // appropriately. - if (old_group != null) - old_group.remove (this); - super.dispose (); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java deleted file mode 100644 index 19e1a56d2e1..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java +++ /dev/null @@ -1,90 +0,0 @@ -/* GtkChoicePeer.java -- Implements ChoicePeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; -import java.awt.event.*; - -public class GtkChoicePeer extends GtkComponentPeer - implements ChoicePeer -{ - native void create (); - - public GtkChoicePeer (Choice c) - { - super (c); - - int count = c.getItemCount (); - if (count > 0) - { - String items[] = new String[count]; - for (int i = 0; i < count; i++) - items[i] = c.getItem (i); - - append (items); - } - } - - native void append (String items[]); - - native public void add (String item, int index); - native public void remove (int index); - native public void select (int position); - - public void addItem (String item, int position) - { - add (item, position); - } - - /* - public void handleEvent (AWTEvent event) - { - if (event instanceof ItemEvent) - ((Choice) awtComponent).select ((String) ((ItemEvent)event).getItem ()); - super.handleEvent (event); - } - */ - - protected void postItemEvent (Object item, int stateChange) - { - if (stateChange == ItemEvent.SELECTED) - ((Choice) awtComponent).select ((String) item); - super.postItemEvent (item, stateChange); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java b/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java deleted file mode 100644 index d2587d970a1..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkClipboard.java +++ /dev/null @@ -1,167 +0,0 @@ -/* GtkClipboard.java - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.io.*; -import java.net.*; -import java.util.*; -import java.awt.datatransfer.*; -import java.awt.image.*; -import java.awt.peer.*; - -public class GtkClipboard extends Clipboard -{ - /* the number of milliseconds that we'll wait around for the - owner of the GDK_SELECTION_PRIMARY selection to convert - the requested data */ - final static int SELECTION_RECEIVED_TIMEOUT = 5000; - - /* We currently only support transferring of text between applications */ - static String selection; - static Object selectionLock = new Object (); - - static boolean hasSelection = false; - - protected - GtkClipboard () - { - super ("System Clipboard"); - initNativeState (); - } - - public Transferable - getContents (Object requestor) - { - synchronized (this) - { - if (hasSelection) - return contents; - } - - /* Java doesn't own the selection, so we need to ask X11 */ - synchronized (selectionLock) - { - requestStringConversion (); - try - { - selectionLock.wait (SELECTION_RECEIVED_TIMEOUT); - } - catch (InterruptedException e) - { - return null; - } - - return (selection == null) ? null : new StringSelection (selection); - } - } - - void - stringSelectionReceived (String newSelection) - { - synchronized (selectionLock) - { - selection = newSelection; - selectionLock.notify (); - } - } - - /* convert Java clipboard data into a String suitable for sending - to another application */ - synchronized String - stringSelectionHandler () throws IOException - { - String selection = null; - - try { - if (contents.isDataFlavorSupported (DataFlavor.stringFlavor)) - selection = (String)contents.getTransferData (DataFlavor.stringFlavor); - else if (contents.isDataFlavorSupported (DataFlavor.plainTextFlavor)) - { - StringBuffer sbuf = new StringBuffer (); - InputStreamReader reader; - char readBuf[] = new char[512]; - int numChars; - - reader = new InputStreamReader - ((InputStream) - contents.getTransferData (DataFlavor.plainTextFlavor), "UNICODE"); - - while (true) - { - numChars = reader.read (readBuf); - if (numChars == -1) - break; - sbuf.append (readBuf, 0, numChars); - } - - selection = new String (sbuf); - } - } catch (Exception e) { } - - return selection; - } - - public synchronized void - setContents (Transferable contents, ClipboardOwner owner) - { - selectionGet (); - - this.contents = contents; - this.owner = owner; - - hasSelection = true; - } - - synchronized - void selectionClear () - { - hasSelection = false; - - if (owner != null) - { - owner.lostOwnership (this, contents); - owner = null; - contents = null; - } - } - - native void initNativeState (); - native static void requestStringConversion (); - native static void selectionGet (); -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java deleted file mode 100644 index 6e3b25290c8..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java +++ /dev/null @@ -1,391 +0,0 @@ -/* GtkComponentPeer.java -- Implements ComponentPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.*; -import java.awt.image.*; -import java.awt.peer.ComponentPeer; - -public class GtkComponentPeer extends GtkGenericPeer - implements ComponentPeer -{ - Component awtComponent; - - /* this isEnabled differs from Component.isEnabled, in that it - knows if a parent is disabled. In that case Component.isEnabled - may return true, but our isEnabled will always return false */ - native boolean isEnabled (); - native static boolean modalHasGrab (); - - native int[] gtkWidgetGetForeground (); - native int[] gtkWidgetGetBackground (); - native void gtkWidgetSetVisible (boolean b); - native void gtkWidgetGetDimensions(int[] dim); - native void gtkWidgetGetLocationOnScreen(int[] point); - native void gtkWidgetSetCursor (int type); - - void create () - { - throw new RuntimeException (); - } - - native void connectHooks (); - - protected GtkComponentPeer (Component awtComponent) - { - super (awtComponent); - this.awtComponent = awtComponent; - - /* temporary try/catch block until all peers use this creation method */ - try { - create (); - - GtkArgList args = new GtkArgList (); - getArgs (awtComponent, args); - args.setArgs (this); - - connectHooks (); - - if (awtComponent.getForeground () == null) - awtComponent.setForeground (getForeground ()); - if (awtComponent.getBackground () == null) - awtComponent.setBackground (getBackground ()); - // if (c.getFont () == null) - // c.setFont (cp.getFont ()); - - if (! (awtComponent instanceof Window)) - { - setCursor (awtComponent.getCursor ()); - Rectangle bounds = awtComponent.getBounds (); - setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - } - } catch (RuntimeException ex) { ; } - } - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - GtkImage i = (GtkImage) image; - return i.checkImage (); - } - - public Image createImage (ImageProducer producer) - { - return new GtkImage (producer, null); - } - - public Image createImage (int width, int height) - { - GdkGraphics g = new GdkGraphics (width, height); - return new GtkOffScreenImage (null, g, width, height); - } - - public void disable () - { - setEnabled (false); - } - - public void enable () - { - setEnabled (true); - } - - public ColorModel getColorModel () - { - return ColorModel.getRGBdefault (); - } - - public FontMetrics getFontMetrics (Font font) - { - return new GdkFontMetrics (font); - } - - public Graphics getGraphics () - { - return null; - } - - public Point getLocationOnScreen () - { - int point[] = new int[2]; - gtkWidgetGetLocationOnScreen (point); - return new Point (point[0], point[1]); - } - - public Dimension getMinimumSize () - { - int dim[]=new int[2]; - gtkWidgetGetDimensions (dim); - Dimension d = new Dimension (dim[0],dim[1]); - return (d); - } - - public Dimension getPreferredSize () - { - int dim[]=new int[2]; - gtkWidgetGetDimensions (dim); - Dimension d = new Dimension (dim[0],dim[1]); - return (d); - } - - public Toolkit getToolkit () - { - return Toolkit.getDefaultToolkit(); - } - - public void handleEvent (AWTEvent event) - { - } - - public boolean isFocusTraversable () - { - return true; - } - - public Dimension minimumSize () - { - return getMinimumSize(); - } - - public void paint (Graphics g) - { - awtComponent.paint (g); - } - - public Dimension preferredSize() - { - return getPreferredSize(); - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - GtkImage i = (GtkImage) image; - - if (i.isLoaded ()) return true; - - class PrepareImage extends Thread - { - GtkImage image; - ImageObserver observer; - - PrepareImage (GtkImage image, ImageObserver observer) - { - this.image = image; - this.observer = observer; - } - - public void run () - { - // XXX: need to return data to image observer - image.source.startProduction (null); - } - } - - new PrepareImage (i, observer).start (); - return false; - } - - public void print (Graphics g) - { - throw new RuntimeException (); - } - - public void repaint (long tm, int x, int y, int width, int height) - { - q.postEvent (new PaintEvent (awtComponent, PaintEvent.UPDATE, - new Rectangle (x, y, width, height))); - } - - native public void requestFocus (); - - public void reshape (int x, int y, int width, int height) - { - setBounds (x, y, width, height); - } - - public void setBackground (Color c) - { - // System.out.println ("setBackground [UNIMPLEMENTED"); - } - - native public void setNativeBounds (int x, int y, int width, int height); - - public void setBounds (int x, int y, int width, int height) - { - Component parent = awtComponent.getParent (); - - if (parent instanceof Frame) - { - Insets insets = ((Frame)parent).getInsets (); - /* convert Java's coordinate space into GTK+'s coordinate space */ - setNativeBounds (x-insets.left, y-insets.top, width, height); - } - else - setNativeBounds (x, y, width, height); - } - - public void setCursor (Cursor cursor) - { - gtkWidgetSetCursor (cursor.getType ()); - } - - public void setEnabled (boolean b) - { - set ("sensitive", b); - } - - public void setFont (Font f) - { - } - - public void setForeground (Color c) - { - // System.out.println ("setForeground [UNIMPLEMENTED"); - } - - public Color getForeground () - { - int rgb[] = gtkWidgetGetForeground (); - return new Color (rgb[0], rgb[1], rgb[2]); - } - - public Color getBackground () - { - int rgb[] = gtkWidgetGetBackground (); - return new Color (rgb[0], rgb[1], rgb[2]); - } - - public void setVisible (boolean b) - { - set ("visible", b); - } - - public void hide () - { - setVisible (false); - } - - public void show () - { - setVisible (true); - } - - protected void postMouseEvent(int id, long when, int mods, int x, int y, - int clickCount, boolean popupTrigger) - { - q.postEvent(new MouseEvent(awtComponent, id, when, mods, x, y, - clickCount, popupTrigger)); - } - - protected void postExposeEvent (int x, int y, int width, int height) - { - q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT, - new Rectangle (x, y, width, height))); - } - - protected void postKeyEvent (int id, long when, int mods, - int keyCode, char keyChar) - { - q.postEvent (new KeyEvent (awtComponent, id, when, mods, - keyCode, keyChar)); - } - - protected void postFocusEvent (int id, boolean temporary) - { - q.postEvent (new FocusEvent (awtComponent, id, temporary)); - } - - protected void postItemEvent (Object item, int stateChange) - { - q.postEvent (new ItemEvent ((ItemSelectable)awtComponent, - ItemEvent.ITEM_STATE_CHANGED, - item, stateChange)); - } - - public void getArgs (Component component, GtkArgList args) - { - args.add ("visible", component.isVisible ()); - args.add ("sensitive", component.isEnabled ()); - - ComponentPeer p; - - do - { - component = component.getParent (); - p = component.getPeer (); - } while (p instanceof java.awt.peer.LightweightPeer); - - args.add ("parent", p); - } - - native void set (String name, String value); - native void set (String name, boolean value); - native void set (String name, int value); - native void set (String name, float value); - native void set (String name, Object value); - - void set (GtkArg arg) - { - String name = arg.getName (); - Object value = arg.getValue (); - - if (value instanceof Boolean) - set (name, ((Boolean)value).booleanValue ()); - else if (value instanceof Integer) - set (name, ((Integer)value).intValue ()); - else if (value instanceof Float) - set (name, ((Float)value).floatValue ()); - else if (value instanceof String) - set (name, ((String) value)); - else - set (name, value); - } - - public GraphicsConfiguration getGraphicsConfiguration () - { - // FIXME: just a stub for now. - return null; - } - - public void setEventMask (long mask) - { - // FIXME: just a stub for now. - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java deleted file mode 100644 index fef88cd6a39..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java +++ /dev/null @@ -1,125 +0,0 @@ -/* GtkContainerPeer.java -- Implements ContainerPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.ContainerPeer; - -public class GtkContainerPeer extends GtkComponentPeer - implements ContainerPeer -{ - Insets insets; - Container c; - - public GtkContainerPeer(Container c) - { - super (c); - this.c = c; - insets = new Insets (0, 0, 0, 0); - } - - public void beginValidate() - { - } - - public void endValidate() - { -// q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT, -// new Rectangle (x, y, width, height))); -// Graphics gc = getGraphics (); -// if (gc != null) -// { -// awtComponent.update (gc); -// gc.dispose (); -// } -// System.out.println ("got here"); -// awtComponent.repaint (); - } - - public Insets getInsets() - { - return insets; - } - - public Insets insets() - { - return getInsets (); - } - - public void setBounds (int x, int y, int width, int height) - { - super.setBounds (x, y, width, height); - awtComponent.validate (); - } - - public Graphics getGraphics () - { - return new GdkGraphics (this); - } - - public void handleEvent (AWTEvent event) - { - int id = event.getID(); - - switch (id) - { - case PaintEvent.PAINT: - case PaintEvent.UPDATE: - { - try - { - Graphics g = getGraphics (); - g.setClip (((PaintEvent)event).getUpdateRect()); - - if (id == PaintEvent.PAINT) - awtComponent.paint (g); - else - awtComponent.update (g); - - g.dispose (); - } - catch (InternalError e) - { - System.err.println (e); - } - } - break; - } - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java deleted file mode 100644 index b47956d4f21..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkDialogPeer.java +++ /dev/null @@ -1,76 +0,0 @@ -/* GtkDialogPeer.java -- Implements DialogPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.*; -import java.awt.event.*; - -public class GtkDialogPeer extends GtkWindowPeer - implements DialogPeer -{ - public GtkDialogPeer (Dialog dialog) - { - super (dialog); - } - - void create () - { - create (GTK_WINDOW_DIALOG); - } - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - - Dialog dialog = (Dialog) component; - - args.add ("modal", dialog.isModal ()); - args.add ("allow_shrink", dialog.isResizable ()); - args.add ("allow_grow", dialog.isResizable ()); - } - - public void handleEvent (AWTEvent event) - { -// int id = event.getID(); - -// if (id == WindowEvent.WINDOW_CLOSING) -// System.out.println ("got a closing event"); - } - -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java deleted file mode 100644 index 3376787d2e5..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java +++ /dev/null @@ -1,70 +0,0 @@ -/* GtkFileDialogPeer.java -- Implements FileDialogPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.io.FilenameFilter; -import java.awt.peer.*; -import java.awt.*; - -public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer -{ - native void create (); - - public GtkFileDialogPeer (FileDialog fd) - { - super (fd); - } - - public void setDirectory (String directory) - { - setFile (directory); - } - - public native void setFile (String file); - public native void connectHooks (); - - public void setFilenameFilter (FilenameFilter filter) - { - /* GTK has no filters. */ - } - - public Graphics getGraphics () - { - return null; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java deleted file mode 100644 index 47a46e81865..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkFontPeer.java +++ /dev/null @@ -1,74 +0,0 @@ -/* GtkFontPeer.java -- Implements FontPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.FontPeer; -import java.awt.Font; -import java.util.ResourceBundle; - -public class GtkFontPeer implements FontPeer -{ - private static ResourceBundle bundle; - - static - { - try - { - bundle = ResourceBundle.getBundle ("gnu.java.awt.peer.gtk.font"); - } - catch (Throwable ignored) - { - bundle = null; - } - } - - final private String Xname; - - public GtkFontPeer (String name, int style) - { - if (bundle != null) - Xname = bundle.getString (name.toLowerCase () + "." + style); - else - Xname = "-*-*-medium-r-normal-*-12-*-*-*-c-*-*-*"; - } - - public String getXLFD () - { - return Xname; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java deleted file mode 100644 index e16a570938e..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkFramePeer.java +++ /dev/null @@ -1,132 +0,0 @@ -/* GtkFramePeer.java -- Implements FramePeer with GTK - Copyright (C) 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.*; -import java.awt.event.*; - -public class GtkFramePeer extends GtkWindowPeer - implements FramePeer -{ - int menuBarHeight = 0; - native int getMenuBarHeight (); - - native public void setMenuBarPeer (MenuBarPeer bar); - - public void setMenuBar (MenuBar bar) - { - if (bar == null) - setMenuBarPeer (null); - else - setMenuBarPeer ((MenuBarPeer) bar.getPeer ()); - } - - public GtkFramePeer (Frame frame) - { - super (frame); - } - - void create () - { - create (GTK_WINDOW_TOPLEVEL); - } - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - - Frame frame = (Frame) component; - - args.add ("title", frame.getTitle ()); - args.add ("allow_shrink", frame.isResizable ()); - args.add ("allow_grow", frame.isResizable ()); - } - public void setIconImage (Image image) - { - /* TODO: Waiting on Toolkit Image routines */ - } - - public Graphics getGraphics () - { - GdkGraphics g = new GdkGraphics (this); - g.translateNative (-insets.left, -insets.top); - return g; - } - - public void setBounds (int x, int y, int width, int height) - { - super.setBounds (0, 0, width - insets.left - insets.right, - height - insets.top - insets.bottom + menuBarHeight); - } - - protected void postConfigureEvent (int x, int y, int width, int height, - int top, int left, int bottom, int right) - { - if (((Frame)awtComponent).getMenuBar () != null) - { - menuBarHeight = getMenuBarHeight (); - top += menuBarHeight; - } - - super.postConfigureEvent (0, 0, - width + left + right, - height + top + bottom - menuBarHeight, - top, left, bottom, right); - } - - protected void postMouseEvent(int id, long when, int mods, int x, int y, - int clickCount, boolean popupTrigger) - { - super.postMouseEvent (id, when, mods, - x + insets.left, y + insets.top, - clickCount, popupTrigger); - } - - protected void postExposeEvent (int x, int y, int width, int height) - { -// System.out.println ("x + insets.left:" + (x + insets.left)); -// System.out.println ("y + insets.top :" + (y + insets.top)); - q.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT, - new Rectangle (x + insets.left, - y + insets.top, - width, height))); - } -} - - diff --git a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java deleted file mode 100644 index 914b7a6cdeb..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkGenericPeer.java +++ /dev/null @@ -1,84 +0,0 @@ -/* GtkGenericPeer.java - Has a hashcode. Yuck. - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.event.*; - -public class GtkGenericPeer -{ - final int native_state = getUniqueInteger (); - - // Next native state value we will assign. - private static int next_native_state = 0; - - // The widget or other java-side object we wrap. - protected Object awtWidget; - - // Global event queue. - protected static EventQueue q = null; - - // Dispose of our native state. - public native void dispose (); - - protected GtkGenericPeer (Object awtWidget) - { - this.awtWidget = awtWidget; - } - - public static void enableQueue (EventQueue sq) - { - if (q == null) - q = sq; - } - - protected void postActionEvent (String command, int mods) - { - q.postEvent (new ActionEvent (awtWidget, ActionEvent.ACTION_PERFORMED, - command, mods)); - } - - // Return a unique integer for use in the native state mapping - // code. We can't use a hash code since that is not guaranteed to - // be unique. - static synchronized int getUniqueInteger () - { - // Let's assume this will never wrap. - return next_native_state++; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImage.java b/libjava/gnu/java/awt/peer/gtk/GtkImage.java deleted file mode 100644 index f0c8bf410ef..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkImage.java +++ /dev/null @@ -1,286 +0,0 @@ -/* GtkImage.java - Copyright (C) 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.util.*; -import java.awt.image.*; - -public class GtkImage extends Image implements ImageConsumer -{ - int width = -1, height = -1; - Hashtable props = null; - boolean isLoaded = false; - boolean isCacheable = true; - boolean loading = false; - - Vector widthObservers = new Vector (); - Vector heightObservers = new Vector (); - Vector propertyObservers = new Vector (); - - ImageProducer source; - Graphics g; - - /* Variables in which we stored cached data, if possible. - - An image is cached if the following properties are true: - 1. The ColorModel passed into setColorModel is the same ColorModel - passed to all invocations of setPixels. - 2. The image contains a single frame. - - */ - int[] pixelCache; - ColorModel model; - - public - GtkImage (ImageProducer producer, Graphics g) - { - source = producer; - this.g = g; - - source.addConsumer (this); - } - - public synchronized int - getWidth (ImageObserver observer) - { - if (width == -1) - widthObservers.addElement (observer); - - return width; - } - - public synchronized int - getHeight (ImageObserver observer) - { - if (height == -1) - heightObservers.addElement (observer); - - return height; - } - - public ImageProducer - getSource () - { - return source; - } - - public Graphics - getGraphics () - { - return g; - } - - public synchronized Object - getProperty (String name, ImageObserver observer) - { - if (props == null) - { - propertyObservers.addElement (observer); - return null; - } - - Object value = props.get (name); - return (value == null) ? UndefinedProperty : value; - } - - public synchronized void - flush () - { - isLoaded = false; - isCacheable = true; - width = height = -1; - props = null; - pixelCache = null; - model = null; - - source.removeConsumer (this); - source.addConsumer (this); - } - - public boolean - isLoaded () - { - return isLoaded; - } - - /* ImageConsumer methods */ - - public synchronized void - setDimensions (int width, int height) - { - pixelCache = new int[width*height]; - - this.width = width; - this.height = height; - - for (int i = 0; i < widthObservers.size (); i++) - { - ImageObserver io = (ImageObserver) widthObservers.elementAt (i); - io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height); - } - - for (int i = 0; i < heightObservers.size (); i++) - { - ImageObserver io = (ImageObserver) heightObservers.elementAt (i); - io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height); - } - } - - public synchronized void - setProperties (Hashtable props) - { - this.props = props; - - for (int i = 0; i < propertyObservers.size (); i++) - { - ImageObserver io = (ImageObserver) propertyObservers.elementAt (i); - io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height); - } - } - - public synchronized void - setColorModel (ColorModel model) - { - if (this.model == null || this.model == model) - this.model = model; - else - isCacheable = false; - } - - public synchronized void - setHints (int flags) - { - } - - public synchronized void - setPixels (int x, int y, int width, int height, ColorModel cm, byte[] pixels, - int offset, int scansize) - { - setPixels (x, y, width, height, cm, convertPixels (pixels), offset, - scansize); - } - - public synchronized void - setPixels (int x, int y, int width, int height, ColorModel cm, int[] pixels, - int offset, int scansize) - { - loading = true; - - if (!isCacheable) - return; - - if (cm != model || pixelCache == null) - { - isCacheable = false; - return; - } - - if (scansize == width) - { - System.arraycopy (pixels, offset, - pixelCache, y * this.width + x, - pixels.length - offset); - } - else // skip over scansize-width for each row - { - for (int i = 0; i < height; i++) - System.arraycopy (pixels, offset + (i * scansize), - pixelCache, (y + i) * this.width + x, - width); - } - } - - public synchronized void - imageComplete (int status) - { - if (status == ImageConsumer.STATICIMAGEDONE && isCacheable) - isLoaded = true; - - if (status == ImageConsumer.SINGLEFRAMEDONE) - isCacheable = false; - - source.removeConsumer (this); - } - - public synchronized void - startProduction (GtkImagePainter painter) - { - if (isLoaded) - { - painter.setDimensions (width, height); - painter.setPixels (0, 0, width, height, model, pixelCache, 0, width); - } - else - { - source.startProduction (painter); - source.removeConsumer (painter); - } - } - - private int[] - convertPixels (byte[] pixels) - { - int ret[] = new int[pixels.length]; - - for (int i = 0; i < pixels.length; i++) - ret[i] = pixels[i]; - - return ret; - } - - synchronized int - checkImage () - { - int bits = 0; - - if (width != -1) - bits |= ImageObserver.WIDTH; - if (height != -1) - bits |= ImageObserver.HEIGHT; - if (props != null) - bits |= ImageObserver.PROPERTIES; - if (loading) - bits |= ImageObserver.SOMEBITS; - if (isLoaded) - bits |= ImageObserver.ALLBITS; - - return bits; - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java b/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java deleted file mode 100644 index 3ea22cd25af..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkImagePainter.java +++ /dev/null @@ -1,239 +0,0 @@ -/* GtkImagePainter.java - Copyright (C) 1999, 2000 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.awt.image.*; -import java.util.*; - -public class GtkImagePainter implements Runnable, ImageConsumer -{ - GtkImage image; - GdkGraphics gc; - int startX, startY; - int redBG; - int greenBG; - int blueBG; - double affine[]; - int width, height; - boolean flipX, flipY; - Rectangle clip; - int s_width, s_height; - - public - GtkImagePainter (GtkImage image, GdkGraphics gc, int x, int y, - int width, int height, Color bgcolor) - { - this.image = image; - this.gc = (GdkGraphics) gc.create (); - startX = x; - startY = y; - redBG = bgcolor.getRed (); - greenBG = bgcolor.getGreen (); - blueBG = bgcolor.getBlue (); - this.width = width; - this.height = height; - flipX = flipY = false; - s_width = s_height = 0; - clip = null; - - new Thread (this).start (); - } - - public - GtkImagePainter (GtkImage image, GdkGraphics gc, - int dx1, int dy1, int dx2, int dy2, - int sx1, int sy1, int sx2, int sy2, - Color bgcolor) - { - this.image = image; - this.gc = (GdkGraphics) gc.create (); - startX = (dx1 < dx2) ? dx1 : dx2; - startY = dy1; - redBG = bgcolor.getRed (); - greenBG = bgcolor.getGreen (); - blueBG = bgcolor.getBlue (); - - this.width = Math.abs (dx2 - dx1); - this.height = Math.abs (dy2 - dy1); - - flipX = ((dx1 > dx2 && sx2 > sx1) - || (dx1 < dx2 && sx2 < sx1)); - - flipY = ((dy1 > dy2 && sy2 > sy1) - || (dy1 < dy2 && sy2 < sy1)); - - s_width = Math.abs (sx2 - sx1); - s_height = Math.abs (sy2 - sy1); - clip = new Rectangle (sx1, sy1, s_width, s_height); - - new Thread (this).start (); - } - - public void - run () - { - image.startProduction (this); - gc.dispose (); - } - - /* Convert pixel data into a format that gdkrgb can understand */ - static int[] - convertPixels (int[] pixels, ColorModel model) - { - if (model.equals (ColorModel.getRGBdefault ())) - return pixels; - - int ret[] = new int[pixels.length]; - - for (int i = 0; i < pixels.length; i++) - ret[i] = model.getRGB (pixels[i]); - - return ret; - } - - static int[] - convertPixels (byte[] pixels, ColorModel model) - { - int ret[] = new int[pixels.length]; - - for (int i = 0; i < pixels.length; i++) - ret[i] = model.getRGB (pixels[i]); - - return ret; - } - - native void - drawPixels (GdkGraphics gc, int bg_red, int bg_green, int bg_blue, - int x, int y, int width, int height, int[] pixels, int offset, - int scansize, double affine[]); - - - public void - setPixels (int x, int y, int width, int height, ColorModel model, - int[] pixels, int offset, int scansize) - { - if (clip != null) - { - Rectangle r; - r = clip.intersection (new Rectangle (x, y, width, height)); - if (r.width == 0 && r.height == 0) - return; - - offset += r.y * scansize + r.x; - - r.translate (-Math.abs (clip.x - startX), -Math.abs (clip.y - startY)); - - width = r.width; - height = r.height; - x = r.x; - y = r.y; - } - - drawPixels (gc, redBG, greenBG, blueBG, - startX + x, startY + y, - width, height, convertPixels (pixels, model), offset, - scansize, affine); - } - - public void - setPixels (int x, int y, int width, int height, ColorModel model, - byte[] pixels, int offset, int scansize) - { - setPixels (x, y, width, height, model, convertPixels (pixels, model), - offset, scansize); - } - - public void - setDimensions (int width, int height) - { - if (!flipX && !flipY && - ((this.width == -1 && this.height == -1) - || (this.width == width && this.height == height))) - return; - - affine = new double[6]; - affine[1] = affine[2] = affine[4] = affine[5] = 0; - - if (clip != null) - { - affine[0] = this.width / (double) s_width; - affine[3] = this.height / (double) s_height; - } - else - { - affine[0] = this.width / (double) width; - affine[3] = this.height / (double) height; - } - - if (flipX) - { - affine[0] = -affine[0]; - affine[4] = this.width; - } - - if (flipY) - { - affine[3] = -affine[3]; - affine[5] = this.height; - } - - if (affine[0] == 1 && affine[3] == 1) - affine = null; - } - - public void - setProperties (Hashtable props) - { - } - - public void - setColorModel (ColorModel model) - { - } - - public void - setHints (int flags) - { - } - - public void - imageComplete (int status) - { - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java deleted file mode 100644 index 5cd3fb7b327..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java +++ /dev/null @@ -1,88 +0,0 @@ -/* GtkLabelPeer.java -- Implements LabelPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.*; - -public class GtkLabelPeer extends GtkComponentPeer - implements LabelPeer -{ - native void create (); - - public GtkLabelPeer (Label l) - { - super (l); - } - - public void setText (String text) - { - set ("label", text); - } - - public void setAlignment (int alignment) - { - set ("xalign", getGtkAlignment (alignment)); - } - - float getGtkAlignment (int alignment) - { - switch (alignment) - { - case Label.LEFT: - return 0.0f; - case Label.CENTER: - return 0.5f; - case Label.RIGHT: - return 1.0f; - } - - return 0.0f; - } - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - - Label label = (Label) component; - - args.add ("label", label.getText ()); - args.add ("xalign", getGtkAlignment (label.getAlignment ())); - args.add ("yalign", 0.5f); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java deleted file mode 100644 index 6686457ba42..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java +++ /dev/null @@ -1,126 +0,0 @@ -/* GtkListPeer.java -- Implements ListPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.*; - -public class GtkListPeer extends GtkComponentPeer - implements ListPeer -{ -// native void create (ComponentPeer parent, String [] items, boolean mode); - - native void create (); - native void connectHooks (); - - native void getSize (int rows, int dims[]); - - public GtkListPeer (List list) - { - super (list); - - setMultipleMode (list.isMultipleMode ()); - - if (list.getItemCount () > 0) - append (list.getItems ()); - } - - native void append (String items[]); - - public native void add (String item, int index); - - public void addItem (String item, int index) - { - add (item, index); - } - - public void clear () - { - removeAll (); - } - - public native void delItems (int start, int end); - public native void deselect (int index); - - public Dimension getMinimumSize (int rows) - { - int dims[] = new int[2]; - - getSize (rows, dims); - return (new Dimension (dims[0], dims[1])); - } - - public Dimension getPreferredSize (int rows) - { - int dims[] = new int[2]; - - getSize (rows, dims); - return (new Dimension (dims[0], dims[1])); - } - - public native int[] getSelectedIndexes (); - public native void makeVisible (int index); - - public Dimension minimumSize (int rows) - { - return (getMinimumSize (rows)); - } - - public Dimension preferredSize (int rows) - { - return (getPreferredSize (rows)); - } - - public void removeAll () - { - delItems (0, -1); - } - - public native void select (int index); - public native void setMultipleMode (boolean b); - - public void setMultipleSelections (boolean b) - { - setMultipleMode (b); - } - - protected void postItemEvent (int item, int stateChange) - { - postItemEvent (new Integer (item), stateChange); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java b/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java deleted file mode 100644 index 6efa8410197..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkMainThread.java +++ /dev/null @@ -1,80 +0,0 @@ -/* GtkMainThread.java -- Runs gtk_main() - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -public class GtkMainThread extends GtkGenericPeer implements Runnable -{ - private static Thread mainThread = null; - private static Object mainThreadLock = new Object(); - - static native void gtkInit(); - native void gtkMain(); - - public GtkMainThread() - { - super (null); - synchronized (mainThreadLock) - { - if (mainThread != null) - throw new IllegalStateException(); - mainThread = new Thread(this, "GtkMain"); - } - - synchronized (this) - { - mainThread.start(); - try { - wait(); - } catch (InterruptedException e) { } - } - } - - public void run() - { - synchronized (this) - { - gtkInit(); - notify(); - } - gtkMain(); - } -} - - - diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java deleted file mode 100644 index 6ceb8641481..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkMenuBarPeer.java +++ /dev/null @@ -1,69 +0,0 @@ -/* GtkMenuBarPeer.java -- Implements MenuBarPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.MenuBarPeer; -import java.awt.peer.MenuPeer; - -public class GtkMenuBarPeer extends GtkMenuComponentPeer - implements MenuBarPeer -{ - - native void create (); - native void addMenu (MenuPeer menu); - - public GtkMenuBarPeer (MenuBar target) - { - super (target); - create (); - } - - /* In Gnome, help menus are no longer right flushed. */ - public void addHelpMenu (Menu menu) - { - addMenu (menu); - } - - public void addMenu (Menu menu) - { - addMenu ((MenuPeer) menu.getPeer ()); - } - - native public void delMenu (int index); -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java deleted file mode 100644 index e04ce999324..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkMenuComponentPeer.java +++ /dev/null @@ -1,54 +0,0 @@ -/* GtkMenuComponentPeer.java -- Implements MenuComponentPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.MenuComponentPeer; - -public class GtkMenuComponentPeer extends GtkGenericPeer - implements MenuComponentPeer -{ - public GtkMenuComponentPeer (Object awtWidget) - { - super (awtWidget); - } - - public void dispose () - { - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java deleted file mode 100644 index 1428011133b..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkMenuItemPeer.java +++ /dev/null @@ -1,92 +0,0 @@ -/* GtkMenuItemPeer.java -- Implements MenuItemPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.MenuItemPeer; -import java.awt.peer.MenuComponentPeer; -import java.awt.peer.MenuBarPeer; -import java.awt.peer.MenuPeer; - -public class GtkMenuItemPeer extends GtkMenuComponentPeer - implements MenuItemPeer -{ - native void create (String label); - - public GtkMenuItemPeer (MenuItem item) - { - super (item); - create (item.getLabel ()); - setEnabled (item.isEnabled ()); - setParent (item); - } - - void setParent (MenuItem item) - { - // add ourself differently, based on what type of parent we have - // yes, the typecasting here is nasty. - Object parent = item.getParent (); - if (parent instanceof MenuBar) - { - ((GtkMenuBarPeer)((MenuBar)parent).getPeer ()).addMenu ((MenuPeer) this); - } - else // parent instanceof Menu - { - ((GtkMenuPeer)((Menu)parent).getPeer ()).addItem (this, - item.getShortcut ()); - } - } - - public void disable () - { - setEnabled (false); - } - - public void enable () - { - setEnabled (true); - } - - native public void setEnabled (boolean b); - native public void setLabel (String label); - - protected void postMenuActionEvent () - { - postActionEvent (((MenuItem)awtWidget).getActionCommand (), 0); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java deleted file mode 100644 index 51733a6f0b6..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkMenuPeer.java +++ /dev/null @@ -1,99 +0,0 @@ -/* GtkMenuPeer.java -- Implements MenuPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.MenuPeer; -import java.awt.peer.MenuItemPeer; - -public class GtkMenuPeer extends GtkMenuItemPeer - implements MenuPeer -{ - native void create (String label); - native void addItem (MenuItemPeer item, int key, boolean shiftModifier); - native void setupAccelGroup (GtkGenericPeer container); - - public GtkMenuPeer (Menu menu) - { - super (menu); - - MenuContainer parent = menu.getParent (); - if (parent instanceof Menu) - setupAccelGroup ((GtkGenericPeer)((Menu)parent).getPeer ()); - else if (parent instanceof Component) - setupAccelGroup ((GtkGenericPeer)((Component)parent).getPeer ()); - else - setupAccelGroup (null); - } - - public void addItem (MenuItem item) - { - int key = 0; - boolean shiftModifier = false; - - MenuShortcut ms = item.getShortcut (); - if (ms != null) - { - key = ms.getKey (); - shiftModifier = ms.usesShiftModifier (); - } - - addItem ((MenuItemPeer) item.getPeer (), key, shiftModifier); - } - - public void addItem (MenuItemPeer item, MenuShortcut ms) - { - int key = 0; - boolean shiftModifier = false; - - if (ms != null) - { - key = ms.getKey (); - shiftModifier = ms.usesShiftModifier (); - } - - addItem (item, key, shiftModifier); - } - - public void addSeparator () - { - addItem (new MenuItem ("-")); - } - - native public void delItem (int index); -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java b/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java deleted file mode 100644 index 135fbf627c3..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkOffScreenImage.java +++ /dev/null @@ -1,87 +0,0 @@ -/* GtkOffScreenImage.java - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.awt.image.*; - -public class GtkOffScreenImage extends Image -{ - int width, height; - ImageProducer source; - Graphics g; - - public GtkOffScreenImage (ImageProducer source, Graphics g, - int width, int height) - { - this.width = width; - this.height = height; - - this.source = source; - this.g = g; - } - - public int getWidth (ImageObserver observer) - { - return width; - } - - public int getHeight (ImageObserver observer) - { - return height; - } - - public ImageProducer getSource () - { - return source; - } - - public Graphics getGraphics () - { - return g; - } - - public Object getProperty (String name, ImageObserver observer) - { - return Image.UndefinedProperty; - } - - public void flush () - { - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java deleted file mode 100644 index 168e075b28b..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java +++ /dev/null @@ -1,53 +0,0 @@ -/* GtkPanelPeer.java -- Implements PanelPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkPanelPeer extends GtkContainerPeer - implements PanelPeer -{ - native void create (); - native void connectHooks (); - - public GtkPanelPeer (Panel p) - { - super (p); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java deleted file mode 100644 index c7a645a7cf4..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkPopupMenuPeer.java +++ /dev/null @@ -1,65 +0,0 @@ -/* GtkPopupMenuPeer.java -- Implements PopupMenuPeer with GTK+ - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.ComponentPeer; -import java.awt.peer.PopupMenuPeer; - -public class GtkPopupMenuPeer extends GtkMenuPeer - implements PopupMenuPeer -{ - public GtkPopupMenuPeer (PopupMenu menu) - { - super (menu); - } - - native void setupAccelGroup (GtkGenericPeer container); - - void setParent (MenuItem item) - { - // we don't need to "add" ourselves to our parent - } - - native void show (int x, int y, long time); - public void show (Component origin, int x, int y) - { - Point abs = origin.getLocationOnScreen (); - show (abs.x + x, abs.y + y, 0); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java deleted file mode 100644 index 9abde2ae44b..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkScrollPanePeer.java +++ /dev/null @@ -1,91 +0,0 @@ -/* GtkScrollPanePeer.java -- Implements ScrollPanePeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkScrollPanePeer extends GtkContainerPeer - implements ScrollPanePeer -{ - native void create (); - - native void gtkScrolledWindowNew(ComponentPeer parent, - int policy, int w, int h, int[] dims); - native void gtkScrolledWindowSetScrollPosition(int x, int y); - native void gtkScrolledWindowSetHScrollIncrement (int u); - native void gtkScrolledWindowSetVScrollIncrement (int u); - native void gtkScrolledWindowSetSize(int w, int h); - - public GtkScrollPanePeer (ScrollPane sp) - { - super (sp); - - setPolicy (sp.getScrollbarDisplayPolicy ()); - } - - native void setPolicy (int policy); - native public void childResized (int width, int height); - native public int getHScrollbarHeight (); - native public int getVScrollbarWidth (); - native public void setScrollPosition (int x, int y); - -// public Dimension getPreferredSize () -// { -// return new Dimension (60, 60); -// } - - public void setUnitIncrement (Adjustable adj, int u) - { - if (adj.getOrientation()==Adjustable.HORIZONTAL) - gtkScrolledWindowSetHScrollIncrement (u); - else - gtkScrolledWindowSetVScrollIncrement (u); - } - - public void setValue (Adjustable adj, int v) - { -// System.out.println("SPP: setVal: "+adj+":"+v); -// Point p=myScrollPane.getScrollPosition (); -// if (adj.getOrientation()==Adjustable.HORIZONTAL) -// gtkScrolledWindowSetScrollPosition (v,p.y); -// else -// gtkScrolledWindowSetScrollPosition (p.x,v); -// adj.setValue(v); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java deleted file mode 100644 index 07aee679158..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java +++ /dev/null @@ -1,78 +0,0 @@ -/* GtkScrollbarPeer.java -- Implements ScrollbarPeer with GTK+ - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.*; -import java.awt.peer.*; -import java.awt.event.AdjustmentEvent; - -public class GtkScrollbarPeer extends GtkComponentPeer - implements ScrollbarPeer -{ - void create () - { - Scrollbar sb = (Scrollbar) awtComponent; - - create (sb.getOrientation (), sb.getValue (), - sb.getMinimum (), sb.getMaximum (), - sb.getUnitIncrement (), sb.getBlockIncrement (), - sb.getVisibleAmount ()); - } - - native void create (int orientation, int value, - int min, int max, int stepIncr, int pageIncr, - int visibleAmount); - - native void connectHooks (); - - public GtkScrollbarPeer (Scrollbar s) - { - super (s); - } - - native public void setLineIncrement (int amount); - native public void setPageIncrement (int amount); - native public void setValues (int value, int visible, int min, int max); - - protected void postAdjustmentEvent (int type, int value) - { - q.postEvent (new AdjustmentEvent ((Adjustable)awtComponent, - AdjustmentEvent.ADJUSTMENT_VALUE_CHANGED, - type, value)); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java deleted file mode 100644 index 7a648b913ad..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkTextAreaPeer.java +++ /dev/null @@ -1,102 +0,0 @@ -/* GtkTextAreaPeer.java -- Implements TextAreaPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkTextAreaPeer extends GtkTextComponentPeer - implements TextAreaPeer -{ - native void create (int scrollbarVisibility); - - void create () - { - create (((TextArea)awtComponent).getScrollbarVisibility ()); - } - - // native void create (Object parent, String text, int scroll); - native void gtkTextGetSize (int rows, int cols, int dims[]); - - public GtkTextAreaPeer (TextArea ta) - { - super (ta); - } - - public native void insert (String str, int pos); - public native void replaceRange (String str, int start, int end); - - public Dimension getMinimumSize (int rows, int cols) - { - int dims[] = new int[2]; - - gtkTextGetSize (rows, cols, dims); - - return (new Dimension (dims[0], dims[1])); - } - - public Dimension getPreferredSize (int rows, int cols) - { - int dims[] = new int[2]; - - gtkTextGetSize (rows, cols, dims); - - return (new Dimension (dims[0], dims[1])); - } - - /* Deprecated */ - public Dimension minimumSize (int rows, int cols) - { - return getMinimumSize (rows, cols); - } - - public Dimension preferredSize (int rows, int cols) - { - return getPreferredSize (rows, cols); - } - - public void replaceText (String str, int start, int end) - { - replaceRange (str, start, end); - } - - public void insertText (String str, int pos) - { - insert (str, pos); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java deleted file mode 100644 index b9205cc46ca..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java +++ /dev/null @@ -1,79 +0,0 @@ -/* GtkTextComponentPeer.java -- Implements TextComponentPeer with GTK - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkTextComponentPeer extends GtkComponentPeer - implements TextComponentPeer -{ - GtkTextComponentPeer (TextComponent tc) - { - super (tc); - - setText (tc.getText ()); - } - - public native int getCaretPosition (); - public void setCaretPosition (int pos) - { - set ("text_position", pos); - } - public native int getSelectionStart (); - public native int getSelectionEnd (); - public native String getText (); - public native void select (int start, int end); - - public void setEditable (boolean state) - { - set ("editable", state); - } - - public native void setText (String text); - - public void getArgs (Component component, GtkArgList args) - { - super.getArgs (component, args); - - TextComponent tc = (TextComponent) component; - - args.add ("text_position", tc.getCaretPosition ()); - args.add ("editable", tc.isEditable ()); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java deleted file mode 100644 index 4dc23f8ba55..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkTextFieldPeer.java +++ /dev/null @@ -1,98 +0,0 @@ -/* GtkTextFieldPeer.java -- Implements TextFieldPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkTextFieldPeer extends GtkTextComponentPeer - implements TextFieldPeer -{ - -// native void create (ComponentPeer parent, String text); - - native void create (); - native void createHooks (); - - native void gtkEntryGetSize (int cols, int dims[]); - - public GtkTextFieldPeer (TextField tf) - { - super (tf); - - if (tf.echoCharIsSet ()) - setEchoChar (tf.getEchoChar ()); - } - - public Dimension getMinimumSize (int cols) - { - int dims[] = new int[2]; - - gtkEntryGetSize (cols, dims); - - return (new Dimension (dims[0], dims[1])); - } - - public Dimension getPreferredSize (int cols) - { - int dims[] = new int[2]; - - gtkEntryGetSize (cols, dims); - - return (new Dimension (dims[0], dims[1])); - } - - public native void setEchoChar (char c); - - /* Deprecated */ - - public Dimension minimumSize (int cols) - { - return getMinimumSize (cols); - } - - public Dimension preferredSize (int cols) - { - return getPreferredSize (cols); - } - - public void setEchoCharacter (char c) - { - setEchoChar (c); - } -} diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java deleted file mode 100644 index ffdc910e8a2..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java +++ /dev/null @@ -1,329 +0,0 @@ -/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers - Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; - -import java.awt.*; -import java.awt.datatransfer.*; -import java.awt.dnd.DragGestureEvent; -import java.awt.dnd.peer.DragSourceContextPeer; -import java.awt.im.InputMethodHighlight; -import java.awt.image.*; -import java.awt.peer.*; -import java.net.*; -import java.util.Hashtable; -import java.util.Map; -import java.util.MissingResourceException; -import java.util.Properties; -import gnu.java.awt.image.*; -import gnu.classpath.Configuration; - -/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer(). - This merits comment. We are basically calling Sun's bluff on this one. - We think Sun has deprecated it simply to discourage its use as it is - bad programming style. However, we need to get at a component's peer in - this class. If getPeer() ever goes away, we can implement a hash table - that will keep up with every window's peer, but for now this is faster. */ - -public class GtkToolkit extends java.awt.Toolkit -{ - GtkMainThread main; - Hashtable containers = new Hashtable(); - static EventQueue q = new EventQueue(); - static Clipboard systemClipboard; - - static - { - if (Configuration.INIT_LOAD_LIBRARY) - System.loadLibrary("gtkpeer"); - } - - public GtkToolkit () - { - main = new GtkMainThread (); - systemClipboard = new GtkClipboard (); - GtkGenericPeer.enableQueue (q); - } - - native public void beep (); - native private void getScreenSizeDimensions (int[] xy); - - public int checkImage (Image image, int width, int height, - ImageObserver observer) - { - return ImageObserver.ALLBITS; - -// GtkImage i = (GtkImage) image; -// return i.checkImage (); - } - - public Image createImage (String filename) - { - // FIXME - gcj local: GdkPixbufDecoder doesn't work. - // return new GtkImage (new GdkPixbufDecoder (filename), null); - return null; - } - - public Image createImage (URL url) - { - // FIXME - gcj local: GdkPixbufDecoder doesn't work. - // return new GtkImage (new GdkPixbufDecoder (url), null); - return null; - } - - public Image createImage (ImageProducer producer) - { - return new GtkImage (producer, null); - } - - public Image createImage (byte[] imagedata, int imageoffset, - int imagelength) - { - // System.out.println ("createImage byte[] NOT SUPPORTED"); - return null; - } - - public ColorModel getColorModel () - { - return ColorModel.getRGBdefault (); - } - - public String[] getFontList () - { - return (new String[] { "Dialog", - "DialogInput", - "Monospaced", - "Serif", - "SansSerif" }); - } - - public FontMetrics getFontMetrics (Font font) - { - return new GdkFontMetrics (font); - } - - public Image getImage (String filename) - { - // FIXME - gcj local: GdkPixbufDecoder doesn't work. - // return new GtkImage (new GdkPixbufDecoder (filename), null); - return null; - } - - public Image getImage (URL url) - { - // FIXME - gcj local: GdkPixbufDecoder doesn't work. - // return new GtkImage (new GdkPixbufDecoder (url), null); - return null; - } - - public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props) - { - return null; - } - - native public int getScreenResolution(); - - public Dimension getScreenSize () { - int dim[] = new int[2]; - getScreenSizeDimensions(dim); - return new Dimension(dim[0], dim[1]); - } - - public Clipboard getSystemClipboard() - { - return systemClipboard; - } - - public boolean prepareImage (Image image, int width, int height, - ImageObserver observer) - { - return false; - } - - native public void sync (); - - protected void setComponentState (Component c, GtkComponentPeer cp) - { - /* Make the Component reflect Peer defaults */ - if (c.getForeground () == null) - c.setForeground (cp.getForeground ()); - if (c.getBackground () == null) - c.setBackground (cp.getBackground ()); - // if (c.getFont () == null) - // c.setFont (cp.getFont ()); - - /* Make the Peer reflect the state of the Component */ - if (! (c instanceof Window)) - { - cp.setCursor (c.getCursor ()); - - Rectangle bounds = c.getBounds (); - cp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height); - cp.setVisible (c.isVisible ()); - } - } - - protected ButtonPeer createButton (Button b) - { - return new GtkButtonPeer (b); - } - - protected CanvasPeer createCanvas (Canvas c) - { - return new GtkCanvasPeer (c); - } - - protected CheckboxPeer createCheckbox (Checkbox cb) - { - return new GtkCheckboxPeer (cb); - } - - protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi) - { - return new GtkCheckboxMenuItemPeer (cmi); - } - - protected ChoicePeer createChoice (Choice c) - { - return new GtkChoicePeer (c); - } - - protected DialogPeer createDialog (Dialog d) - { - return new GtkDialogPeer (d); - } - - protected FileDialogPeer createFileDialog (FileDialog fd) - { - return new GtkFileDialogPeer (fd); - } - - protected FramePeer createFrame (Frame f) - { - return new GtkFramePeer (f); - } - - protected LabelPeer createLabel (Label label) - { - return new GtkLabelPeer (label); - } - - protected ListPeer createList (List list) - { - return new GtkListPeer (list); - } - - protected MenuPeer createMenu (Menu m) - { - return new GtkMenuPeer (m); - } - - protected MenuBarPeer createMenuBar (MenuBar mb) - { - return new GtkMenuBarPeer (mb); - } - - protected MenuItemPeer createMenuItem (MenuItem mi) - { - return new GtkMenuItemPeer (mi); - } - - protected PanelPeer createPanel (Panel p) - { - return new GtkPanelPeer (p); - } - - protected PopupMenuPeer createPopupMenu (PopupMenu target) - { - return new GtkPopupMenuPeer (target); - } - - protected ScrollPanePeer createScrollPane (ScrollPane sp) - { - return new GtkScrollPanePeer (sp); - } - - protected ScrollbarPeer createScrollbar (Scrollbar sb) - { - return new GtkScrollbarPeer (sb); - } - - protected TextAreaPeer createTextArea (TextArea ta) - { - return new GtkTextAreaPeer (ta); - } - - protected TextFieldPeer createTextField (TextField tf) - { - return new GtkTextFieldPeer (tf); - } - - protected WindowPeer createWindow (Window w) - { - return new GtkWindowPeer (w); - } - - protected FontPeer getFontPeer (String name, int style) - { - try { - GtkFontPeer fp = new GtkFontPeer (name, style); - return fp; - } catch (MissingResourceException ex) { - return null; - } - } - - protected EventQueue getSystemEventQueueImpl() - { - return q; - } - - protected void loadSystemColors (int[] systemColors) - { - } - - public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent e) - { - throw new Error("not implemented"); - } - - public Map mapInputMethodHighlight(InputMethodHighlight highlight) - { - throw new Error("not implemented"); - } -} // class GtkToolkit diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java deleted file mode 100644 index 7ef667e50ea..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java +++ /dev/null @@ -1,111 +0,0 @@ -/* GtkWindowPeer.java -- Implements WindowPeer with GTK - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -package gnu.java.awt.peer.gtk; -import java.awt.peer.*; -import java.awt.*; - -public class GtkWindowPeer extends GtkContainerPeer - implements WindowPeer -{ - static protected final int GTK_WINDOW_TOPLEVEL = 0; - static protected final int GTK_WINDOW_DIALOG = 1; - static protected final int GTK_WINDOW_POPUP = 2; - - native void create (int type); - - void create () - { - create (GTK_WINDOW_POPUP); - } - - native void connectHooks (); - - public GtkWindowPeer (Window window) - { - super (window); - - Dimension d = window.getSize (); - setBounds (0, 0, d.width, d.height); - } - - public void getArgs (Component component, GtkArgList args) - { - args.add ("visible", component.isVisible ()); - args.add ("sensitive", component.isEnabled ()); - } - - native public void toBack (); - native public void toFront (); - - native public void setBounds (int x, int y, int width, int height); - - public void setTitle (String title) - { - set ("title", title); - } - - native public void setResizable (boolean r); - - protected void postConfigureEvent (int x, int y, int width, int height, - int top, int left, int bottom, int right) - { - /* - If our borders change (which often happens when we opaque resize), - we need to make sure that a new layout will happen, since Sun - forgets to handle this case. - */ - if (insets.top != top - || insets.left != left - || insets.bottom != bottom - || insets.right != right) - { - awtComponent.invalidate (); - } - - insets.top = top; - insets.left = left; - insets.bottom = bottom; - insets.right = right; - - awtComponent.setBounds (x, y, width, height); - awtComponent.validate (); - } - - native public void setVisible (boolean b); -} diff --git a/libjava/gnu/java/awt/peer/gtk/Test.java b/libjava/gnu/java/awt/peer/gtk/Test.java deleted file mode 100644 index 7ecb593f125..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/Test.java +++ /dev/null @@ -1,299 +0,0 @@ -/* Test.java -- Tests the GTK Toolkit - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -import java.util.*; -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.*; -import java.awt.datatransfer.*; -import gnu.java.awt.image.*; -import java.io.*; - -class Test -{ - static int xs = 5, ys = 5; - - public static void main(String args[]) - { - if (args.length == 0) - { - Properties prop=System.getProperties (); - prop.put ("awt.toolkit","gnu.java.awt.peer.gtk.GtkToolkit"); - } - - final Frame f=new Frame(); - f.setTitle ("Red Hat Classpath"); - -// f.addComponentListener (new ComponentAdapter() { -// public void componentMoved (ComponentEvent e) { -// System.out.println("component moved"); -// } -// public void componentResized (ComponentEvent e) { -// System.out.println("component resized"); -// } -// }); - f.setSize(200,200); - - Panel pan=new Panel(); - - final Label l = new Label ("Pithy Message:"); - l.setCursor (Cursor.getPredefinedCursor (Cursor.WAIT_CURSOR)); - pan.add (l); - - TextField tf = new TextField("Hello world!"); - pan.add(tf); - - final Image img; - img = Toolkit.getDefaultToolkit ().createImage (new XBMDecoder ("fvwm.xbm")); - - - final Canvas ch = new Canvas () { - - public void update (Graphics g) - { - System.out.println ("update called"); - super.update (g); - } - public void paint (Graphics g) { - g.drawString("Hello world!", xs+5, ys+10); - g.setColor (Color.blue); - g.drawLine (xs,ys,xs+20,ys+20); - -// System.out.println (TextArea.SCROLLBARS_BOTH); -// System.out.println (TextArea.SCROLLBARS_HORIZONTAL_ONLY); -// System.out.println (TextArea.SCROLLBARS_VERTICAL_ONLY); - -// Font f1 = new Font ("TimesRoman", Font.PLAIN, 10); -// System.out.println (f1.getName ()); -// System.out.println (f1.getFamily ()); - -// Font font = new Font ("Serif", Font.PLAIN, 18); -// g.setFont (font); -// g.setXORMode (Color.red); - - -// System.out.println (g.getFontMetrics (font).stringWidth ("foobar")); - -// System.out.println (g.drawImage (img, 0, 0, this)); - } - }; - - ch.setSize(60, 60); -// List ch=new List(); -// ch.add("Ding"); -// ch.add("September"); -// ch.add("Red"); -// ch.add("Quassia"); -// ch.add("Pterodactyl"); - -// ch.addMouseListener(new MouseAdapter() { -// public void mousePressed(MouseEvent e) { -// System.out.println("mouse pressed ch"); -// System.out.println("shift = " + e.isShiftDown()); -// System.out.println("meta = " + e.isMetaDown()); -// System.out.println("alt = " + e.isAltDown()); -// System.out.println("ctrl = " + e.isControlDown()); -// System.out.println("x = " + e.getX()); -// System.out.println("y = " + e.getY()); -// System.out.println("clickcount = " + e.getClickCount()); -// System.out.println("when = " + e.getWhen()); -// System.out.println(); -// } -// public void mouseReleased(MouseEvent e) { -// System.out.println("mouse released ch"); -// } -// public void mouseClicked(MouseEvent e) { -// System.out.println("mouse clicked ch"); -// } -// }); - - pan.add(ch); - f.add(pan,"North"); - - final ScrollPane sp=new ScrollPane(ScrollPane.SCROLLBARS_ALWAYS); - System.out.println ("ALWAYS HERE: " + ScrollPane.SCROLLBARS_ALWAYS); - System.out.println ("ALWAYS" + ScrollPane.SCROLLBARS_ALWAYS); - System.out.println ("NEEDED" + ScrollPane.SCROLLBARS_AS_NEEDED); - System.out.println ("NEVER " + ScrollPane.SCROLLBARS_NEVER); - - - final Panel p=new Panel(); - System.out.println ("PREFERED: " + p.getPreferredSize ()); - p.add(new Button("Stop")); - System.out.println ("PREFERED: " + p.getPreferredSize ()); - p.add(new Button("evil")); - System.out.println ("PREFERED: " + p.getPreferredSize ()); - p.add(new Button("hoarders")); - p.add(new Button("use")); - p.add(new Button("GNU")); - p.add(new Scrollbar(Scrollbar.HORIZONTAL)); - System.out.println ("PREFERED: " + p.getPreferredSize ()); - - sp.add(p); - f.add(sp,"South"); - - Panel east_panel = new Panel(); - east_panel.setLayout(new GridLayout (0,1)); - -// CheckboxGroup group = new CheckboxGroup(); - -// Checkbox cb=new Checkbox("one", group, true); -// east_panel.add(cb); -// cb=new Checkbox("two", group, false); -// east_panel.add(cb); - -// cb.addMouseListener(new MouseAdapter() { -// public void mousePressed(MouseEvent e) { -// System.out.println("mouse pressed cb"); -// System.out.println("shift = " + e.isShiftDown()); -// System.out.println("meta = " + e.isMetaDown()); -// System.out.println("alt = " + e.isAltDown()); -// System.out.println("ctrl = " + e.isControlDown()); -// System.out.println("x = " + e.getX()); -// System.out.println("y = " + e.getY()); -// System.out.println("clickcount = " + e.getClickCount()); -// System.out.println("when = " + e.getWhen()); -// System.out.println(); -// } -// public void mouseReleased(MouseEvent e) { -// System.out.println("mouse released cb"); -// } -// public void mouseClicked(MouseEvent e) { -// System.out.println("mouse clicked cb"); -// } -// public void mouseEntered(MouseEvent e) { -// System.out.println("mouse entered cb"); -// } -// public void mouseExited(MouseEvent e) { -// System.out.println("mouse exited cb"); -// } -// }); - - f.add(east_panel,"East"); - - final Button wb=new Button(); - wb.setLabel("Destroy Frame on Click"); - wb.addActionListener (new ActionListener () { - public void actionPerformed (ActionEvent e) { - ScrollPanePeer peer = (ScrollPanePeer)sp.getPeer (); - if (peer != null) - { - System.out.println (peer.getHScrollbarHeight ()); - System.out.println (peer.getVScrollbarWidth ()); - } - - l.setText ("Hello World!"); - System.out.println ("PREFERED: " + p.getPreferredSize ()); - - final Dialog d = new Dialog (f); - d.setModal (true); - Button b = new Button ("foobar"); - b.addMouseListener (new MouseAdapter () { - public void mousePressed (MouseEvent me) { - System.out.println ("I got called"); - d.hide (); - -// System.out.println (ScrollPane.SCROLLBARS_ALWAYS); -// System.out.println (ScrollPane.SCROLLBARS_AS_NEEDED); -// System.out.println (ScrollPane.SCROLLBARS_NEVER); - } - }); - d.add (b); - d.pack (); - d.show (); - System.out.println ("hello world"); -// System.out.println ("action listener on wb called"); -// Clipboard clip = Toolkit.getDefaultToolkit ().getSystemClipboard (); -// StringSelection ss = new StringSelection("123456789"); -// clip.setContents (ss, ss); -// Transferable t = clip.getContents (this); -// try { -// System.out.println (t.getTransferData (DataFlavor.stringFlavor)); -// } catch (Exception ex) { -// ex.printStackTrace (); -// } -// System.exit (0); - } - }); - - wb.addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent e) { - System.out.println("mouse pressed wb"); - xs++; - ys++; - ch.repaint (); - } - public void mouseReleased(MouseEvent e) { - System.out.println("mouse released wb"); - } - public void mouseClicked(MouseEvent e) { - System.out.println("mouse clicked wb"); - } - public void mouseEntered(MouseEvent e) { - System.out.println("mouse entered wb"); - } - public void mouseExited(MouseEvent e) { - System.out.println("mouse exited wb"); - } - }); - - f.add(wb,"West"); - - f.pack(); - f.show(); - - sp.setScrollPosition (10,0); - - Toolkit t = Toolkit.getDefaultToolkit(); - /* t.beep(); */ - System.out.println("screen size: " + t.getScreenSize()); - System.out.println("resolution : " + t.getScreenResolution()); -// try { -// Thread.sleep (5000); -// } catch (InterruptedException e) {} -// f.setSize(500,500); - - System.out.println ("background of canvas: " + ch.getBackground ()); - System.out.println ("foreground of canvas: " + ch.getForeground ()); - - System.out.println("done"); - } -} - - - diff --git a/libjava/gnu/java/awt/peer/gtk/TestAWT.java b/libjava/gnu/java/awt/peer/gtk/TestAWT.java deleted file mode 100644 index 48cdce1a1fe..00000000000 --- a/libjava/gnu/java/awt/peer/gtk/TestAWT.java +++ /dev/null @@ -1,571 +0,0 @@ -/* TestAWT.java -- Tests the AWT like testgtk - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -import java.awt.List; -import java.util.*; -import java.awt.*; -import java.awt.event.*; -import java.awt.peer.*; - -class TestAWT -{ - public static void main(String args[]) - { - if (args.length==0) - { - Properties prop = System.getProperties (); - prop.put ("awt.toolkit", "gnu.java.awt.peer.gtk.GtkToolkit"); - } - MainWindow f = new MainWindow(); - System.out.println(f.isDisplayable()); - f.show(); - System.out.println(f.isDisplayable()); - } -} - -interface SubWindow -{ - public void init (); -} - -class PrettyPanel extends Panel -{ - Insets myInsets; - - public PrettyPanel () - { - myInsets = new Insets (10, 10, 10, 10); - } - public Insets getInsets () - { - return myInsets; - } -} - -abstract class PrettyFrame extends Frame -{ - public PrettyFrame () - { - ((BorderLayout) getLayout ()).setHgap (5); - ((BorderLayout) getLayout ()).setVgap (5); - } - -// public Insets getInsets() -// { -// Insets oldInsets = super.getInsets (); -// return new Insets (oldInsets.top+10, -// oldInsets.left+10, -// oldInsets.bottom+10, -// oldInsets.right+10); -// } -} - -abstract class SubFrame extends PrettyFrame implements SubWindow -{ - boolean initted = false; - - public void setVisible (boolean visible) - { - if (!initted && visible) - init(); - super.setVisible (visible); - } -} - -class MainWindow extends PrettyFrame implements ActionListener -{ - Button closeButton; - - Hashtable windows; - Vector buttons; - - void addSubWindow (String name, SubWindow w) - { - Button b = new Button (name); - b.addActionListener (this); - - buttons.addElement (b); - windows.put (b, w); - } - - MainWindow () - { - MenuBar mb = new MenuBar (); - Menu menu = new Menu ("File"); - Menu submenu = new Menu ("Testing"); - submenu.add (new CheckboxMenuItem ("Foobar")); - menu.add (submenu); - mb.add (menu); - - setMenuBar (mb); - - add (new Label ("Classpath v0.0.0"), "North"); - - closeButton = new Button ("Close"); - closeButton.addActionListener (this); - closeButton.setFont (new Font ("Serif", Font.BOLD | Font.ITALIC, 18)); - add (closeButton, "South"); - - windows = new Hashtable (); - buttons = new Vector (); - - addSubWindow ("Buttons", new ButtonsWindow ()); - addSubWindow ("Cursors", new CursorsWindow ()); - addSubWindow ("Dialog", new DialogWindow (this)); - addSubWindow ("File", new FileWindow (this)); - addSubWindow ("Labels", new LabelWindow ()); - addSubWindow ("List", new ListWindow ()); - addSubWindow ("Radio Buttons", new RadioWindow ()); - addSubWindow ("TextField", new TextFieldWindow ()); - - Panel sp = new Panel(); - PrettyPanel p = new PrettyPanel(); - p.setLayout (new GridLayout (windows.size(), 1)); - - for (Enumeration e = buttons.elements (); e.hasMoreElements (); ) - { - p.add ((Button) e.nextElement ()); - } - - sp.add (p); - add (sp, "Center"); - - setSize (200, 86 + (windows.size ()*22)); - setTitle ("TestAWT"); - } - - public void actionPerformed (ActionEvent evt) - { - Button source = (Button) evt.getSource (); - - if (source==closeButton) - { - System.getProperties ().list (System.out); - dispose(); - System.exit (0); - } - - Window w = (Window) windows.get (source); - if (w.isVisible ()) - w.dispose (); - else - { - w.setVisible (true); - w.show(); - } - } -} - -class ButtonsWindow extends SubFrame implements ActionListener -{ - Button b[] = new Button [9]; - - public void init () - { - initted = true; - Panel p = new Panel (); - p.setLayout (new GridLayout (0, 3, 5, 5)); - - for (int i=0; i<9; i++) - { - b[i]=new Button ("button" + (i+1)); - b[i].addActionListener (this); - } - - p.add (b[0]); - p.add (b[6]); - p.add (b[4]); - p.add (b[8]); - p.add (b[1]); - p.add (b[7]); - p.add (b[3]); - p.add (b[5]); - p.add (b[2]); - - add (p, "North"); - - Button cb = new Button ("close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - add (cb, "South"); - setTitle ("Buttons"); - } - - public void actionPerformed (ActionEvent evt) - { - Button source = (Button) evt.getSource (); - - for (int i=0; i<9; i++) - { - if (source == b[i]) - { - int i2=((i+1)==9)?0:(i+1); - if (b[i2].isVisible()) - b[i2].setVisible(false); - else - b[i2].setVisible(true); - } - } - } -} - - -class DialogWindow extends Dialog implements SubWindow -{ - Label text; - boolean initted = false; - - public DialogWindow (Frame f) - { - super (f, true); - } - - public void setVisible (boolean visible) - { - if (!initted && visible) - init(); - super.setVisible (visible); - } - - public void init () - { - text = new Label ("Dialog Test"); - text.setAlignment (Label.CENTER); - - add (text, "North"); - text.setVisible (false); - - Panel p = new PrettyPanel(); - - Button cb = new Button ("OK"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) - { - dispose(); - } - }); - - p.setLayout (new GridLayout (1, 2)); - ((GridLayout) p.getLayout ()).setHgap (5); - ((GridLayout) p.getLayout ()).setVgap (5); - p.add (cb); - - Button toggle = new Button ("Toggle"); - p.add (toggle); - - toggle.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) - { - if (text.isVisible ()) - text.setVisible (false); - else - text.setVisible (true); - doLayout(); - } - }); - - add (p, "South"); - setTitle ("Dialog"); - setSize (130, 70); - } -} - -class CursorsWindow extends SubFrame implements ItemListener -{ - Choice cursorChoice; - Canvas cursorCanvas; - - public void init () - { - cursorChoice = new Choice(); - cursorChoice.add ("Default"); - cursorChoice.add ("Crosshair"); - cursorChoice.add ("Text"); - cursorChoice.add ("Wait"); - cursorChoice.add ("Southwest Resize"); - cursorChoice.add ("Southeast Resize"); - cursorChoice.add ("Northwest Resize"); - cursorChoice.add ("Northeast Resize"); - cursorChoice.add ("North Resize"); - cursorChoice.add ("South Resize"); - cursorChoice.add ("West Resize"); - cursorChoice.add ("East Resize"); - cursorChoice.add ("Hand"); - cursorChoice.add ("Move"); - - cursorChoice.addItemListener(this); - - add (cursorChoice, "North"); - - cursorCanvas = new Canvas () - { - public void paint (Graphics g) - { - Dimension d = this.getSize(); - g.setColor (Color.white); - g.fillRect (0, 0, d.width, d.height/2); - g.setColor (Color.black); - g.fillRect (0, d.height/2, d.width, d.height/2); - g.setColor (this.getBackground()); - g.fillRect (d.width/3, d.height/3, d.width/3, - d.height/3); - } - }; - - cursorCanvas.setSize (80,80); - - add (cursorCanvas, "Center"); - - Button cb = new Button ("Close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - - add (cb, "South"); - setTitle ("Cursors"); - setSize (160, 180); - } - - public void itemStateChanged (ItemEvent e) - { - cursorCanvas.setCursor (Cursor.getPredefinedCursor (cursorChoice.getSelectedIndex())); - } -} - -class TextFieldWindow extends SubFrame implements ItemListener -{ - Checkbox editable, visible, sensitive; - TextField text; - - public void init () - { - initted = true; - text = new TextField ("hello world"); - add (text, "North"); - - Panel p = new Panel(); - p.setLayout (new GridLayout (3, 1)); - ((GridLayout) p.getLayout ()).setHgap (5); - ((GridLayout) p.getLayout ()).setVgap (5); - - editable = new Checkbox("Editable", true); - p.add (editable); - editable.addItemListener (this); - - visible = new Checkbox("Visible", true); - p.add (visible); - visible.addItemListener (this); - - sensitive = new Checkbox("Sensitive", true); - p.add (sensitive); - sensitive.addItemListener (this); - - add (p, "Center"); - - Button cb = new Button ("Close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - - add (cb, "South"); - setTitle ("TextField"); - setSize (160, 180); - } - - public void itemStateChanged (ItemEvent e) - { - boolean on=true; - - if (e.getStateChange () == ItemEvent.DESELECTED) - on=false; - if (e.getSource() == editable) - text.setEditable (on); - if (e.getSource() == visible) - if (on) - text.setEchoChar ((char) 0); - else - text.setEchoChar ('*'); - if (e.getSource() == sensitive) - text.setEnabled (on); - - } -} - -class FileWindow extends FileDialog implements SubWindow -{ - boolean initted = false; - - public FileWindow (MainWindow mw) - { - super (mw); - } - - public void setVisible (boolean visible) - { - if (!initted && visible) - init(); - super.setVisible (visible); - } - - public void init() - { - initted = true; - } -} - -class LabelWindow extends SubFrame -{ - public void init () - { - initted = true; - - Panel p = new Panel(); - p.setLayout (new GridLayout (3, 1)); - ((GridLayout) p.getLayout ()).setHgap (5); - ((GridLayout) p.getLayout ()).setVgap (5); - - p.add (new Label ("left justified label", Label.LEFT)); - p.add (new Label ("center justified label", Label.CENTER)); - p.add (new Label ("right justified label", Label.RIGHT)); - - add (p, "Center"); - - Button cb = new Button ("Close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - - add (cb, "South"); - setTitle ("Labels"); - setSize (160, 180); - } -} - -class ListWindow extends SubFrame -{ - public void init () - { - initted = true; - - Panel p = new Panel (); - p.setLayout (new GridLayout (3, 1)); - - List l = new List (5, true); - for (int i = 0; i < 10; i++) - l.add ("added item " + i); - - p.add (l); - - add (p, "Center"); - - Button cb = new Button ("Close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - - add (cb, "South"); - setTitle ("List"); - setSize (85, 167); - } -} - - -class RadioWindow extends SubFrame -{ - public void init () - { - initted = true; - - Panel p = new Panel(); - p.setLayout (new GridLayout (3, 1)); - ((GridLayout) p.getLayout ()).setHgap (5); - ((GridLayout) p.getLayout ()).setVgap (5); - - final CheckboxGroup cg = new CheckboxGroup(); - final Checkbox[] boxes = new Checkbox[3]; - for (int i = 0; i < 3; ++i) - { - boxes[i] = new Checkbox("button" + i, cg, i == 0); - p.add(boxes[i]); - } - - add (p, "North"); - - p = new Panel(); - p.setLayout (new GridLayout (1, 3)); - ((GridLayout) p.getLayout ()).setHgap (5); - ((GridLayout) p.getLayout ()).setVgap (5); - - for (int i = 0; i < 3; ++i) - { - final int val = i; - Button tweak = new Button ("Set " + i); - tweak.addActionListener(new ActionListener () - { - public void actionPerformed (ActionEvent e) - { - cg.setSelectedCheckbox(boxes[val]); - } - }); - p.add(tweak); - } - - add (p, "Center"); - - Button cb = new Button ("Close"); - cb.addActionListener(new ActionListener () { - public void actionPerformed (ActionEvent e) { - dispose(); - } - }); - - add (cb, "South"); - setTitle ("Radio Buttons"); - setSize (85, 167); - } -} diff --git a/libjava/jni/classpath/jcl.c b/libjava/jni/classpath/jcl.c deleted file mode 100644 index 66c756e0ffd..00000000000 --- a/libjava/jni/classpath/jcl.c +++ /dev/null @@ -1,134 +0,0 @@ -/* jcl.c - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include <stdio.h> -#include <jcl.h> -#include <malloc.h> - -static char errstr[4098]; // this way the memory is pre-allocated, so that we do not have to worry if we are out of memory. - -JNIEXPORT void JNICALL JCL_ThrowException(JNIEnv * env, char * className, char * errMsg) { - jclass excClass; - if((*env)->ExceptionOccurred(env)) { - (*env)->ExceptionClear(env); - } - excClass = (*env)->FindClass(env, className); - if(excClass == NULL) { - jclass errExcClass; - errExcClass = (*env)->FindClass(env, "java/lang/ClassNotFoundException"); - if(errExcClass == NULL) { - errExcClass = (*env)->FindClass(env, "java/lang/InternalError"); - if(errExcClass == NULL) { - sprintf(errstr,"JCL: Utterly failed to throw exeption %s with message %s.",className,errMsg); - fprintf(stderr, errstr); - return; - } - } - sprintf(errstr,"JCL: Failed to throw exception %s with message %s: could not find exception class.", className, errMsg); - (*env)->ThrowNew(env, errExcClass, errstr); - } - (*env)->ThrowNew(env, excClass, errMsg); -} - -JNIEXPORT void * JNICALL JCL_malloc(JNIEnv * env, size_t size) { - void * mem = malloc(size); - if(mem == NULL) { - JCL_ThrowException(env, "java/lang/OutOfMemoryError", "malloc() failed."); - return NULL; - } - return mem; -} - -JNIEXPORT void * JNICALL JCL_realloc(JNIEnv *env, void *ptr, size_t size) -{ - ptr = realloc(ptr, size); - if (ptr == 0) - { - JCL_ThrowException(env, "java/lang/OutOfMemoryError", - "malloc() failed."); - return NULL; - } - return(ptr); -} - -JNIEXPORT void JNICALL JCL_free(JNIEnv * env, void * p) { - if(p != NULL) { - free(p); - } -} - -JNIEXPORT char * JNICALL JCL_jstring_to_cstring(JNIEnv * env, jstring s) { - char* cstr; - if(s == NULL) { - JCL_ThrowException(env, "java/lang/NullPointerException","Null string"); - return NULL; - } - cstr = (char*)(*env)->GetStringUTFChars(env, s, NULL); - if(cstr == NULL) { - JCL_ThrowException(env, "java/lang/InternalError", "GetStringUTFChars() failed."); - return NULL; - } - return cstr; -} - -JNIEXPORT void JNICALL JCL_free_cstring(JNIEnv * env, jstring s, char * cstr) { - (*env)->ReleaseStringUTFChars(env, s, cstr); -} - -JNIEXPORT jint JNICALL JCL_MonitorEnter(JNIEnv * env, jobject o) { - jint retval = (*env)->MonitorEnter(env,o); - if(retval != 0) { - JCL_ThrowException(env, "java/lang/InternalError", "MonitorEnter() failed."); - } - return retval; -} - -JNIEXPORT jint JNICALL JCL_MonitorExit(JNIEnv * env, jobject o) { - jint retval = (*env)->MonitorExit(env,o); - if(retval != 0) { - JCL_ThrowException(env, "java/lang/InternalError", "MonitorExit() failed."); - } - return retval; -} - -JNIEXPORT jclass JNICALL JCL_FindClass(JNIEnv * env, char * className) { - jclass retval = (*env)->FindClass(env,className); - if(retval == NULL) { - JCL_ThrowException(env, "java/lang/ClassNotFoundException", className); - } - return retval; -} diff --git a/libjava/jni/classpath/jcl.h b/libjava/jni/classpath/jcl.h deleted file mode 100644 index a7d00b47cd3..00000000000 --- a/libjava/jni/classpath/jcl.h +++ /dev/null @@ -1,64 +0,0 @@ -/* jcl.h - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#ifndef __JCL_H__ -#define __JCL_H__ - -#include <stddef.h> -#include <jni.h> -#include <config.h> - -JNIEXPORT jclass JNICALL JCL_FindClass(JNIEnv * env, char * className); -JNIEXPORT void JNICALL JCL_ThrowException(JNIEnv * env, char * className, char * errMsg); -JNIEXPORT void * JNICALL JCL_malloc(JNIEnv *env, size_t size); -JNIEXPORT void * JNICALL JCL_realloc(JNIEnv *env, void *ptr, size_t size); -JNIEXPORT void JNICALL JCL_free(JNIEnv *env, void * p); -JNIEXPORT char * JNICALL JCL_jstring_to_cstring(JNIEnv *env, jstring s); -JNIEXPORT void JNICALL JCL_free_cstring(JNIEnv *env, jstring s, char * cstr); -JNIEXPORT jint JNICALL JCL_MonitorEnter(JNIEnv *env, jobject o); -JNIEXPORT jint JNICALL JCL_MonitorExit(JNIEnv *env, jobject o); - -#define JCL_RETHROW_EXCEPTION(env) if((*(env))->ExceptionOccurred((env)) != NULL) return NULL; - -/* Simple debug macro */ -#ifdef DEBUG -#define DBG(x) fprintf(stderr, (x)); -#else -#define DBG(x) -#endif - -#endif diff --git a/libjava/jni/classpath/jnilink.c b/libjava/jni/classpath/jnilink.c deleted file mode 100644 index 0c244f285af..00000000000 --- a/libjava/jni/classpath/jnilink.c +++ /dev/null @@ -1,117 +0,0 @@ -/* JNILINK 1.1: JNI version. - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "jnilink.h" -#include <string.h> -#include <jcl.h> - -#include <malloc.h> - -#define GETCLASS(c) *(jclass*)(c) - -JNIEXPORT jclass JNICALL -LINK_RelinkClass (JNIEnv * env, linkedClass * c, char * name) { - jclass found; - LINK_UnlinkClass(env,*c); - - found = (*env)->FindClass(env,name); - if(found == NULL) - return NULL; - - *c = JCL_malloc(env,sizeof(jclass)); - if(*c == NULL) - return NULL; - - GETCLASS(*c) = (*env)->NewGlobalRef(env,found); - return GETCLASS(*c); -} - -JNIEXPORT jclass JNICALL -LINK_RelinkKnownClass(JNIEnv * env, linkedClass * c, jclass newClass) { - LINK_UnlinkClass(env,*c); - - *c = JCL_malloc(env,sizeof(jclass)); - if(*c == NULL) - return NULL; - - GETCLASS(*c) = (*env)->NewGlobalRef(env,newClass); - return newClass; -} - -JNIEXPORT jmethodID JNICALL -LINK_RelinkMethod (JNIEnv * env, jmethodID * m, linkedClass c, - char * name, char * sig) { - *m = (*env)->GetMethodID(env,GETCLASS(c),name,sig); - return *m; -} - -JNIEXPORT jmethodID JNICALL -LINK_RelinkStaticMethod(JNIEnv * env, jmethodID * m, linkedClass c, - char * name, char * sig) { - *m = (*env)->GetStaticMethodID(env,GETCLASS(c),name,sig); - return *m; -} - -JNIEXPORT jfieldID JNICALL -LINK_RelinkField (JNIEnv * env, jfieldID * f, linkedClass c, - char * name, char * sig) { - *f = (*env)->GetFieldID(env,GETCLASS(c),name,sig); - return *f; -} - -JNIEXPORT jfieldID JNICALL -LINK_RelinkStaticField (JNIEnv * env, jfieldID * f, linkedClass c, - char * name, char * sig) { - *f = (*env)->GetStaticFieldID(env,GETCLASS(c),name,sig); - return *f; -} - - -/* These are for when the class referencing the symbols is unloaded; it -destroys any object references - * the linker might have kept around. - */ -JNIEXPORT void JNICALL LINK_UnlinkClass (JNIEnv * env, linkedClass * c) { - if(*c != NULL) { - if(GETCLASS(*c) != NULL) - (*env)->DeleteGlobalRef(env,GETCLASS(*c)); - JCL_free(env,*c); - *c = NULL; - } -} - diff --git a/libjava/jni/classpath/jnilink.h b/libjava/jni/classpath/jnilink.h deleted file mode 100644 index 448e2b5dfdd..00000000000 --- a/libjava/jni/classpath/jnilink.h +++ /dev/null @@ -1,86 +0,0 @@ -/* JNILINK 1.1: JNI version. - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#ifndef __JNILINK_H__ -#define __JNILINK_H__ - -#include <jni.h> - -typedef void* linkedClass; - -#define LINK_LinkClass(env,c,name) ((c)==NULL ? LINK_ReallyLinkClass((env),&(c),(name)) : (c)) -#define LINK_LinkKnownClass(env,c,newClass) ((c)==NULL ? LINK_ReallyLinkKnownClass((env),&(c),(newClass)) : (c)) -#define LINK_LinkMethod(env,m,c,name,sig) ((m)==NULL ? LINK_RelinkMethod((env),&(m),(c),(name),(sig)) : (m)) -#define LINK_LinkStaticMethod(env,m,c,name,sig) ((m)==NULL ? LINK_RelinkStaticMethod((env),&(m),(c),(name),(sig)) : (m)) -#define LINK_LinkField(env,f,c,name,sig) ((m)==NULL ? LINK_RelinkField((env),&(f),(c),(name),(sig)) : (f)) -#define LINK_LinkStaticField(env,f,c,name,sig) ((m)==NULL ? LINK_RelinkStaticField((env),&(f),(c),(name),(sig)) : (f)) - -#define LINK_LinkConstructor(env,m,c,sig) ((m)==NULL ? LINK_RelinkMethod((env),&(m),(c),"<init>",(sig)) : (m)) - -JNIEXPORT jclass JNICALL -LINK_ReallyLinkClass (JNIEnv * env, linkedClass * c, - char * name); -JNIEXPORT jclass JNICALL -LINK_ReallyLinkKnownClass(JNIEnv * env, linkedClass * c, - jclass newClass); -JNIEXPORT jclass JNICALL -LINK_RelinkClass (JNIEnv * env, linkedClass * c, - char * name); -JNIEXPORT jclass JNICALL -LINK_RelinkKnownClass (JNIEnv * env, linkedClass * c, - jclass newClass); -JNIEXPORT jmethodID JNICALL -LINK_RelinkMethod (JNIEnv * env, jmethodID * m, linkedClass c, - char * name, char * sig); -JNIEXPORT jmethodID JNICALL -LINK_RelinkStaticMethod(JNIEnv * env, jmethodID * m, linkedClass c, - char * name, char * sig); -JNIEXPORT jfieldID JNICALL -LINK_RelinkField (JNIEnv * env, jfieldID * f, linkedClass c, - char * name, char * sig); -JNIEXPORT jfieldID JNICALL -LINK_RelinkStaticField (JNIEnv * env, jfieldID * f, linkedClass c, - char * name, char * sig); - -/* These are for when the class referencing the symbols is unloaded; it -destroys any object references - * the linker might have kept around. - */ -JNIEXPORT void JNICALL LINK_UnlinkClass (JNIEnv * env, linkedClass * c); - -#endif diff --git a/libjava/jni/classpath/native_state.c b/libjava/jni/classpath/native_state.c deleted file mode 100644 index 746686edd97..00000000000 --- a/libjava/jni/classpath/native_state.c +++ /dev/null @@ -1,247 +0,0 @@ -/* Magical NSA API -- Associate a C ptr with an instance of an object - Copyright (C) 1998, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include <stdlib.h> -#include <jni.h> -#include "native_state.h" - -#define DEFAULT_TABLE_SIZE 97 - -struct state_table * -init_state_table_with_size (JNIEnv *env, jclass clazz, jint size) -{ - struct state_table *table; - jfieldID hash; - jclass clazz_g; - - hash = (*env)->GetFieldID (env, clazz, "native_state", "I"); - if (hash == NULL) - return NULL; - - clazz_g = (*env)->NewGlobalRef (env, clazz); - if (clazz_g == NULL) - return NULL; - - table = (struct state_table *) malloc (sizeof (struct state_table)); - table->size = size; - table->head = (struct state_node **) calloc (sizeof (struct state_node *), - table->size); - table->hash = hash; - table->clazz = clazz_g; - - return table; -} - -struct state_table * -init_state_table (JNIEnv *env, jclass clazz) -{ - return init_state_table_with_size (env, clazz, DEFAULT_TABLE_SIZE); -} - -static void * -remove_node (struct state_node **head, jint obj_id) -{ - struct state_node *back_ptr = NULL; - struct state_node *node = *head; - - while (node != NULL) - { - if (node->key == obj_id) - { - void *return_value; - if (back_ptr == NULL) - *head = node->next; - else - back_ptr->next = node->next; - return_value = node->c_state; - free (node); - return return_value; - } - back_ptr = node; - node = node->next; - } - - return NULL; -} - -static void * -get_node (struct state_node **head, jint obj_id) -{ - struct state_node *back_ptr = NULL; - struct state_node *node = *head; - - while (node != NULL) - { - if (node->key == obj_id) - { - /* Move the node we found to the front of the list. */ - if (back_ptr != NULL) - { - back_ptr->next = node->next; - node->next = *head; - *head = node; - } - - /* Return the match. */ - return node->c_state; - } - - back_ptr = node; - node = node->next; - } - - return NULL; -} - -static void -add_node (struct state_node **head, jint obj_id, void *state) -{ - struct state_node *node = *head; - struct state_node *back_ptr = NULL; - - struct state_node *new_node; - - if (node != NULL) - { - while (node->next != NULL && obj_id != node->key) - { - back_ptr = node; - node = node->next; - } - - if (node->key == obj_id) - { - /* If we're updating a node, move it to the front of the - list. */ - if (back_ptr != NULL) - { - back_ptr->next = node->next; - node->next = *head; - } - node->c_state = state; - return; - } - } - - new_node = (struct state_node *) malloc (sizeof (struct state_node)); - new_node->key = obj_id; - new_node->c_state = state; - new_node->next = *head; - *head = new_node; -} - -void -set_state_oid (JNIEnv *env, jobject lock, struct state_table *table, - jint obj_id, void *state) -{ - jint hash; - - hash = obj_id % table->size; - - (*env)->MonitorEnter (env, lock); - add_node (&table->head[hash], obj_id, state); - (*env)->MonitorExit (env, lock); -} - -void * -get_state_oid (JNIEnv *env, jobject lock, struct state_table *table, - jint obj_id) -{ - jint hash; - void *return_value; - - hash = obj_id % table->size; - - (*env)->MonitorEnter (env, lock); - return_value = get_node (&table->head[hash], obj_id); - (*env)->MonitorExit (env, lock); - - return return_value; -} - -void * -remove_state_oid (JNIEnv *env, jobject lock, struct state_table *table, - jint obj_id) -{ - jint hash; - void *return_value; - - hash = obj_id % table->size; - - (*env)->MonitorEnter (env, lock); - return_value = remove_node (&table->head[hash], obj_id); - (*env)->MonitorExit (env, lock); - - return return_value; -} - -int -set_state (JNIEnv *env, jobject obj, struct state_table *table, void *state) -{ - jint obj_id; - obj_id = (*env)->GetIntField (env, obj, table->hash); - - if ((*env)->ExceptionOccurred (env) != NULL) - return -1; - - set_state_oid (env, table->clazz, table, obj_id, state); - return 0; -} - -void * -get_state (JNIEnv *env, jobject obj, struct state_table *table) -{ - jint obj_id; - obj_id = (*env)->GetIntField (env, obj, table->hash); - - if ((*env)->ExceptionOccurred (env) != NULL) - return NULL; - - return get_state_oid (env, table->clazz, table, obj_id); -} - -void * -remove_state_slot (JNIEnv *env, jobject obj, struct state_table *table) -{ - jint obj_id; - obj_id = (*env)->GetIntField (env, obj, table->hash); - - if ((*env)->ExceptionOccurred (env) != NULL) - return NULL; - - return remove_state_oid (env, table->clazz, table, obj_id); -} diff --git a/libjava/jni/classpath/native_state.h b/libjava/jni/classpath/native_state.h deleted file mode 100644 index 25ef6b546f1..00000000000 --- a/libjava/jni/classpath/native_state.h +++ /dev/null @@ -1,71 +0,0 @@ -/* Magical NSA API -- Associate a C ptr with an instance of an object - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#ifndef JCL_NATIVE_STATE -#define JCL_NATIVE_STATE - -#include <jni.h> - -struct state_table -{ - jint size; /* number of slots, should be prime */ - jfieldID hash; /* field containing System.identityHashCode(this) */ - jclass clazz; /* lock aquired for reading/writing nodes */ - struct state_node **head; -}; - -struct state_node -{ - jint key; - void *c_state; - struct state_node *next; -}; - -struct state_table * init_state_table_with_size (JNIEnv *, jclass, jint); -struct state_table * init_state_table (JNIEnv *, jclass); - -/* lowlevel api */ -void set_state_oid (JNIEnv *, jobject, struct state_table *, jint, void *); -void * get_state_oid (JNIEnv *, jobject, struct state_table *, jint); -void * remove_state_oid (JNIEnv *, jobject, struct state_table *, jint); - -/* highlevel api */ -int set_state (JNIEnv *, jobject, struct state_table *, void *); -void * get_state (JNIEnv *, jobject, struct state_table *); -void * remove_state_slot (JNIEnv *, jobject, struct state_table *); - -#endif diff --git a/libjava/jni/classpath/primlib.c b/libjava/jni/classpath/primlib.c deleted file mode 100644 index c7396e2a9a7..00000000000 --- a/libjava/jni/classpath/primlib.c +++ /dev/null @@ -1,463 +0,0 @@ -/* primlib.c - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include <jnilink.h> -#include <primlib.h> -#include <jcl.h> - -static jclass nativeWrapClass[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL, - NULL,NULL,NULL, NULL,NULL,NULL}; - -static jclass nativeTypeClass[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL, - NULL,NULL,NULL, NULL,NULL,NULL}; - -static jmethodID nativeWrapClassConstructor[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL, - NULL,NULL,NULL, NULL,NULL,NULL}; - -static jmethodID nativeWrapClassAccessor[PRIMLIB_NUMTYPES] = {NULL,NULL,NULL, NULL,NULL,NULL, - NULL,NULL,NULL, NULL,NULL,NULL}; - -static char * nativeWrapClassName[PRIMLIB_NUMTYPES] = { - NULL, - NULL, - "java/lang/Boolean", - "java/lang/Byte", - "java/lang/Character", - "java/lang/Short", - "java/lang/Integer", - "java/lang/Long", - "java/lang/Float", - "java/lang/Double", - "java/lang/Void", - NULL - }; - -static char * nativeWrapClassConstructorSig[PRIMLIB_NUMTYPES] = { - NULL, - NULL, - "(Z)V", - "(B)V", - "(C)V", - "(S)V", - "(I)V", - "(J)V", - "(F)V", - "(D)V", - "()V", - NULL - }; - -static char * nativeWrapClassAccessorName[PRIMLIB_NUMTYPES] = { - NULL, - NULL, - "booleanValue", - "byteValue", - "charValue", - "shortValue", - "intValue", - "longValue", - "floatValue", - "doubleValue", - NULL, - NULL -}; - -static char * nativeWrapClassAccessorSig[PRIMLIB_NUMTYPES] = { - NULL, - NULL, - "()Z", - "()B", - "()C", - "()S", - "()I", - "()J", - "()F", - "()D", - NULL, - NULL -}; - - -JNIEXPORT jclass JNICALL PRIMLIB_GetNativeWrapClass(JNIEnv * env, int reflectType) { - return LINK_LinkClass(env,nativeWrapClass[reflectType],nativeWrapClassName[reflectType]); -} - -static jclass ActuallyGetNativeTypeClass(JNIEnv * env, int reflectType) { - jclass wrapClass; - jfieldID typeField; - - wrapClass = PRIMLIB_GetNativeWrapClass(env, reflectType); - if(wrapClass == NULL) - return NULL; - typeField = (*env)->GetStaticFieldID(env, wrapClass, "TYPE", "Ljava/lang/Class"); - if(typeField == NULL) - return NULL; - return (*env)->GetStaticObjectField(env, wrapClass, typeField); -} - -JNIEXPORT jclass JNICALL PRIMLIB_GetNativeTypeClass(JNIEnv * env, int reflectType) { - return LINK_LinkKnownClass(env, nativeTypeClass[reflectType], ActuallyGetNativeTypeClass(env,reflectType)); -} - -JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassConstructor(JNIEnv * env, int reflectType) { - PRIMLIB_GetNativeWrapClass(env,reflectType); - return LINK_LinkConstructor(env, nativeWrapClassConstructor[reflectType], nativeWrapClass[reflectType], nativeWrapClassConstructorSig[reflectType]); -} - -JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassAccessor(JNIEnv * env, int reflectType) { - PRIMLIB_GetNativeWrapClass(env,reflectType); - return LINK_LinkMethod(env, nativeWrapClassAccessor[reflectType], nativeWrapClass[reflectType], nativeWrapClassAccessorName[reflectType], nativeWrapClassAccessorSig[reflectType]); -} - - - -JNIEXPORT jobject JNICALL PRIMLIB_WrapBoolean(JNIEnv * env, jboolean b) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_BOOLEAN); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN), construct, b); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapByte (JNIEnv * env, jbyte b) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_BYTE); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE), construct, b); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapChar (JNIEnv * env, jchar c) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_CHAR); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR), construct, c); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapShort (JNIEnv * env, jshort s) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_SHORT); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT), construct, s); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapInt (JNIEnv * env, jint i) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_INT); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT), construct, i); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapLong (JNIEnv * env, jlong l) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_LONG); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG), construct, l); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapFloat (JNIEnv * env, jfloat f) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_FLOAT); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT), construct, f); -} - -JNIEXPORT jobject JNICALL PRIMLIB_WrapDouble (JNIEnv * env, jdouble d) { - jmethodID construct = PRIMLIB_GetNativeWrapClassConstructor(env, PRIMLIB_DOUBLE); - JCL_RETHROW_EXCEPTION(env); - return (*env)->NewObject(env, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE), construct, d); -} - - -JNIEXPORT jboolean JNICALL PRIMLIB_UnwrapBoolean(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN))) { - return PRIMLIB_GetBooleanObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return JNI_FALSE; - } -} - -JNIEXPORT jbyte JNICALL PRIMLIB_UnwrapByte(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jshort JNICALL PRIMLIB_UnwrapShort(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) { - return PRIMLIB_GetShortObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return (jshort)PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jchar JNICALL PRIMLIB_UnwrapChar(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) { - return PRIMLIB_GetCharObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jint JNICALL PRIMLIB_UnwrapInt(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) { - return PRIMLIB_GetIntObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) { - return (jint)PRIMLIB_GetShortObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) { - return (jint)PRIMLIB_GetCharObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return (jint)PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jlong JNICALL PRIMLIB_UnwrapLong(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) { - return PRIMLIB_GetLongObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) { - return (jlong)PRIMLIB_GetIntObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) { - return (jlong)PRIMLIB_GetShortObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) { - return (jlong)PRIMLIB_GetCharObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return (jlong)PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jfloat JNICALL PRIMLIB_UnwrapFloat(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT))) { - return PRIMLIB_GetFloatObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) { - return (jfloat)PRIMLIB_GetLongObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) { - return (jfloat)PRIMLIB_GetIntObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) { - return (jfloat)PRIMLIB_GetShortObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) { - return (jfloat)PRIMLIB_GetCharObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return (jfloat)PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jdouble JNICALL PRIMLIB_UnwrapDouble(JNIEnv * env, jobject obj) { - if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE))) { - return PRIMLIB_GetDoubleObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT))) { - return (jdouble)PRIMLIB_GetFloatObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG))) { - return (jdouble)PRIMLIB_GetLongObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT))) { - return (jdouble)PRIMLIB_GetIntObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT))) { - return (jdouble)PRIMLIB_GetShortObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR))) { - return (jdouble)PRIMLIB_GetCharObjectValue(env, obj); - } else if((*env)->IsInstanceOf(env, obj, PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE))) { - return (jdouble)PRIMLIB_GetByteObjectValue(env, obj); - } else { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct type."); - return 0; - } -} - -JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveWrapperType(JNIEnv * env, jobject obj) { - jclass typeClass; - if(obj == NULL) { - return PRIMLIB_NULL; - } - - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_DOUBLE); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_DOUBLE; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_FLOAT); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_FLOAT; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_LONG); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_LONG; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_INT); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_INT; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_CHAR); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_CHAR; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_SHORT); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_SHORT; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BYTE); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_BYTE; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_BOOLEAN); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_BOOLEAN; - } - typeClass = PRIMLIB_GetNativeWrapClass(env, PRIMLIB_VOID); - if((*env)->IsInstanceOf(env, obj, typeClass)) { - return PRIMLIB_VOID; - } - return PRIMLIB_OBJECT; -} - -JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveType(JNIEnv * env, jclass returnType) { - jclass typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_DOUBLE); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_DOUBLE; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_FLOAT); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_FLOAT; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_LONG); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_LONG; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_INT); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_INT; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_CHAR); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_CHAR; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_SHORT); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_SHORT; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_BYTE); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_BYTE; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_BOOLEAN); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_BOOLEAN; - } - typeClass = PRIMLIB_GetNativeTypeClass(env, PRIMLIB_VOID); - if((*env)->IsAssignableFrom(env, returnType, typeClass)) { - return PRIMLIB_VOID; - } - return PRIMLIB_OBJECT; -} - - -JNIEXPORT jboolean JNICALL PRIMLIB_GetBooleanObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_BOOLEAN); - return (*env)->CallBooleanMethod(env, obj, acc); -} - -JNIEXPORT jbyte JNICALL PRIMLIB_GetByteObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_BYTE); - return (*env)->CallByteMethod(env, obj, acc); -} - -JNIEXPORT jshort JNICALL PRIMLIB_GetShortObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_SHORT); - return (*env)->CallShortMethod(env, obj, acc); -} - -JNIEXPORT jchar JNICALL PRIMLIB_GetCharObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_CHAR); - return (*env)->CallCharMethod(env, obj, acc); -} - -JNIEXPORT jint JNICALL PRIMLIB_GetIntObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_INT); - return (*env)->CallIntMethod(env, obj, acc); -} - -JNIEXPORT jlong JNICALL PRIMLIB_GetLongObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_LONG); - return (*env)->CallLongMethod(env, obj, acc); -} - -JNIEXPORT jfloat JNICALL PRIMLIB_GetFloatObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_FLOAT); - return (*env)->CallFloatMethod(env, obj, acc); -} - -JNIEXPORT jdouble JNICALL PRIMLIB_GetDoubleObjectValue(JNIEnv * env, jobject obj) { - jmethodID acc = PRIMLIB_GetNativeWrapClassAccessor(env, PRIMLIB_DOUBLE); - return (*env)->CallDoubleMethod(env, obj, acc); -} - - - -JNIEXPORT jvalue JNICALL PRIMLIB_UnwrapJValue(JNIEnv* env, jobject obj, jclass classType) { - jvalue retval; - jint objType = PRIMLIB_GetReflectiveType(env, classType); - if(objType == PRIMLIB_BOOLEAN) { - retval.z = PRIMLIB_UnwrapBoolean(env,obj); - } else if(objType == PRIMLIB_BYTE) { - retval.b = PRIMLIB_UnwrapByte(env,obj); - } else if(objType == PRIMLIB_CHAR) { - retval.c = PRIMLIB_UnwrapChar(env,obj); - } else if(objType == PRIMLIB_SHORT) { - retval.s = PRIMLIB_UnwrapShort(env,obj); - } else if(objType == PRIMLIB_INT) { - retval.i = PRIMLIB_UnwrapInt(env,obj); - } else if(objType == PRIMLIB_LONG) { - retval.j = PRIMLIB_UnwrapLong(env,obj); - } else if(objType == PRIMLIB_FLOAT) { - retval.f = PRIMLIB_UnwrapFloat(env,obj); - } else if(objType == PRIMLIB_DOUBLE) { - retval.d = PRIMLIB_UnwrapDouble(env,obj); - } else { - if(obj != NULL && !(*env)->IsInstanceOf(env, obj, classType)) { - JCL_ThrowException(env, "java/lang/IllegalArgumentException", "Argument not of correct object type."); - return retval; - } - retval.l = obj; - } - return retval; -} - diff --git a/libjava/jni/classpath/primlib.h b/libjava/jni/classpath/primlib.h deleted file mode 100644 index 12f3bae9185..00000000000 --- a/libjava/jni/classpath/primlib.h +++ /dev/null @@ -1,102 +0,0 @@ -/* primlib.h - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#ifndef __PRIMLIB_H__ -#define __PRIMLIB_H__ - -#include <jni.h> - -#define PRIMLIB_UNKNOWN 0 -#define PRIMLIB_OBJECT 1 -#define PRIMLIB_BOOLEAN 2 -#define PRIMLIB_BYTE 3 -#define PRIMLIB_CHAR 4 -#define PRIMLIB_SHORT 5 -#define PRIMLIB_INT 6 -#define PRIMLIB_LONG 7 -#define PRIMLIB_FLOAT 8 -#define PRIMLIB_DOUBLE 9 -#define PRIMLIB_VOID 10 -#define PRIMLIB_NULL 11 -#define PRIMLIB_NUMTYPES 12 - -/* Low-level primitive class accessor functions. */ -JNIEXPORT jclass JNICALL PRIMLIB_GetNativeWrapClass(JNIEnv * env, int reflectType); -JNIEXPORT jclass JNICALL PRIMLIB_GetNativeTypeClass(JNIEnv * env, int reflectType); -JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassConstructor(JNIEnv * env, int reflectType); -JNIEXPORT jmethodID JNICALL PRIMLIB_GetNativeWrapClassAccessor(JNIEnv * env, int reflectType); - -/* Type discovery functions: WrapperType finds out j.l.Boolean/Byte/etc., and - Type finds out j.l.Boolean.TYPE, etc. -*/ -JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveWrapperType(JNIEnv * env, jobject obj); -JNIEXPORT jint JNICALL PRIMLIB_GetReflectiveType(JNIEnv * env, jclass returnType); - -/* Constructor functions. */ -JNIEXPORT jobject JNICALL PRIMLIB_WrapBoolean(JNIEnv * env, jboolean b); -JNIEXPORT jobject JNICALL PRIMLIB_WrapByte (JNIEnv * env, jbyte b); -JNIEXPORT jobject JNICALL PRIMLIB_WrapChar (JNIEnv * env, jchar c); -JNIEXPORT jobject JNICALL PRIMLIB_WrapShort (JNIEnv * env, jshort s); -JNIEXPORT jobject JNICALL PRIMLIB_WrapInt (JNIEnv * env, jint i); -JNIEXPORT jobject JNICALL PRIMLIB_WrapLong (JNIEnv * env, jlong l); -JNIEXPORT jobject JNICALL PRIMLIB_WrapFloat (JNIEnv * env, jfloat f); -JNIEXPORT jobject JNICALL PRIMLIB_WrapDouble (JNIEnv * env, jdouble d); - -/* Widening conversion unwrapping functions. */ -JNIEXPORT jboolean JNICALL PRIMLIB_UnwrapBoolean(JNIEnv * env, jobject obj); -JNIEXPORT jbyte JNICALL PRIMLIB_UnwrapByte (JNIEnv * env, jobject obj); -JNIEXPORT jshort JNICALL PRIMLIB_UnwrapShort (JNIEnv * env, jobject obj); -JNIEXPORT jchar JNICALL PRIMLIB_UnwrapChar (JNIEnv * env, jobject obj); -JNIEXPORT jint JNICALL PRIMLIB_UnwrapInt (JNIEnv * env, jobject obj); -JNIEXPORT jlong JNICALL PRIMLIB_UnwrapLong (JNIEnv * env, jobject obj); -JNIEXPORT jfloat JNICALL PRIMLIB_UnwrapFloat (JNIEnv * env, jobject obj); -JNIEXPORT jdouble JNICALL PRIMLIB_UnwrapDouble (JNIEnv * env, jobject obj); - -/* Simple unwrapping functions. Objects *must* be of correct type. */ -JNIEXPORT jboolean JNICALL PRIMLIB_GetBooleanObjectValue(JNIEnv * env, jobject obj); -JNIEXPORT jbyte JNICALL PRIMLIB_GetByteObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jshort JNICALL PRIMLIB_GetShortObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jchar JNICALL PRIMLIB_GetCharObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jint JNICALL PRIMLIB_GetIntObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jlong JNICALL PRIMLIB_GetLongObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jfloat JNICALL PRIMLIB_GetFloatObjectValue (JNIEnv * env, jobject obj); -JNIEXPORT jdouble JNICALL PRIMLIB_GetDoubleObjectValue (JNIEnv * env, jobject obj); - -/* jvalue conversion: Unwrap obj to the type of classType, with widening conversion. */ -JNIEXPORT jvalue JNICALL PRIMLIB_UnwrapJValue(JNIEnv* env, jobject obj, jclass classType); - -#endif diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c deleted file mode 100644 index 03c1e4925d7..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c +++ /dev/null @@ -1,102 +0,0 @@ -/* gdkfontmetrics.c - Copyright (C) 1999, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GdkFontMetrics.h" -#include <gdk/gdkx.h> - -#define ASCENT 0 -#define MAX_ASCENT 1 -#define DESCENT 2 -#define MAX_DESCENT 3 -#define MAX_ADVANCE 4 -#define NUM_METRICS 5 - -JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_initState - (JNIEnv *env, jobject obj, jstring fname, jint size) -{ - jintArray array; - jint *metrics; - const char *cfname; - char *xlfd; - GdkFont *font; - XFontStruct *xfont; - - cfname = (*env)->GetStringUTFChars (env, fname, NULL); - xlfd = g_strdup_printf (cfname, (size * 10)); - (*env)->ReleaseStringUTFChars (env, fname, cfname); - - array = (*env)->NewIntArray (env, NUM_METRICS); - metrics = (*env)->GetIntArrayElements (env, array, NULL); - - gdk_threads_enter (); - font = gdk_font_load (xlfd); - xfont = GDK_FONT_XFONT (font); - - metrics[ASCENT] = font->ascent; - metrics[MAX_ASCENT] = xfont->max_bounds.ascent; - metrics[DESCENT] = font->descent; - metrics[MAX_DESCENT] = xfont->max_bounds.descent; - metrics[MAX_ADVANCE] = xfont->max_bounds.width; - gdk_threads_leave (); - - g_free (xlfd); - (*env)->ReleaseIntArrayElements (env, array, metrics, 0); - - NSA_SET_PTR (env, obj, font); - - return array; -} - -JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_stringWidth - (JNIEnv *env, jobject obj, jstring str) -{ - GdkFont *font; - const char *cstr; - jint width; - - font = (GdkFont *) NSA_GET_PTR (env, obj); - cstr = (*env)->GetStringUTFChars (env, str, NULL); - - gdk_threads_enter (); - width = gdk_string_width (font, cstr); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, str, cstr); - - return width; -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c deleted file mode 100644 index 41e9db6b8fa..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c +++ /dev/null @@ -1,498 +0,0 @@ -/* gdkgraphics.c - Copyright (C) 1999, 2003 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GdkGraphics.h" -#include <gdk/gdkprivate.h> -#include <gdk/gdkx.h> - -#define GDK_STABLE_IS_PIXMAP(d) (((GdkWindowPrivate *)d)->window_type == GDK_WINDOW_PIXMAP) - -GdkPoint * -translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints, - jint npoints, jint x_offset, jint y_offset); - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_copyState - (JNIEnv *env, jobject obj, jobject old) -{ - struct graphics *g, *g_old; - - g = (struct graphics *) malloc (sizeof (struct graphics)); - g_old = (struct graphics *) NSA_GET_PTR (env, old); - - *g = *g_old; - - gdk_threads_enter (); - - g->gc = gdk_gc_new (g->drawable); - gdk_gc_copy (g->gc, g_old->gc); - - if (GDK_STABLE_IS_PIXMAP (g->drawable)) - gdk_pixmap_ref (g->drawable); - else /* GDK_IS_WINDOW (g->drawable) */ - gdk_window_ref (g->drawable); - - gdk_colormap_ref (g->cm); - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, g); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_initState__II - (JNIEnv *env, jobject obj, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) malloc (sizeof (struct graphics)); - g->x_offset = g->y_offset = 0; - - gdk_threads_enter (); - g->drawable = (GdkDrawable *) gdk_pixmap_new (NULL, width, height, - gdk_rgb_get_visual ()->depth); - g->cm = gdk_rgb_get_cmap (); - gdk_colormap_ref (g->cm); - g->gc = gdk_gc_new (g->drawable); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, g); -} - -/* copy the native state of the peer (GtkWidget *) to the native state - of the graphics object */ -JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_initState__Lgnu_java_awt_peer_gtk_GtkComponentPeer_2 - (JNIEnv *env, jobject obj, jobject peer) -{ - struct graphics *g = (struct graphics *) malloc (sizeof (struct graphics)); - void *ptr; - GtkWidget *widget; - GdkColor color; - jintArray array; - jint *rgb; - - ptr = NSA_GET_PTR (env, peer); - g->x_offset = g->y_offset = 0; - - gdk_threads_enter (); - - widget = GTK_WIDGET (ptr); - - if (GTK_IS_WINDOW (widget)) - { - g->drawable = find_gtk_layout (widget)->bin_window; - } - else if (GTK_IS_LAYOUT (widget)) - { - g->drawable = (GdkDrawable *) GTK_LAYOUT (widget)->bin_window; - } - else - { - g->drawable = (GdkDrawable *) widget->window; - } - - gdk_window_ref (g->drawable); - g->cm = gtk_widget_get_colormap (widget); - gdk_colormap_ref (g->cm); - g->gc = gdk_gc_new (g->drawable); - gdk_gc_copy (g->gc, widget->style->fg_gc[GTK_STATE_NORMAL]); - color = widget->style->fg[GTK_STATE_NORMAL]; - - gdk_threads_leave (); - - array = (*env)->NewIntArray (env, 3); - rgb = (*env)->GetIntArrayElements (env, array, NULL); - rgb[0] = color.red >> 8; - rgb[1] = color.green >> 8; - rgb[2] = color.blue >> 8; - (*env)->ReleaseIntArrayElements (env, array, rgb, 0); - - NSA_SET_PTR (env, obj, g); - - return array; -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_dispose - (JNIEnv *env, jobject obj) -{ - struct graphics *g; - - g = (struct graphics *) NSA_DEL_PTR (env, obj); - - if (!g) return; /* dispose has been called more than once */ - - gdk_threads_enter (); - XFlush (GDK_DISPLAY ()); - - gdk_gc_destroy (g->gc); - - if (GDK_STABLE_IS_PIXMAP (g->drawable)) - gdk_pixmap_unref (g->drawable); - else /* GDK_IS_WINDOW (g->drawable) */ - gdk_window_unref (g->drawable); - - gdk_colormap_unref (g->cm); - - gdk_threads_leave (); - - free (g); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_translateNative - (JNIEnv *env, jobject obj, jint x, jint y) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - g->x_offset += x; - g->y_offset += y; - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawString - (JNIEnv *env, jobject obj, jstring str, jint x, jint y, - jstring fname, jint size) -{ - struct graphics *g; - const char *cfname, *cstr; - gchar *xlfd; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - cfname = (*env)->GetStringUTFChars (env, fname, NULL); - xlfd = g_strdup_printf (cfname, (size * 10)); - (*env)->ReleaseStringUTFChars (env, fname, cfname); - - cstr = (*env)->GetStringUTFChars (env, str, NULL); - - gdk_threads_enter (); - gdk_draw_string (g->drawable, gdk_font_load (xlfd), g->gc, - x + g->x_offset, y + g->y_offset, cstr); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, str, cstr); - g_free (xlfd); -} - - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawLine - (JNIEnv *env, jobject obj, jint x, jint y, jint x2, jint y2) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_line (g->drawable, g->gc, - x + g->x_offset, y + g->y_offset, - x2 + g->x_offset, y2 + g->y_offset); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_fillRect - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_rectangle (g->drawable, g->gc, TRUE, - x + g->x_offset, y + g->y_offset, width, height); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawRect - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_rectangle (g->drawable, g->gc, FALSE, - x + g->x_offset, y + g->y_offset, width, height); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_copyArea - (JNIEnv *env, jobject obj, jint x, jint y, - jint width, jint height, jint dx, jint dy) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_window_copy_area ((GdkWindow *)g->drawable, - g->gc, - x + g->x_offset + dx, y + g->y_offset + dy, - (GdkWindow *)g->drawable, - x + g->x_offset, y + g->y_offset, - width, height); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_copyPixmap - (JNIEnv *env, jobject obj, jobject offscreen, - jint x, jint y, jint width, jint height) -{ - struct graphics *g1, *g2; - - g1 = (struct graphics *) NSA_GET_PTR (env, obj); - g2 = (struct graphics *) NSA_GET_PTR (env, offscreen); - - gdk_threads_enter (); - gdk_window_copy_area ((GdkWindow *)g1->drawable, - g1->gc, - x + g1->x_offset, y + g1->y_offset, - (GdkWindow *)g2->drawable, - 0 + g2->x_offset, 0 + g2->y_offset, - width, height); - gdk_threads_leave (); -} - - - - - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_clearRect - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_window_clear_area ((GdkWindow *)g->drawable, - x + g->x_offset, y + g->y_offset, width, height); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_setFunction - (JNIEnv *env, jobject obj, jint func) -{ - struct graphics *g; - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_gc_set_function (g->gc, func); - gdk_threads_leave (); -} - - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_setFGColor - (JNIEnv *env, jobject obj, jint red, jint green, jint blue) -{ - GdkColor color; - struct graphics *g; - - color.red = red << 8; - color.green = green << 8; - color.blue = blue << 8; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_color_alloc (g->cm, &color); - gdk_gc_set_foreground (g->gc, &color); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawArc - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height, - jint angle1, jint angle2) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_arc (g->drawable, g->gc, FALSE, - x + g->x_offset, y + g->y_offset, - width, height, angle1 << 6, angle2 << 6); - gdk_threads_leave (); -} - -GdkPoint * -translate_points (JNIEnv *env, jintArray xpoints, jintArray ypoints, - jint npoints, jint x_offset, jint y_offset) -{ - GdkPoint *points; - jint *x, *y; - int i; - - /* allocate one more point than necessary, in case we need to tack - on an extra due to the semantics of Java polygons. */ - points = g_malloc (sizeof (GdkPoint) * (npoints + 1)); - - x = (*env)->GetIntArrayElements (env, xpoints, NULL); - y = (*env)->GetIntArrayElements (env, ypoints, NULL); - - for (i = 0; i < npoints; i++) - { - points[i].x = x[i] + x_offset; - points[i].y = y[i] + y_offset; - } - - (*env)->ReleaseIntArrayElements (env, xpoints, x, JNI_ABORT); - (*env)->ReleaseIntArrayElements (env, ypoints, y, JNI_ABORT); - - return points; -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawPolyline - (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints, - jint npoints) -{ - struct graphics *g; - GdkPoint *points; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - points = translate_points (env, xpoints, ypoints, npoints, - g->x_offset, g->y_offset); - - gdk_threads_enter (); - gdk_draw_lines (g->drawable, g->gc, points, npoints); - gdk_threads_leave (); - - g_free (points); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawPolygon - (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints, - jint npoints) -{ - struct graphics *g; - GdkPoint *points; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - points = translate_points (env, xpoints, ypoints, npoints, - g->x_offset, g->y_offset); - - /* make sure the polygon is closed, per Java semantics. - if it's not, we close it. */ - if (points[0].x != points[npoints-1].x || points[0].y != points[npoints-1].y) - points[npoints++] = points[0]; - - gdk_threads_enter (); - gdk_draw_lines (g->drawable, g->gc, points, npoints); - gdk_threads_leave (); - - g_free (points); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_fillPolygon - (JNIEnv *env, jobject obj, jintArray xpoints, jintArray ypoints, - jint npoints) -{ - struct graphics *g; - GdkPoint *points; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - points = translate_points (env, xpoints, ypoints, npoints, - g->x_offset, g->y_offset); - gdk_threads_enter (); - gdk_draw_polygon (g->drawable, g->gc, TRUE, points, npoints); - gdk_threads_leave (); - - g_free (points); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_fillArc - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height, - jint angle1, jint angle2) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_arc (g->drawable, g->gc, TRUE, - x + g->x_offset, y + g->y_offset, - width, height, angle1 << 6, angle2 << 6); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_drawOval - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_arc (g->drawable, g->gc, FALSE, - x + g->x_offset, y + g->y_offset, - width, height, 0, 23040); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_fillOval - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_draw_arc (g->drawable, g->gc, TRUE, - x + g->x_offset, y + g->y_offset, - width, height, 0, 23040); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics_setClipRectangle - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - struct graphics *g; - GdkRectangle rectangle; - - g = (struct graphics *) NSA_GET_PTR (env, obj); - - rectangle.x = x + g->x_offset; - rectangle.y = y + g->y_offset; - rectangle.width = width; - rectangle.height = height; - - gdk_threads_enter (); - gdk_gc_set_clip_rectangle (g->gc, &rectangle); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c deleted file mode 100644 index ebebc438ae8..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c +++ /dev/null @@ -1,52 +0,0 @@ -/* gtkbuttonpeer.c -- Native implementation of GtkButtonPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkButtonPeer.h" - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create - (JNIEnv *env, jobject obj) -{ - gpointer widget; - - gdk_threads_enter (); - widget = gtk_type_new (gtk_button_get_type ()); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c deleted file mode 100644 index cc7cfb8fd30..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c +++ /dev/null @@ -1,54 +0,0 @@ -/* gtkcanvaspeer.c -- Native implementation of GtkCanvasPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkCanvasPeer.h" - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create - (JNIEnv *env, jobject obj) -{ - gpointer widget; - - gdk_threads_enter (); - widget = gtk_type_new (gtk_drawing_area_get_type ()); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} - - diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c deleted file mode 100644 index 94b13666776..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c +++ /dev/null @@ -1,73 +0,0 @@ -/* gtkmenuitempeer.c -- Native implementation of GtkMenuItemPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMenuItemPeer.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create - (JNIEnv *env, jobject obj, jstring label) -{ - GtkWidget *widget; - const char *str; - - str = (*env)->GetStringUTFChars (env, label, NULL); - - gdk_threads_enter (); - widget = gtk_check_menu_item_new_with_label (str); - gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (widget), 1); - gtk_widget_show (widget); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, label, str); - - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_setState - (JNIEnv *env, jobject obj, jboolean state) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (ptr), state); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c deleted file mode 100644 index 09fa7ef21b5..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c +++ /dev/null @@ -1,175 +0,0 @@ -/* gtkcheckboxpeer.c -- Native implementation of GtkCheckboxPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkCheckboxPeer.h" -#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h" - -static void item_toggled (GtkToggleButton *item, jobject peer); - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_dispose - (JNIEnv *env, jobject obj) -{ - /* The actual underlying widget is owned by a different class. So - we just clean up the hash table here. */ - NSA_DEL_PTR (env, obj); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_remove - (JNIEnv *env, jobject obj, jobject checkbox) -{ - GtkRadioButton *button; - void *ptr; - GSList *list; - - ptr = NSA_GET_PTR (env, checkbox); - gdk_threads_enter (); - button = GTK_RADIO_BUTTON (ptr); - - /* Update the group to point to some other widget in the group. We - have to do this because Gtk doesn't have a separate object to - represent a radio button's group. */ - for (list = gtk_radio_button_group (button); list != NULL; - list = list->next) - { - if (list->data != button) - break; - } - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, list ? list->data : NULL); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate - (JNIEnv *env, jobject obj, jobject group) -{ - GtkWidget *button; - - gdk_threads_enter (); - - if (group == NULL) - button = gtk_check_button_new_with_label (""); - else - { - void *native_group = NSA_GET_PTR (env, group); - button = gtk_radio_button_new_with_label_from_widget (native_group, ""); - if (native_group == NULL) - { - /* Set the native group so we can use the correct value the - next time around. FIXME: this doesn't work! */ - NSA_SET_PTR (env, group, button); - } - } - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, button); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr = NSA_GET_PTR (env, obj); - jobject peer; - - gdk_threads_enter (); - - peer = (*env)->NewGlobalRef (env, obj); - - /* FIXME: when the widget goes away, we should get rid of the global - reference. */ - gtk_signal_connect (GTK_OBJECT (ptr), "toggled", - GTK_SIGNAL_FUNC (item_toggled), peer); - - gdk_threads_leave (); - - /* Connect the superclass hooks. */ - Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks (env, obj); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeSetCheckboxGroup - (JNIEnv *env, jobject obj, jobject group) -{ - GtkRadioButton *button; - void *native_group, *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - /* FIXME: we can't yet switch between a checkbutton and a - radiobutton. However, AWT requires this. For now we just - crash. */ - - button = GTK_RADIO_BUTTON (ptr); - - native_group = NSA_GET_PTR (env, group); - if (native_group == NULL) - gtk_radio_button_set_group (button, NULL); - else - gtk_radio_button_set_group (button, - gtk_radio_button_group - (GTK_RADIO_BUTTON (native_group))); - - gdk_threads_leave (); - - /* If the native group wasn't set on the new CheckboxGroup, then set - it now so that the right thing will happen with the next - radiobutton. The native state for a CheckboxGroup is a pointer - to one of the widgets in the group. We are careful to keep this - always pointing at a live widget; whenever a widget is destroyed - (or otherwise removed from the group), the CheckboxGroup peer is - notified. */ - if (native_group == NULL) - NSA_SET_PTR (env, group, native_group); -} - -static void -item_toggled (GtkToggleButton *item, jobject peer) -{ - (*gdk_env)->CallVoidMethod (gdk_env, peer, - postItemEventID, - peer, - item->active ? - (jint) AWT_ITEM_SELECTED : - (jint) AWT_ITEM_DESELECTED); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c deleted file mode 100644 index b3eee27f4c6..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c +++ /dev/null @@ -1,204 +0,0 @@ -/* gtkchoicepeer.c -- Native implementation of GtkChoicePeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkChoicePeer.h" - -static void connect_choice_item_selectable_hook (JNIEnv *env, - jobject peer_obj, - GtkItem *item, - jobject item_obj); -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create - (JNIEnv *env, jobject obj) -{ - GtkWidget *menu; - GtkOptionMenu *option_menu; - GtkRequisition child_requisition; - - gdk_threads_enter (); - option_menu = GTK_OPTION_MENU (gtk_option_menu_new ()); - menu = gtk_menu_new (); - gtk_widget_show (menu); - - gtk_option_menu_set_menu (GTK_OPTION_MENU (option_menu), menu); - - gtk_widget_size_request (gtk_menu_item_new_with_label (""), - &child_requisition); - option_menu->width = child_requisition.width; - option_menu->height = child_requisition.height; - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, option_menu); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append - (JNIEnv *env, jobject obj, jobjectArray items) -{ - gpointer ptr; - GtkMenu *menu; - jsize count, i; - int need_set_history = 0; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - menu = GTK_MENU (gtk_option_menu_get_menu (GTK_OPTION_MENU (ptr))); - - if (!gtk_container_children (GTK_CONTAINER (menu))) - need_set_history = 1; - - count = (*env)->GetArrayLength (env, items); - - for (i = 0; i < count; i++) - { - jobject item; - const char *label; - GtkWidget *menuitem; - - item = (*env)->GetObjectArrayElement (env, items, i); - label = (*env)->GetStringUTFChars (env, item, NULL); - - menuitem = gtk_menu_item_new_with_label (label); - - (*env)->ReleaseStringUTFChars (env, item, label); - - gtk_menu_append (menu, menuitem); - gtk_widget_show (menuitem); - - connect_choice_item_selectable_hook (env, obj, - GTK_ITEM (menuitem), item); - } - - if (need_set_history) - gtk_option_menu_set_history (GTK_OPTION_MENU (ptr), 0); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add - (JNIEnv *env, jobject obj, jstring item, jint index) -{ - void *ptr; - const char *label; - GtkWidget *menu, *menuitem; - int need_set_history = 0; - - ptr = NSA_GET_PTR (env, obj); - - label = (*env)->GetStringUTFChars (env, item, 0); - - gdk_threads_enter (); - menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (ptr)); - - if (!gtk_container_children (GTK_CONTAINER (menu))) - need_set_history = 1; - - menuitem = gtk_menu_item_new_with_label (label); - gtk_menu_insert (GTK_MENU (menu), menuitem, index); - gtk_widget_show (menuitem); - connect_choice_item_selectable_hook (env, obj, GTK_ITEM (menuitem), item); - - if (need_set_history) - gtk_option_menu_set_history (GTK_OPTION_MENU (ptr), 0); - - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, item, label); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - GtkContainer *menu; - GList *children; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - menu = GTK_CONTAINER (gtk_option_menu_get_menu (GTK_OPTION_MENU (ptr))); - children = gtk_container_children (menu); - gtk_container_remove (menu, GTK_WIDGET (g_list_nth (children, index)->data)); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkChoicePeer_select - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_option_menu_set_history (GTK_OPTION_MENU (ptr), index); - gdk_threads_leave (); -} - - -static void -item_activate (GtkItem *item, struct item_event_hook_info *ie) -{ - gdk_threads_leave (); - (*gdk_env)->CallVoidMethod (gdk_env, ie->peer_obj, - postItemEventID, - ie->item_obj, - (jint) AWT_ITEM_SELECTED); - gdk_threads_enter (); -} - -static void -connect_choice_item_selectable_hook (JNIEnv *env, jobject peer_obj, - GtkItem *item, jobject item_obj) -{ - struct item_event_hook_info *ie; - - ie = (struct item_event_hook_info *) - malloc (sizeof (struct item_event_hook_info)); - - ie->peer_obj = (*env)->NewGlobalRef (env, peer_obj); - ie->item_obj = (*env)->NewGlobalRef (env, item_obj); - - gtk_signal_connect (GTK_OBJECT (item), "activate", - GTK_SIGNAL_FUNC (item_activate), ie); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c deleted file mode 100644 index 7c6beecf1b1..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c +++ /dev/null @@ -1,180 +0,0 @@ -/* gtkclipboard.c - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkClipboard.h" - -jmethodID stringSelectionReceivedID; -jmethodID stringSelectionHandlerID; -jmethodID selectionClearID; - -void selection_received (GtkWidget *, GtkSelectionData *, guint, gpointer); -void selection_get (GtkWidget *, GtkSelectionData *, guint, guint, gpointer); -gint selection_clear (GtkWidget *, GdkEventSelection *); - -GtkWidget *clipboard; -jobject cb_obj; - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env, - jobject obj) -{ - if (!stringSelectionReceivedID) - { - jclass gtkclipboard; - - gtkclipboard = (*env)->FindClass (env, - "gnu/java/awt/peer/gtk/GtkClipboard"); - stringSelectionReceivedID = (*env)->GetMethodID (env, gtkclipboard, - "stringSelectionReceived", - "(Ljava/lang/String;)V"); - stringSelectionHandlerID = (*env)->GetMethodID (env, gtkclipboard, - "stringSelectionHandler", - "()Ljava/lang/String;"); - selectionClearID = (*env)->GetMethodID (env, gtkclipboard, - "selectionClear", "()V"); - } - - cb_obj = (*env)->NewGlobalRef (env, obj); - - gdk_threads_enter (); - clipboard = gtk_window_new (GTK_WINDOW_TOPLEVEL); - - gtk_signal_connect (GTK_OBJECT(clipboard), "selection_received", - GTK_SIGNAL_FUNC (selection_received), NULL); - - gtk_signal_connect (GTK_OBJECT(clipboard), "selection_clear_event", - GTK_SIGNAL_FUNC (selection_clear), NULL); - - gtk_selection_add_target (clipboard, GDK_SELECTION_PRIMARY, - GDK_TARGET_STRING, GDK_TARGET_STRING); - - gtk_signal_connect (GTK_OBJECT(clipboard), "selection_get", - GTK_SIGNAL_FUNC (selection_get), NULL); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkClipboard_requestStringConversion (JNIEnv *env, - jclass clazz) -{ - gdk_threads_enter (); - gtk_selection_convert (clipboard, GDK_SELECTION_PRIMARY, - GDK_TARGET_STRING, GDK_CURRENT_TIME); - gdk_threads_leave (); -} - -void -selection_received (GtkWidget *widget, GtkSelectionData *selection_data, - guint time, gpointer data) -{ - /* Check to see if retrieval succeeded */ - if (selection_data->length < 0 - || selection_data->type != GDK_SELECTION_TYPE_STRING) - { - (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, stringSelectionReceivedID, - NULL); - } - else - { - char *str = (char *) selection_data->data; - - (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, stringSelectionReceivedID, - (*gdk_env)->NewStringUTF (gdk_env, str)); - } - - return; -} - -void -selection_get (GtkWidget *widget, - GtkSelectionData *selection_data, - guint info, - guint time, - gpointer data) -{ - jstring jstr; - const char *utf; - jsize utflen; - - jstr = (*gdk_env)->CallObjectMethod (gdk_env, cb_obj, - stringSelectionHandlerID); - - if (!jstr) - { - gtk_selection_data_set (selection_data, - GDK_TARGET_STRING, 8, NULL, 0); - return; - } - - utflen = (*gdk_env)->GetStringUTFLength (gdk_env, jstr); - utf = (*gdk_env)->GetStringUTFChars (gdk_env, jstr, NULL); - - gtk_selection_data_set (selection_data, GDK_TARGET_STRING, 8, - (char *)utf, utflen); - - (*gdk_env)->ReleaseStringUTFChars (gdk_env, jstr, utf); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkClipboard_selectionGet (JNIEnv *env, - jclass clazz) -{ - GdkWindow *owner; - - gdk_threads_enter (); - - /* if we already own the clipboard, we need to tell the old data object - that we're no longer going to be using him */ - owner = gdk_selection_owner_get (GDK_SELECTION_PRIMARY); - if (owner && owner == clipboard->window) - (*env)->CallVoidMethod (env, cb_obj, selectionClearID); - - gtk_selection_owner_set (clipboard, GDK_SELECTION_PRIMARY, GDK_CURRENT_TIME); - - gdk_threads_leave (); -} - -gint -selection_clear (GtkWidget *widget, GdkEventSelection *event) -{ - (*gdk_env)->CallVoidMethod (gdk_env, cb_obj, selectionClearID); - - return TRUE; -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c deleted file mode 100644 index 5522354e35d..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c +++ /dev/null @@ -1,649 +0,0 @@ -/* gtkcomponentpeer.c -- Native implementation of GtkComponentPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h" -#include <gtk/gtkprivate.h> - -#define GTK_OBJECT_SETV(ptr, arg) \ - gdk_threads_enter (); \ - { \ - GtkArgInfo *info = NULL; \ - char *error; \ - \ - error = gtk_object_arg_get_info (GTK_OBJECT_TYPE (ptr), arg.name, &info); \ - if (error) \ - { \ - /* assume the argument is destined for the container's only child */ \ - ptr = gtk_container_children (GTK_CONTAINER (ptr))->data; \ - } \ - gtk_object_setv (GTK_OBJECT (ptr), 1, &arg); \ - } \ - gdk_threads_leave (); \ - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_DEL_PTR (env, obj); - - /* For now the native state for any object must be a widget. - However, a subclass could override dispose() if required. */ - gdk_threads_enter (); - gtk_widget_destroy (GTK_WIDGET (ptr)); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetCursor - (JNIEnv *env, jobject obj, jint type) -{ - void *ptr; - GtkWidget *widget; - GdkCursorType gdk_cursor_type; - GdkCursor *gdk_cursor; - - ptr = NSA_GET_PTR (env, obj); - - switch (type) - { - case AWT_CROSSHAIR_CURSOR: - gdk_cursor_type = GDK_CROSSHAIR; - break; - case AWT_TEXT_CURSOR: - gdk_cursor_type = GDK_XTERM; - break; - case AWT_WAIT_CURSOR: - gdk_cursor_type = GDK_WATCH; - break; - case AWT_SW_RESIZE_CURSOR: - gdk_cursor_type = GDK_BOTTOM_LEFT_CORNER; - break; - case AWT_SE_RESIZE_CURSOR: - gdk_cursor_type = GDK_BOTTOM_RIGHT_CORNER; - break; - case AWT_NW_RESIZE_CURSOR: - gdk_cursor_type = GDK_TOP_LEFT_CORNER; - break; - case AWT_NE_RESIZE_CURSOR: - gdk_cursor_type = GDK_TOP_RIGHT_CORNER; - break; - case AWT_N_RESIZE_CURSOR: - gdk_cursor_type = GDK_TOP_SIDE; - break; - case AWT_S_RESIZE_CURSOR: - gdk_cursor_type = GDK_BOTTOM_SIDE; - break; - case AWT_W_RESIZE_CURSOR: - gdk_cursor_type = GDK_LEFT_SIDE; - break; - case AWT_E_RESIZE_CURSOR: - gdk_cursor_type = GDK_RIGHT_SIDE; - break; - case AWT_HAND_CURSOR: - gdk_cursor_type = GDK_HAND2; - break; - case AWT_MOVE_CURSOR: - gdk_cursor_type = GDK_FLEUR; - break; - default: - gdk_cursor_type = GDK_LEFT_PTR; - } - - gdk_threads_enter (); - - widget = GTK_WIDGET(ptr); - - gdk_cursor = gdk_cursor_new (gdk_cursor_type); - gdk_window_set_cursor (widget->window, gdk_cursor); - gdk_cursor_destroy (gdk_cursor); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_requestFocus - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_grab_focus (GTK_WIDGET (ptr)); - gdk_threads_leave (); -} - - -/* - * Show a widget (NO LONGER USED) - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setVisible - (JNIEnv *env, jobject obj, jboolean visible) -{ - GtkWidget *widget; - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - widget = GTK_WIDGET (ptr); - - if (visible) - gtk_widget_show (widget); - else - gtk_widget_hide (widget); - - gdk_flush (); - gdk_threads_leave (); -} - -/* - * Find the origin of a widget's window. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetLocationOnScreen - (JNIEnv * env, jobject obj, jintArray jpoint) -{ - void *ptr; - jint *point; - - ptr = NSA_GET_PTR (env, obj); - point = (*env)->GetIntArrayElements (env, jpoint, 0); - - gdk_threads_enter (); - gdk_window_get_origin (GTK_WIDGET (ptr)->window, point, point+1); - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements(env, jpoint, point, 0); -} - -/* - * Find the preferred size of a widget. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetDimensions - (JNIEnv *env, jobject obj, jintArray jdims) -{ - void *ptr; - jint *dims; - GtkRequisition req; - - ptr = NSA_GET_PTR (env, obj); - dims = (*env)->GetIntArrayElements (env, jdims, 0); - - gdk_threads_enter (); - - gtk_signal_emit_by_name (GTK_OBJECT (ptr), "size_request", &req); - - dims[0] = req.width; - dims[1] = req.height; - - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements(env, jdims, dims, 0); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetUsize (JNIEnv *env, - jobject obj, jint w, jint h) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_set_usize (GTK_WIDGET (ptr), w, h); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkFixedNew (JNIEnv *env, - jobject obj, jint width, jint height, jboolean visible) -{ - GtkWidget *layout; - - gdk_threads_enter (); - layout = gtk_layout_new (NULL, NULL); - gtk_widget_realize (layout); - connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window); - set_visible (layout, visible); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, layout); -} - -/* - * Place a widget on the layout widget. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkFixedPut - (JNIEnv *env, jobject obj, jobject container, jint x, jint y) -{ - GList *child; - GtkWidget *fix; - void *containerptr=NULL; - void *objptr=NULL; - - /* We hawe a container which, if it is a window, will have - this component added to its fixed. If it is a fixed, we add the - component to it. */ - - containerptr=NSA_GET_PTR (env, container); - objptr=NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - if (GTK_IS_WINDOW(GTK_OBJECT(containerptr))) - { - child=gtk_container_children (GTK_CONTAINER(containerptr)); - - while (child && !GTK_IS_FIXED(child->data)) - { - child=g_list_next(child); - } - - fix=GTK_WIDGET(child->data); - g_list_free(child); - } - else - if (GTK_IS_SCROLLED_WINDOW(GTK_OBJECT(containerptr))) - { - child=gtk_container_children (GTK_CONTAINER (GTK_BIN(containerptr)->child)); - - while (child && !GTK_IS_FIXED(child->data)) - { - child=g_list_next(child); - } - - fix=GTK_WIDGET(child->data); - - g_list_free(child); - } - else - { - fix=GTK_WIDGET(containerptr); - } - - gtk_fixed_put(GTK_FIXED(fix),GTK_WIDGET(objptr),x,y); - gtk_widget_realize (GTK_WIDGET (objptr)); - gtk_widget_show (GTK_WIDGET (objptr)); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkFixedMove (JNIEnv *env, - jobject obj, jint x, jint y) -{ - GtkWidget *widget; - void *ptr=NULL; - - /* For some reason, ScrolledWindow tries to scroll its contents - by moving them using this function. Since we want to use GTK's - nice fast scrolling, we try to second guess it here. This - might cause problems later. */ - - if (x >= 0 && y >= 0) - { - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - widget=GTK_WIDGET (ptr); - if (!GTK_IS_WINDOW (widget)) - gtk_fixed_move (GTK_FIXED (widget->parent), widget, x, y); - gdk_threads_leave (); - } -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setNativeBounds - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - GtkWidget *widget; - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - widget = GTK_WIDGET (ptr); - if (GTK_IS_VIEWPORT (widget->parent)) - { - gtk_widget_set_usize (widget, width, height); - } - else - { - gtk_widget_set_usize (widget, width, height); - gtk_layout_move (GTK_LAYOUT (widget->parent), widget, x, y); - } - - gdk_threads_leave (); -} - -JNIEXPORT jintArray JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetBackground - (JNIEnv *env, jobject obj) -{ - void *ptr; - jintArray array; - int *rgb; - GdkColor bg; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - bg = GTK_WIDGET (ptr)->style->bg[GTK_STATE_NORMAL]; - gdk_threads_leave (); - - array = (*env)->NewIntArray (env, 3); - rgb = (*env)->GetIntArrayElements (env, array, NULL); - /* convert color data from 16 bit values down to 8 bit values */ - rgb[0] = bg.red >> 8; - rgb[1] = bg.green >> 8; - rgb[2] = bg.blue >> 8; - (*env)->ReleaseIntArrayElements (env, array, rgb, 0); - - return array; -} - -JNIEXPORT jintArray JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetGetForeground - (JNIEnv *env, jobject obj) -{ - void *ptr; - jintArray array; - jint *rgb; - GdkColor fg; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - fg = GTK_WIDGET (ptr)->style->fg[GTK_STATE_NORMAL]; - gdk_threads_leave (); - - array = (*env)->NewIntArray (env, 3); - rgb = (*env)->GetIntArrayElements (env, array, NULL); - /* convert color data from 16 bit values down to 8 bit values */ - rgb[0] = fg.red >> 8; - rgb[1] = fg.green >> 8; - rgb[2] = fg.blue >> 8; - (*env)->ReleaseIntArrayElements (env, array, rgb, 0); - - return array; -} - -void -set_visible (GtkWidget *widget, jboolean visible) -{ - if (visible) - gtk_widget_show (widget); - else - gtk_widget_hide (widget); -} - -GtkLayout * -find_gtk_layout (GtkWidget *parent) -{ - if (GTK_IS_WINDOW (parent)) - { - GList *children = gtk_container_children - (GTK_CONTAINER (GTK_BIN (parent)->child)); - - if (GTK_IS_MENU_BAR (children->data)) - return GTK_LAYOUT (children->next->data); - else /* GTK_IS_LAYOUT (children->data) */ - return GTK_LAYOUT (children->data); - } - - return NULL; -} - -#define WIDGET_CLASS(w) GTK_WIDGET_CLASS (GTK_OBJECT (w)->klass) - -void -set_parent (GtkWidget *widget, GtkContainer *parent) -{ - if (GTK_IS_WINDOW (parent)) - { - GList *children = gtk_container_children - (GTK_CONTAINER (GTK_BIN (parent)->child)); - - if (GTK_IS_MENU_BAR (children->data)) - gtk_layout_put (GTK_LAYOUT (children->next->data), widget, 0, 0); - else /* GTK_IS_LAYOUT (children->data) */ - gtk_layout_put (GTK_LAYOUT (children->data), widget, 0, 0); - } - else - if (GTK_IS_SCROLLED_WINDOW (parent)) - { -/* if (WIDGET_CLASS (widget)->set_scroll_adjustments_signal) */ -/* gtk_container_add (GTK_CONTAINER (parent), widget); */ -/* else */ -/* { */ - gtk_scrolled_window_add_with_viewport - (GTK_SCROLLED_WINDOW (parent), widget); - gtk_viewport_set_shadow_type (GTK_VIEWPORT (widget->parent), - GTK_SHADOW_NONE); -/* } */ - - } -/* gtk_layout_put */ -/* (GTK_LAYOUT (GTK_BIN (parent)->child), widget, 0, 0); */ - -/* if (GTK_IS_SCROLLED_WINDOW (parent)) */ -/* gtk_layout_put */ -/* (GTK_LAYOUT (GTK_BIN (GTK_BIN (parent)->child)->child), widget, 0, 0); */ - else - gtk_layout_put (GTK_LAYOUT (parent), widget, 0, 0); -} - -JNIEXPORT jboolean JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_isEnabled - (JNIEnv *env, jobject obj) -{ - void *ptr; - jboolean ret_val; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - ret_val = GTK_WIDGET_IS_SENSITIVE (GTK_WIDGET (ptr)); - gdk_threads_leave (); - - return ret_val; -} - -JNIEXPORT jboolean JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_modalHasGrab - (JNIEnv *env, jclass clazz) -{ - GtkWidget *widget; - jboolean retval; - - gdk_threads_enter (); - widget = gtk_grab_get_current (); - retval = (widget && GTK_IS_WINDOW (widget) && GTK_WINDOW (widget)->modal); - gdk_threads_leave (); - - return retval; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_String_2 - (JNIEnv *env, jobject obj, jstring jname, jstring jvalue) -{ - const char *name; - const char *value; - void *ptr; - GtkArg arg; - - ptr = NSA_GET_PTR (env, obj); - name = (*env)->GetStringUTFChars (env, jname, NULL); - value = (*env)->GetStringUTFChars (env, jvalue, NULL); - - arg.type = GTK_TYPE_STRING; - arg.name = (char *) name; - GTK_VALUE_STRING (arg) = (char *) value; - - GTK_OBJECT_SETV (ptr, arg); - - (*env)->ReleaseStringUTFChars (env, jname, name); - (*env)->ReleaseStringUTFChars (env, jvalue, value); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Z - (JNIEnv *env, jobject obj, jstring jname, jboolean value) -{ - const char *name; - void *ptr; - GtkArg arg; - - ptr = NSA_GET_PTR (env, obj); - name = (*env)->GetStringUTFChars (env, jname, NULL); - - arg.type = GTK_TYPE_BOOL; - arg.name = (char *) name; - GTK_VALUE_BOOL (arg) = value; - - GTK_OBJECT_SETV (ptr, arg); - - (*env)->ReleaseStringUTFChars (env, jname, name); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2I - (JNIEnv *env, jobject obj, jstring jname, jint value) -{ - const char *name; - void *ptr; - GtkArg arg; - - ptr = NSA_GET_PTR (env, obj); - name = (*env)->GetStringUTFChars (env, jname, NULL); - - arg.type = GTK_TYPE_INT; - arg.name = (char *) name; - GTK_VALUE_INT (arg) = value; - - GTK_OBJECT_SETV (ptr, arg); - - (*env)->ReleaseStringUTFChars (env, jname, name); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2F - (JNIEnv *env, jobject obj, jstring jname, jfloat value) -{ - const char *name; - void *ptr; - GtkArg arg; - - ptr = NSA_GET_PTR (env, obj); - name = (*env)->GetStringUTFChars (env, jname, NULL); - - arg.type = GTK_TYPE_FLOAT; - arg.name = (char *) name; - GTK_VALUE_FLOAT (arg) = value; - - GTK_OBJECT_SETV (ptr, arg); - - (*env)->ReleaseStringUTFChars (env, jname, name); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_Object_2 - (JNIEnv *env, jobject obj1, jstring jname, jobject obj2) -{ - const char *name; - void *ptr1, *ptr2; - GtkArg arg; - - ptr1 = NSA_GET_PTR (env, obj1); - ptr2 = NSA_GET_PTR (env, obj2); - - name = (*env)->GetStringUTFChars (env, jname, NULL); - - /* special case to catch where we need to set the parent */ - if (!strcmp (name, "parent")) - { - gdk_threads_enter (); - set_parent (GTK_WIDGET (ptr1), GTK_CONTAINER (ptr2)); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, jname, name); - return; - } - - arg.type = GTK_TYPE_OBJECT; - arg.name = (char *) name; - GTK_VALUE_OBJECT (arg) = GTK_OBJECT (ptr2); - - GTK_OBJECT_SETV (ptr1, arg); - - (*env)->ReleaseStringUTFChars (env, jname, name); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_create - (JNIEnv *env, jobject obj, jstring jtypename) -{ - const char *typename; - gpointer widget; - - typename = (*env)->GetStringUTFChars (env, jtypename, NULL); - - gdk_threads_enter (); - gtk_button_get_type (); - widget = gtk_object_newv (gtk_type_from_name (typename), - 0, NULL); -/* widget = gtk_type_new (gtk_type_from_name (typename)); */ - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, jtypename, typename); - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c deleted file mode 100644 index 99ca0934c3d..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c +++ /dev/null @@ -1,552 +0,0 @@ -/* gtkevents.c -- GDK/GTK event handlers - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include <X11/Xlib.h> -#include <gdk/gdkkeysyms.h> -#include <stdarg.h> -#include <assert.h> - -/* A widget can be composed of multipled windows, so we need to hook - events on all of them. */ -struct event_hook_info -{ - jobject *peer_obj; - int nwindows; - GdkWindow ***windows; /* array of pointers to (GdkWindow *) */ -}; - -static jint -button_to_awt_mods (int button) -{ - switch (button) - { - case 1: - return AWT_BUTTON1_MASK; - case 2: - return AWT_BUTTON2_MASK; - case 3: - return AWT_BUTTON3_MASK; - } - - return 0; -} - -static jint -state_to_awt_mods (int mods) -{ - jint result = 0; - - if (mods & (GDK_SHIFT_MASK | GDK_LOCK_MASK)) - result |= AWT_SHIFT_MASK; - if (mods & GDK_CONTROL_MASK) - result |= AWT_CTRL_MASK; - - return result; -} - -#ifdef __GNUC__ -__inline -#endif -static jint -keysym_to_awt_keycode (guint keyval) -{ - guint vk; - - vk = gdk_keyval_to_upper (keyval); - - if (vk <= 0x41 && vk <= 0x5A) /* VK_A through VK_Z */ - return vk; - - if (vk <= 0x30 && vk <= 39) /* VK_0 through VK_9 */ - return vk; - - switch (vk) - { - case GDK_Alt_L: - case GDK_Alt_R: - return VK_ALT; - case GDK_BackSpace: - return VK_BACK_SPACE; - case GDK_Cancel: - return VK_CANCEL; - case GDK_Caps_Lock: - return VK_CAPS_LOCK; - case GDK_Clear: - return VK_CLEAR; - case GDK_bracketright: - return VK_CLOSE_BRACKET; - case GDK_comma: - return VK_COMMA; - case GDK_Control_L: - case GDK_Control_R: - return VK_CONTROL; - case GDK_KP_Decimal: - return VK_DECIMAL; - case GDK_Delete: - return VK_DELETE; - case GDK_KP_Divide: - return VK_DIVIDE; - case GDK_Down: - return VK_DOWN; - case GDK_End: - return VK_END; - case GDK_Return: - return VK_ENTER; - case GDK_Escape: - return VK_ESCAPE; - case GDK_F1: - return VK_F1; - case GDK_F2: - return VK_F2; - case GDK_F3: - return VK_F3; - case GDK_F4: - return VK_F4; - case GDK_F5: - return VK_F5; - case GDK_F6: - return VK_F6; - case GDK_F7: - return VK_F7; - case GDK_F8: - return VK_F8; - case GDK_F9: - return VK_F9; - case GDK_F10: - return VK_F10; - case GDK_F11: - return VK_F11; - case GDK_F12: - return VK_F12; - case GDK_Help: - return VK_HELP; - case GDK_Home: - return VK_HOME; - case GDK_Insert: - return VK_INSERT; - case GDK_Kanji: - return VK_KANJI; - case GDK_Left: - return VK_LEFT; - case GDK_Meta_L: - case GDK_Meta_R: - return VK_META; - case GDK_KP_Multiply: - return VK_MULTIPLY; - case GDK_Num_Lock: - return VK_NUM_LOCK; - case GDK_KP_0: - return VK_NUMPAD0; - case GDK_KP_1: - return VK_NUMPAD1; - case GDK_KP_2: - return VK_NUMPAD2; - case GDK_KP_3: - return VK_NUMPAD3; - case GDK_KP_4: - return VK_NUMPAD4; - case GDK_KP_5: - return VK_NUMPAD5; - case GDK_KP_6: - return VK_NUMPAD6; - case GDK_KP_7: - return VK_NUMPAD7; - case GDK_KP_8: - return VK_NUMPAD8; - case GDK_KP_9: - return VK_NUMPAD9; - case GDK_bracketleft: - return VK_OPEN_BRACKET; - case GDK_Page_Down: - return VK_PAGE_DOWN; - case GDK_Page_Up: - return VK_PAGE_UP; - case GDK_Pause: - return VK_PAUSE; - case GDK_period: - return VK_PERIOD; - case GDK_Print: - return VK_PRINTSCREEN; - case GDK_quoteright: - return VK_QUOTE; - case GDK_Right: - return VK_RIGHT; - case GDK_Scroll_Lock: - return VK_SCROLL_LOCK; - case GDK_semicolon: - return VK_SEMICOLON; - case GDK_KP_Separator: - return VK_SEPARATOR; - case GDK_Shift_L: - case GDK_Shift_R: - return VK_SHIFT; - case GDK_slash: - return VK_SLASH; - case GDK_space: - return VK_SPACE; - case GDK_KP_Subtract: - return VK_SUBTRACT; - case GDK_Tab: - return VK_TAB; - case GDK_Up: - return VK_UP; - - default: - return VK_UNDEFINED; - } -} - -void -awt_event_handler (GdkEvent *event) -{ - jobject *obj_ptr; - static guint32 button_click_time = 0; - static GdkWindow *button_window = NULL; - static guint button_number = -1; - static jint click_count = 1; - - /* keep synthetic AWT events from being processed recursively */ - if (event->type & SYNTHETIC_EVENT_MASK && event->type != GDK_NOTHING) - { - event->type ^= SYNTHETIC_EVENT_MASK; - gtk_main_do_event (event); - return; - } - - /* keep track of clickCount ourselves, since the AWT allows more - than a triple click to occur */ - if (event->type == GDK_BUTTON_PRESS) - { - if ((event->button.time < (button_click_time + MULTI_CLICK_TIME)) - && (event->button.window == button_window) - && (event->button.button == button_number)) - click_count++; - else - click_count = 1; - - button_click_time = event->button.time; - button_window = event->button.window; - button_number = event->button.button; - } - - /* for all input events, which have a window with a jobject attached, - send the input event off to Java before GTK has a chance to process - the event */ - if ((event->type == GDK_BUTTON_PRESS - || event->type == GDK_BUTTON_RELEASE - || event->type == GDK_ENTER_NOTIFY - || event->type == GDK_LEAVE_NOTIFY - || event->type == GDK_CONFIGURE - || event->type == GDK_EXPOSE - || event->type == GDK_KEY_PRESS - || event->type == GDK_FOCUS_CHANGE - || event->type == GDK_MOTION_NOTIFY) - && gdk_property_get (event->any.window, - gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE), - gdk_atom_intern ("CARDINAL", FALSE), - 0, - sizeof (jobject), - FALSE, - NULL, - NULL, - NULL, - (guchar **)&obj_ptr)) - { - switch (event->type) - { - case GDK_BUTTON_PRESS: - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_PRESSED, - (jlong)event->button.time, - state_to_awt_mods (event->button.state) | - button_to_awt_mods (event->button.button), - (jint)event->button.x, - (jint)event->button.y, - click_count, - (event->button.button == 3) ? JNI_TRUE : - JNI_FALSE); - - /* grab_counter++; - gdk_pointer_grab (event->any.window, - FALSE, - GDK_POINTER_MOTION_MASK | - GDK_BUTTON_MOTION_MASK | - GDK_BUTTON_PRESS_MASK | - GDK_BUTTON_RELEASE_MASK | - GDK_ENTER_NOTIFY_MASK | - GDK_LEAVE_NOTIFY_MASK, - NULL, - NULL, - event->button.time);*/ - break; - case GDK_BUTTON_RELEASE: - { - int width, height; - - /* only ungrab if no other buttons are pressed down */ - /* if (--grab_counter == 0) - gdk_pointer_ungrab (event->button.time); - */ - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_RELEASED, - (jlong)event->button.time, - state_to_awt_mods (event->button.state) | - button_to_awt_mods (event->button.button), - (jint)event->button.x, - (jint)event->button.y, - click_count, JNI_FALSE); - - /* check to see if the release occured in the window it was pressed - in, and if so, generate an AWT click event */ - gdk_window_get_size (event->any.window, &width, &height); - if (event->button.x >= 0 - && event->button.y >= 0 - && event->button.x <= width - && event->button.y <= height) - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_CLICKED, - (jlong)event->button.time, - state_to_awt_mods (event->button.state) | - button_to_awt_mods (event->button.button), - (jint)event->button.x, - (jint)event->button.y, - click_count, JNI_FALSE); - - } - break; - case GDK_MOTION_NOTIFY: - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_MOVED, - (jlong)event->motion.time, - state_to_awt_mods (event->motion.state), - (jint)event->motion.x, - (jint)event->motion.y, - 0, JNI_FALSE); - - if (event->motion.state & (GDK_BUTTON1_MASK - | GDK_BUTTON2_MASK - | GDK_BUTTON3_MASK - | GDK_BUTTON4_MASK - | GDK_BUTTON5_MASK)) - { - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_DRAGGED, - (jlong)event->motion.time, - state_to_awt_mods (event->motion.state), - (jint)event->motion.x, - (jint)event->motion.y, - 0, JNI_FALSE); - } - break; - case GDK_ENTER_NOTIFY: - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_ENTERED, - (jlong)event->crossing.time, - state_to_awt_mods (event->crossing.state), - (jint)event->crossing.x, - (jint)event->crossing.y, - 0, JNI_FALSE); - break; - case GDK_LEAVE_NOTIFY: - if (event->crossing.mode == GDK_CROSSING_NORMAL) - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, postMouseEventID, - AWT_MOUSE_EXITED, - (jlong)event->crossing.time, - state_to_awt_mods (event->crossing.state), - (jint)event->crossing.x, - (jint)event->crossing.y, - 0, JNI_FALSE); - break; - case GDK_CONFIGURE: - { - GtkWidget *widget; - - gdk_window_get_user_data (event->any.window, (void **) &widget); - - if (widget && GTK_WIDGET_TOPLEVEL (widget)) - { - gint top, left, right, bottom; - gint x, y, w, h, wb, d; - - /* calculate our insets */ - gdk_window_get_root_geometry (event->any.window, - &x, &y, &w, &h, &wb, &d); - - /* We used to compute these based on the configure - event's fields. However, that gives strange and - apparently incorrect results. */ - top = left = bottom = right = 0; - - /* configure events are not posted to the AWT event queue, - and as such, gdk/gtk will be called back before - postConfigureEvent returns */ - gdk_threads_leave (); - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, - postConfigureEventID, - (jint)event->configure.x, - (jint)event->configure.y, - (jint)event->configure.width, - (jint)event->configure.height, - (jint)top, - (jint)left, - (jint)bottom, - (jint)right); - gdk_threads_enter (); - } - } - break; - case GDK_EXPOSE: - { - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, - postExposeEventID, - (jint)event->expose.area.x, - (jint)event->expose.area.y, - (jint)event->expose.area.width, - (jint)event->expose.area.height); - } - break; - - case GDK_KEY_PRESS: - { - GtkWidget *widget; - GtkWindow *window; - - gdk_window_get_user_data (event->any.window, (void **) &widget); - - window = GTK_WINDOW (gtk_widget_get_ancestor (widget, - GTK_TYPE_WINDOW)); - if (window - && GTK_WIDGET_IS_SENSITIVE (window) - && window->focus_widget - && GTK_WIDGET_IS_SENSITIVE (window->focus_widget) - && window->focus_widget->window) - { - gtk_widget_activate (window->focus_widget); - gdk_property_get (window->focus_widget->window, - gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE), - gdk_atom_intern ("CARDINAL", FALSE), - 0, - sizeof (jobject), - FALSE, - NULL, - NULL, - NULL, - (guchar **)&obj_ptr); - - /* if (grab && GTK_WIDGET_HAS_DEFAULT (widget) ) */ - /* { */ - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, - postKeyEventID, - (jint) AWT_KEY_PRESSED, - (jlong) event->key.time, - state_to_awt_mods (event->key.state), - keysym_to_awt_keycode (event->key.keyval), - (jchar) (event->key.length) ? - event->key.string[0] : - AWT_KEY_CHAR_UNDEFINED); - if (event->key.length) - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, - postKeyEventID, - (jint) AWT_KEY_TYPED, - (jlong) event->key.time, - state_to_awt_mods (event->key.state), - VK_UNDEFINED, - (jchar) event->key.string[0]); - } - } - break; - case GDK_FOCUS_CHANGE: - (*gdk_env)->CallVoidMethod (gdk_env, *obj_ptr, - postFocusEventID, - (jint) (event->focus_change.in) ? - AWT_FOCUS_GAINED : AWT_FOCUS_LOST, - JNI_FALSE); - break; - default: - } - g_free (obj_ptr); - } - - gtk_main_do_event (event); -} - -static void -attach_jobject (GdkWindow *window, jobject *obj) -{ - GdkAtom addr_atom = gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE); - GdkAtom type_atom = gdk_atom_intern ("CARDINAL", FALSE); - - gdk_window_set_events (window, - gdk_window_get_events (window) - | GDK_POINTER_MOTION_MASK - | GDK_BUTTON_MOTION_MASK - | GDK_BUTTON_PRESS_MASK - | GDK_BUTTON_RELEASE_MASK - | GDK_KEY_PRESS_MASK - | GDK_KEY_RELEASE_MASK - | GDK_ENTER_NOTIFY_MASK - | GDK_LEAVE_NOTIFY_MASK - | GDK_STRUCTURE_MASK - | GDK_KEY_PRESS_MASK - | GDK_FOCUS_CHANGE_MASK); - - gdk_property_change (window, - addr_atom, - type_atom, - 8, - GDK_PROP_MODE_REPLACE, - (guchar *)obj, - sizeof (jobject)); -} - -void -connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...) -{ - int i; - va_list ap; - jobject *obj; - - obj = (jobject *) malloc (sizeof (jobject)); - *obj = (*env)->NewGlobalRef (env, peer_obj); - - va_start (ap, nwindows); - for (i = 0; i < nwindows; i++) - attach_jobject (va_arg (ap, GdkWindow *), obj); - va_end (ap); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c deleted file mode 100644 index 2308d1100ed..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c +++ /dev/null @@ -1,92 +0,0 @@ -/* gtkfiledialogpeer.c -- Native implementation of GtkFileDialogPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkFileDialogPeer.h" - -/* - * Make a new file selection dialog - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create - (JNIEnv *env, jobject obj) -{ - gpointer widget; - - gdk_threads_enter (); - widget = gtk_type_new (gtk_file_selection_get_type ()); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - /* NOTE: we don't call the superclass connect method here. */ - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); - - gdk_threads_leave (); -} - -/* - * Set the filename in the file selection dialog. - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_gtkFileSelectionSetFilename - (JNIEnv *env, jobject obj, jstring filename) -{ - void *ptr; - const char *str; - - ptr = NSA_GET_PTR (env, obj); - - str = (*env)->GetStringUTFChars (env, filename, 0); - gdk_threads_enter (); - gtk_file_selection_set_filename (GTK_FILE_SELECTION (ptr), str); - gdk_threads_leave (); - (*env)->ReleaseStringUTFChars (env, filename, str); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c deleted file mode 100644 index dd446c89489..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkImagePainter.c +++ /dev/null @@ -1,160 +0,0 @@ -/* gtkimagepainter.c - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkImagePainter.h" -#include <libart_lgpl/art_misc.h> -#include <libart_lgpl/art_rgb_affine.h> - -#define SWAPU32(w) \ - (((w) << 24) | (((w) & 0xff00) << 8) | (((w) >> 8) & 0xff00) | ((w) >> 24)) - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkImagePainter_drawPixels -(JNIEnv *env, jobject obj, jobject gc_obj, jint bg_red, jint bg_green, - jint bg_blue, jint x, jint y, jint width, jint height, jintArray jpixels, - jint offset, jint scansize, jdoubleArray jaffine) -{ - struct graphics *g; - jint *pixels, *elems; - guchar *packed; - int i; - jsize num_pixels; - guchar *j_rgba, *c_rgb; - - g = (struct graphics *) NSA_GET_PTR (env, gc_obj); - - elems = (*env)->GetIntArrayElements (env, jpixels, NULL); - num_pixels = (*env)->GetArrayLength (env, jpixels); - - /* get a copy of the pixel data so we can modify it */ - pixels = malloc (sizeof (jint) * num_pixels); - memcpy (pixels, elems, sizeof (jint) * num_pixels); - - (*env)->ReleaseIntArrayElements (env, jpixels, elems, 0); - -#ifndef WORDS_BIGENDIAN - /* convert pixels from 0xBBGGRRAA to 0xAARRGGBB */ - for (i = 0; i < num_pixels; i++) - pixels[i] = SWAPU32 ((unsigned)pixels[i]); -#endif - - packed = (guchar *) malloc (sizeof (guchar) * 3 * num_pixels); - j_rgba = (guchar *) pixels; - c_rgb = packed; - - /* copy over pixels in DirectColorModel format to 24 bit RGB image data, - and process the alpha channel */ - for (i = 0; i < num_pixels; i++) - { - jint ialpha = *j_rgba++; - - switch (ialpha) - { - case 0: /* full transparency */ - *c_rgb++ = bg_red; - *c_rgb++ = bg_green; - *c_rgb++ = bg_blue; - j_rgba += 3; - break; - case 255: /* opaque */ - *c_rgb++ = *j_rgba++; - *c_rgb++ = *j_rgba++; - *c_rgb++ = *j_rgba++; - break; - default: /* compositing required */ - { - jfloat alpha = ialpha / 255.0; - jfloat comp_alpha = 1.0 - alpha; - - *c_rgb++ = *j_rgba++ * alpha + bg_red * comp_alpha; - *c_rgb++ = *j_rgba++ * alpha + bg_green * comp_alpha; - *c_rgb++ = *j_rgba++ * alpha + bg_blue * comp_alpha; - } - break; - } - } - - if (jaffine) - { - jdouble *affine; - ArtAlphaGamma *alphagamma = NULL; - art_u8 *dst; - int new_width, new_height; - int i; - - affine = (*env)->GetDoubleArrayElements (env, jaffine, NULL); - - new_width = abs (width * affine[0]); - new_height = abs (height * affine[3]); - - dst = (art_u8 *) malloc (sizeof (art_u8) * 3 * (new_width * new_height)); - - art_rgb_affine (dst, - 0, 0, - new_width, new_height, - new_width * 3, - (art_u8 *) packed + offset * 3, - width, height, - scansize * 3, - affine, - ART_FILTER_NEAREST, - alphagamma); - - (*env)->ReleaseDoubleArrayElements (env, jaffine, affine, JNI_ABORT); - - free (packed); - packed = (guchar *) dst; - - width = scansize = new_width; - height = new_height; - offset = 0; - } - - gdk_threads_enter (); - - gdk_draw_rgb_image (g->drawable, - g->gc, - x + g->x_offset, - y + g->y_offset, - width, height, GDK_RGB_DITHER_NORMAL, - packed + offset * 3, scansize * 3); - - gdk_threads_leave (); - - free (pixels); - free (packed); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c deleted file mode 100644 index 9313a8a815b..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c +++ /dev/null @@ -1,57 +0,0 @@ -/* gtklabelpeer.c -- Native implementation of GtkLabelPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkLabelPeer.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create - (JNIEnv *env, jobject obj) -{ - GtkWidget *label; - GtkContainer *ebox; - - gdk_threads_enter (); - ebox = GTK_CONTAINER (gtk_type_new (gtk_event_box_get_type ())); - label = GTK_WIDGET (gtk_type_new (gtk_label_get_type ())); - gtk_container_add (ebox, label); - gtk_widget_show (label); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, ebox); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c deleted file mode 100644 index 5787ce5083e..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c +++ /dev/null @@ -1,381 +0,0 @@ -/* gtklistpeer.c -- Native implementation of GtkListPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkListPeer.h" - -static void -connect_selectable_hook (JNIEnv *env, jobject peer_obj, GtkCList *list); - -#define CLIST_FROM_SW(obj) (GTK_CLIST(GTK_SCROLLED_WINDOW (obj)->container.child)) - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_create - (JNIEnv *env, jobject obj) -{ - GtkWidget *list, *sw; - - gdk_threads_enter (); - list = gtk_clist_new (1); - gtk_widget_show (list); - sw = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (sw), list); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, sw); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_selectable_hook (env, obj, CLIST_FROM_SW (ptr)); - connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_append - (JNIEnv *env, jobject obj, jobjectArray items) -{ - void *ptr; - GtkCList *list; - jint count, i; - - ptr = NSA_GET_PTR (env, obj); - - count = (*env)->GetArrayLength (env, items); - - gdk_threads_enter (); - list = CLIST_FROM_SW (ptr); - for (i = 0; i < count; i++) - { - const char *text; - jobject item; - - item = (*env)->GetObjectArrayElement (env, items, i); - - text = (*env)->GetStringUTFChars (env, item, NULL); - gtk_clist_append (list, (char **)&text); - (*env)->ReleaseStringUTFChars (env, item, text); - } - - gtk_clist_columns_autosize (list); - gdk_threads_leave (); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_old_create - (JNIEnv *env, jobject obj, jobject parent_obj, - jobjectArray items, jboolean mode) -{ - GtkWidget *list, *sw, *parent; - jsize count, i; - - parent = NSA_GET_PTR (env, parent_obj); - - count = (*env)->GetArrayLength (env, items); - - gdk_threads_enter (); - - list = gtk_clist_new (1); - gtk_widget_show (list); - - sw = gtk_scrolled_window_new (NULL, NULL); - set_parent (sw, GTK_CONTAINER (parent)); - gtk_widget_realize (sw); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_container_add (GTK_CONTAINER (sw), list); - - connect_selectable_hook (env, obj, GTK_CLIST (list)); - connect_awt_hook (env, obj, 1, list->window); - - gtk_clist_set_selection_mode (GTK_CLIST (list), - mode ? GTK_SELECTION_MULTIPLE : - GTK_SELECTION_SINGLE); - - for (i = 0; i < count; i++) - { - const char *text; - jobject item; - - item = (*env)->GetObjectArrayElement (env, items, i); - - text = (*env)->GetStringUTFChars (env, item, NULL); - gtk_clist_append (GTK_CLIST (list), (char **)&text); - (*env)->ReleaseStringUTFChars (env, item, text); - } - - gtk_clist_columns_autosize (GTK_CLIST (list)); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, sw); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_add - (JNIEnv *env, jobject obj, jstring text, jint index) -{ - void *ptr; - const char *str; - - ptr = NSA_GET_PTR (env, obj); - str = (*env)->GetStringUTFChars (env, text, NULL); - - gdk_threads_enter (); - gtk_clist_insert (CLIST_FROM_SW (ptr), index, (char **)&str); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, text, str); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_delItems - (JNIEnv *env, jobject obj, jint start, jint end) -{ - void *ptr; - GtkCList *list; - jint i; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - list = CLIST_FROM_SW (ptr); - - if (end == -1) /* special case for removing all rows */ - end = list->rows; - - gtk_clist_freeze (list); - for (i = start; i < end; i++) - gtk_clist_remove (list, i); - gtk_clist_thaw (list); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_select - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_clist_select_row (CLIST_FROM_SW (ptr), index, 0); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_deselect - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_clist_unselect_row (CLIST_FROM_SW (ptr), index, 0); - gdk_threads_leave (); -} - -/* FIXME: magic mojo (that doesn't seem to do anything) */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_getSize - (JNIEnv *env, jobject obj, jint rows, jintArray jdims) -{ - void *ptr; - jint *dims; - GtkWidget *list; - GtkScrolledWindow *sw; - GtkRequisition myreq; - - dims = (*env)->GetIntArrayElements (env, jdims, NULL); - dims[0] = dims[1] = 0; - - if (rows < 3) - rows = 3; - - ptr = NSA_GET_PTR (env, obj); - gdk_threads_enter (); - - list = GTK_WIDGET (CLIST_FROM_SW (ptr)); - sw = GTK_SCROLLED_WINDOW (ptr); - - /* - gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - &myreq); - dims[1]=myreq.height+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - */ - - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - "size_request", &myreq); - /* - - gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - &myreq); - */ - - dims[0]=myreq.width+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - gtk_signal_emit_by_name (GTK_OBJECT (list), "size_request", &myreq); - - // gtk_widget_size_request(GTK_WIDGET (list), &myreq); - - dims[0] += myreq.width + gdk_char_width (list->style->font, 'W'); - - dims[1] += ((rows * (gdk_char_height (list->style->font, 'W')+7)) - + (2 * (list->style->klass->ythickness))); - - - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements (env, jdims, dims, 0); -} - - -JNIEXPORT jintArray JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_getSelectedIndexes - (JNIEnv *env, jobject obj) -{ - void *ptr; - GtkCList *list; - jintArray selection; - jint *sel; - GList *child; - jint count, i; - - ptr = NSA_GET_PTR (env, obj); - gdk_threads_enter (); - - list = CLIST_FROM_SW (ptr); - count = g_list_length (list->selection); - - selection = (*env)->NewIntArray (env, count); - sel = (*env)->GetIntArrayElements (env, selection, NULL); - - for (i = 0, child = list->selection; i < count; i++) - { - sel[i] = GPOINTER_TO_INT (child->data); - child = g_list_next (child); - } - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements (env, selection, sel, 0); - - return selection; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_makeVisible - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_clist_moveto (CLIST_FROM_SW (ptr), index, 0, 0.5, 0.5); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkListPeer_setMultipleMode - (JNIEnv *env, jobject obj, jboolean mode) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_clist_set_selection_mode (CLIST_FROM_SW (ptr), - mode ? GTK_SELECTION_MULTIPLE : - GTK_SELECTION_SINGLE); - gdk_threads_leave (); -} - -static void -item_select (GtkCList *list, int row, int col, GdkEventButton *event, - jobject *peer_obj) -{ - (*gdk_env)->CallVoidMethod (gdk_env, *peer_obj, - postListItemEventID, - row, - (jint) AWT_ITEM_SELECTED); -} - -static void -item_unselect (GtkCList *list, int row, int col, GdkEventButton *event, - jobject *peer_obj) -{ - (*gdk_env)->CallVoidMethod (gdk_env, *peer_obj, - postListItemEventID, - row, - (jint) AWT_ITEM_DESELECTED); -} - -static void -connect_selectable_hook (JNIEnv *env, jobject peer_obj, GtkCList *list) -{ - jobject *obj; - - obj = (jobject *) malloc (sizeof (jobject)); - *obj = (*env)->NewGlobalRef (env, peer_obj); - - gtk_signal_connect (GTK_OBJECT (list), "select_row", - GTK_SIGNAL_FUNC (item_select), obj); - - gtk_signal_connect (GTK_OBJECT (list), "unselect_row", - GTK_SIGNAL_FUNC (item_unselect), obj); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c deleted file mode 100644 index af14f0be8a9..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c +++ /dev/null @@ -1,163 +0,0 @@ -/* gtkmainthread.c -- Native implementation of GtkMainThread - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMainThread.h" -#include "gthread-jni.h" - -#ifdef JVM_SUN - struct state_table *native_state_table; -#endif - -jmethodID postActionEventID; -jmethodID postMenuActionEventID; -jmethodID postMouseEventID; -jmethodID postConfigureEventID; -jmethodID postExposeEventID; -jmethodID postKeyEventID; -jmethodID postFocusEventID; -jmethodID postAdjustmentEventID; -jmethodID postItemEventID; -jmethodID postListItemEventID; -JNIEnv *gdk_env; - -/* - * Call gtk_init. It is very important that this happen before any other - * gtk calls. - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz) -{ - int argc = 1; - char **argv; - char *homedir, *rcpath = NULL; -/* jclass gtkgenericpeer; */ - jclass gtkcomponentpeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer, gtkmenuitempeer; - - NSA_INIT (env, clazz); - - /* GTK requires a program's argc and argv variables, and requires that they - be valid. */ - - argv = (char **) malloc (sizeof (char *) * 2); - argv[0] = ""; - argv[1] = NULL; - - /* until we have JDK 1.2 JNI, assume we have a VM with threads that - match what GLIB was compiled for */ - g_thread_init (NULL); - - gtk_init (&argc, &argv); - - gdk_rgb_init (); - gtk_widget_set_default_colormap (gdk_rgb_get_cmap ()); - gtk_widget_set_default_visual (gdk_rgb_get_visual ()); - - /* Make sure queued calls don't get sent to GTK/GDK while - we're shutting down. */ - atexit (gdk_threads_enter); - - gdk_env = env; - gdk_event_handler_set ((GdkEventFunc)awt_event_handler, NULL, NULL); - - if ((homedir = getenv ("HOME"))) - { - rcpath = (char *) malloc (strlen (homedir) + strlen (RC_FILE) + 2); - sprintf (rcpath, "%s/%s", homedir, RC_FILE); - } - - gtk_rc_parse ((rcpath) ? rcpath : RC_FILE); - - if (rcpath) - free (rcpath); - - free (argv); - - /* setup cached IDs for posting GTK events to Java */ -/* gtkgenericpeer = (*env)->FindClass (env, */ -/* "gnu/java/awt/peer/gtk/GtkGenericPeer"); */ - gtkcomponentpeer = (*env)->FindClass (env, - "gnu/java/awt/peer/gtk/GtkComponentPeer"); - gtkwindowpeer = (*env)->FindClass (env, - "gnu/java/awt/peer/gtk/GtkWindowPeer"); - gtkscrollbarpeer = (*env)->FindClass (env, - "gnu/java/awt/peer/gtk/GtkScrollbarPeer"); - gtklistpeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkListPeer"); - gtkmenuitempeer = (*env)->FindClass (env, "gnu/java/awt/peer/gtk/GtkMenuItemPeer"); -/* gdkColor = (*env)->FindClass (env, */ -/* "gnu/java/awt/peer/gtk/GdkColor"); */ -/* gdkColorID = (*env)->GetMethodID (env, gdkColor, "<init>", "(III)V"); */ -/* postActionEventID = (*env)->GetMethodID (env, gtkgenericpeer, */ -/* "postActionEvent", */ -/* "(Ljava/lang/String;I)V"); */ - - postMenuActionEventID = (*env)->GetMethodID (env, gtkmenuitempeer, - "postMenuActionEvent", - "()V"); - postMouseEventID = (*env)->GetMethodID (env, gtkcomponentpeer, - "postMouseEvent", "(IJIIIIZ)V"); - postConfigureEventID = (*env)->GetMethodID (env, gtkwindowpeer, - "postConfigureEvent", "(IIIIIIII)V"); - postExposeEventID = (*env)->GetMethodID (env, gtkcomponentpeer, - "postExposeEvent", "(IIII)V"); - postKeyEventID = (*env)->GetMethodID (env, gtkcomponentpeer, - "postKeyEvent", "(IJIIC)V"); - postFocusEventID = (*env)->GetMethodID (env, gtkcomponentpeer, - "postFocusEvent", "(IZ)V"); - postAdjustmentEventID = (*env)->GetMethodID (env, gtkscrollbarpeer, - "postAdjustmentEvent", - "(II)V"); - postItemEventID = (*env)->GetMethodID (env, gtkcomponentpeer, - "postItemEvent", - "(Ljava/lang/Object;I)V"); - postListItemEventID = (*env)->GetMethodID (env, gtklistpeer, - "postItemEvent", - "(II)V"); -} - -/* - * Run gtk_main and block. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkMain (JNIEnv *env, jobject obj) -{ - gdk_threads_enter (); - gtk_main (); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c deleted file mode 100644 index 89818e05fb1..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c +++ /dev/null @@ -1,81 +0,0 @@ -/* gtkmenubarpeer.c -- Native implementation of GtkMenuBarPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMenuBarPeer.h" - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create - (JNIEnv *env, jobject obj) -{ - GtkWidget *widget; - - gdk_threads_enter (); - widget = gtk_menu_bar_new (); - gtk_widget_show (widget); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_addMenu - (JNIEnv *env, jobject obj, jobject menupeer) -{ - void *mbar, *menu; - - mbar = NSA_GET_PTR (env, obj); - menu = NSA_GET_PTR (env, menupeer); - - gdk_threads_enter (); - gtk_menu_bar_append (GTK_MENU_BAR (mbar), GTK_WIDGET (menu)); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_delMenu - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - GList *list; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - list = gtk_container_children (GTK_CONTAINER (ptr)); - list = g_list_nth (list, index); - gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data)); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c deleted file mode 100644 index ee3920867a8..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c +++ /dev/null @@ -1,120 +0,0 @@ -/* gtkmenuitempeer.c -- Native implementation of GtkMenuItemPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMenuItemPeer.h" -#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h" - -static void -connect_activate_hook (JNIEnv *, jobject, GtkMenuItem *); - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create - (JNIEnv *env, jobject obj, jstring label) -{ - GtkWidget *widget; - const char *str; - - str = (*env)->GetStringUTFChars (env, label, NULL); - - gdk_threads_enter (); - - if (strcmp (str, "-") == 0) /* "-" signals that we need a separator */ - widget = gtk_menu_item_new (); - else - widget = gtk_menu_item_new_with_label (str); - - connect_activate_hook (env, obj, GTK_MENU_ITEM (widget)); - gtk_widget_show (widget); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, label, str); - - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setLabel - (JNIEnv *env, jobject obj, jstring label) -{ - void *ptr; - const char *str; - - ptr = NSA_GET_PTR (env, obj); - - str = (*env)->GetStringUTFChars (env, label, NULL); - - gdk_threads_enter (); - - if (strcmp (str, "-") == 0) /* "-" signals that we need a separator */ - gtk_container_remove (GTK_CONTAINER (ptr), GTK_BIN (ptr)->child); - else - { - GtkAccelLabel *accel_label = GTK_ACCEL_LABEL (GTK_BIN (ptr)->child); - - gtk_label_set_text (GTK_LABEL (accel_label), str); - gtk_accel_label_refetch (accel_label); - } - - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, label, str); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_setEnabled - (JNIEnv *env, jobject obj, jboolean enabled) -{ -/* Java_gnu_java_awt_peer_gtk_GtkComponentPeer_setEnabled (env, obj, enabled); */ -} - -static void -item_activate (GtkMenuItem *item, jobject *peer_obj) -{ - (*gdk_env)->CallVoidMethod (gdk_env, *peer_obj, - postMenuActionEventID); -} - -static void -connect_activate_hook (JNIEnv *env, jobject peer_obj, GtkMenuItem *item) -{ - jobject *obj; - - obj = (jobject *) malloc (sizeof (jobject)); - *obj = (*env)->NewGlobalRef (env, peer_obj); - - gtk_signal_connect (GTK_OBJECT (item), "activate", - GTK_SIGNAL_FUNC (item_activate), obj); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c deleted file mode 100644 index ec8154276cd..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c +++ /dev/null @@ -1,152 +0,0 @@ -/* gtkmenupeer.c -- Native implementation of GtkMenuPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkMenuPeer.h" - -static void -accel_attach (GtkMenuItem *menu_item, gpointer *user_data) -{ - GtkAccelGroup *accel; - - accel = gtk_menu_get_accel_group (GTK_MENU (menu_item->submenu)); - gtk_accel_group_attach (accel, - GTK_OBJECT (gtk_widget_get_toplevel (GTK_WIDGET(menu_item)))); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_setupAccelGroup - (JNIEnv *env, jobject obj, jobject parent) -{ - void *ptr1, *ptr2; - - ptr1 = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - if (!parent) - { - gtk_menu_set_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu), - gtk_accel_group_new ()); - - if (GTK_WIDGET_REALIZED (GTK_WIDGET (ptr1))) - accel_attach (GTK_MENU_ITEM (ptr1), NULL); - else - gtk_signal_connect (GTK_OBJECT (ptr1), - "realize", - GTK_SIGNAL_FUNC (accel_attach), - NULL); - } - else - { - GtkAccelGroup *parent_accel; - - ptr2 = NSA_GET_PTR (env, parent); - parent_accel = gtk_menu_get_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr2)->submenu)); - - gtk_menu_set_accel_group (GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu), - parent_accel); - } - - gdk_threads_leave (); -} - - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create - (JNIEnv *env, jobject obj, jstring label) -{ - GtkWidget *menu_title, *menu; - const char *str; - - str = (*env)->GetStringUTFChars (env, label, NULL); - - gdk_threads_enter (); - menu = gtk_menu_new (); - - menu_title = gtk_menu_item_new_with_label (str); - gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_title), menu); - - gtk_widget_show (menu); - gtk_widget_show (menu_title); - - NSA_SET_PTR (env, obj, menu_title); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, label, str); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_addItem - (JNIEnv *env, jobject obj, jobject menuitempeer, jint key, jboolean shift) -{ - void *ptr1, *ptr2; - GtkMenu *menu; - - ptr1 = NSA_GET_PTR (env, obj); - ptr2 = NSA_GET_PTR (env, menuitempeer); - - gdk_threads_enter (); - - menu = GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu); - gtk_menu_append (menu, GTK_WIDGET (ptr2)); - - if (key) - { - gtk_widget_add_accelerator (GTK_WIDGET (ptr2), "activate", - gtk_menu_get_accel_group (menu), key, - (GDK_CONTROL_MASK - | ((shift) ? GDK_SHIFT_MASK : 0)), - GTK_ACCEL_VISIBLE); - } - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_delItem - (JNIEnv *env, jobject obj, jint index) -{ - void *ptr; - GList *list; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - list = gtk_container_children (GTK_CONTAINER (ptr)); - list = g_list_nth (list, index); - gtk_container_remove (GTK_CONTAINER (ptr), GTK_WIDGET (list->data)); - gdk_threads_leave (); -} - - diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c deleted file mode 100644 index b52c75d5311..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c +++ /dev/null @@ -1,137 +0,0 @@ -/* gtkpanelpeer.c -- Native implementation of GtkPanelPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkPanelPeer.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create - (JNIEnv *env, jobject obj) -{ - gpointer widget; - - gdk_threads_enter (); - widget = gtk_layout_new (NULL, NULL); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} - -typedef struct _GtkLayoutChild GtkLayoutChild; - -struct _GtkLayoutChild { - GtkWidget *widget; - gint x; - gint y; -}; - -static -void sr (GtkWidget *widget, GtkRequisition *requisition, gpointer user_data) -{ - GtkLayout *layout; - GtkLayoutChild *child; - GList *children; - - layout = GTK_LAYOUT (widget); - requisition->width = GTK_WIDGET (widget)->allocation.width; - requisition->height = GTK_WIDGET (widget)->allocation.height; - - children = layout->children; - while (children) - { - child = children->data; - children = children->next; - - if (GTK_WIDGET_VISIBLE (child->widget)) - { - requisition->height = MAX (requisition->height, - child->y + - child->widget->allocation.height); - requisition->width = MAX (requisition->width, - child->x + - child->widget->allocation.width); - } - } - - requisition->height += GTK_CONTAINER (layout)->border_width * 2; - requisition->width += GTK_CONTAINER (layout)->border_width * 2; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_awt_hook (env, obj, 1, GTK_LAYOUT (ptr)->bin_window); - -/* gtk_signal_connect (GTK_OBJECT (ptr), "size_request", GTK_SIGNAL_FUNC (sr), */ -/* NULL); */ - gdk_threads_leave (); -} - -/* - * Make a new panel. - */ -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew - (JNIEnv *env, jobject obj, jobject parent_obj) -{ - GtkWidget *layout; - void *parent; - - parent = NSA_GET_PTR (env, parent_obj); - - gdk_threads_enter (); - layout = gtk_layout_new (NULL, NULL); - - set_parent (layout, GTK_CONTAINER (parent)); - - gtk_widget_realize (layout); - connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window); - set_visible (layout, 1); - - NSA_SET_PTR (env, obj, layout); - gdk_threads_leave (); -} - - diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c deleted file mode 100644 index 66affcff255..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPopupMenuPeer.c +++ /dev/null @@ -1,93 +0,0 @@ -/* gtkpopupmenupeer.c -- Native implementation of GtkPopupMenuPeer - Copyright (C) 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkPopupMenuPeer.h" - -struct pos -{ - gint x; - gint y; -}; - -void -menu_pos (GtkMenu *menu, gint *x, gint *y, gpointer user_data) -{ - struct pos *p = (struct pos *) user_data; - - *x = p->x; - *y = p->y; -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_show - (JNIEnv *env, jobject obj, jint x, jint y, jlong time) -{ - void *ptr; - struct pos *p; - - ptr = NSA_GET_PTR (env, obj); - - p = g_malloc (sizeof (struct pos)); - p->x = x; - p->y = y; - - gdk_threads_enter (); - gtk_menu_popup (GTK_MENU (GTK_MENU_ITEM (ptr)->submenu), - NULL, NULL, menu_pos, p, 3, time); - gdk_threads_leave (); - - g_free (p); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkPopupMenuPeer_setupAccelGroup - (JNIEnv *env, jobject obj, jobject parent) -{ - void *ptr1, *ptr2; - GtkMenu *menu; - - ptr1 = NSA_GET_PTR (env, obj); - ptr2 = NSA_GET_PTR (env, parent); - - gdk_threads_enter (); - menu = GTK_MENU (GTK_MENU_ITEM (ptr1)->submenu); - gtk_menu_set_accel_group (menu, gtk_accel_group_new ()); - gtk_accel_group_attach (gtk_menu_get_accel_group (menu), - GTK_OBJECT (gtk_widget_get_toplevel (ptr2))); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c deleted file mode 100644 index 4b8787e7d93..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c +++ /dev/null @@ -1,183 +0,0 @@ -/* gtkscrollbarpeer.c -- Native implementation of GtkScrollbarPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkScrollbarPeer.h" - -struct range_scrollbar -{ - GtkRange *range; - jobject *scrollbar; -}; - -static void -post_adjustment_event (GtkAdjustment *adj, struct range_scrollbar *rs) -{ - jint type; - - switch (rs->range->scroll_type) - { - case GTK_SCROLL_STEP_FORWARD: - type = AWT_ADJUSTMENT_UNIT_INCREMENT; - break; - case GTK_SCROLL_STEP_BACKWARD: - type = AWT_ADJUSTMENT_UNIT_DECREMENT; - break; - case GTK_SCROLL_PAGE_FORWARD: - type = AWT_ADJUSTMENT_BLOCK_INCREMENT; - break; - case GTK_SCROLL_PAGE_BACKWARD: - type = AWT_ADJUSTMENT_BLOCK_DECREMENT; - break; - case GTK_SCROLL_JUMP: - type = AWT_ADJUSTMENT_TRACK; - break; - default: /* GTK_SCROLL_NONE */ - return; - } - - (*gdk_env)->CallVoidMethod (gdk_env, *(rs->scrollbar), postAdjustmentEventID, - type, (jint) adj->value); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create -(JNIEnv *env, jobject obj, jint orientation, jint value, - jint min, jint max, jint step_incr, jint page_incr, jint visible_amount) -{ - GtkWidget *sb; - GtkObject *adj; - - gdk_threads_enter (); - adj = gtk_adjustment_new (value, min, max, - step_incr, page_incr, - visible_amount); - - sb = (orientation) ? gtk_vscrollbar_new (GTK_ADJUSTMENT (adj)) : - gtk_hscrollbar_new (GTK_ADJUSTMENT (adj)); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, sb); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - struct range_scrollbar *rs; - - rs = (struct range_scrollbar *) malloc (sizeof (struct range_scrollbar)); - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_realize (GTK_WIDGET (ptr)); - - rs->range = GTK_RANGE (ptr); - rs->scrollbar = (jobject *) malloc (sizeof (jobject)); - *(rs->scrollbar) = (*env)->NewGlobalRef (env, obj); - gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)->adjustment), - "value_changed", - GTK_SIGNAL_FUNC (post_adjustment_event), rs); - - connect_awt_hook (env, obj, 4, - GTK_RANGE (ptr)->trough, - GTK_RANGE (ptr)->slider, - GTK_RANGE (ptr)->step_forw, - GTK_RANGE (ptr)->step_back); - gdk_threads_leave (); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setLineIncrement - (JNIEnv *env, jobject obj, jint amount) -{ - void *ptr; - GtkAdjustment *adj; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - adj = GTK_RANGE (ptr)->adjustment; - adj->step_increment = amount; - gtk_adjustment_changed (adj); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setPageIncrement - (JNIEnv *env, jobject obj, jint amount) -{ - void *ptr; - GtkAdjustment *adj; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - adj = GTK_RANGE (ptr)->adjustment; - adj->page_increment = amount; - gtk_adjustment_changed (adj); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_setValues - (JNIEnv *env, jobject obj, jint value, jint visible, jint min, jint max) -{ - void *ptr; - GtkAdjustment *adj; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - adj = GTK_RANGE (ptr)->adjustment; - adj->value = value; - adj->page_size = visible; - adj->lower = min; - adj->upper = max; - gtk_adjustment_changed (adj); - - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c deleted file mode 100644 index 499b3124d88..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c +++ /dev/null @@ -1,190 +0,0 @@ -/* gtkscrollpanepeer.c -- Native implementation of GtkScrollPanePeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkScrollPanePeer.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create - (JNIEnv *env, jobject obj) -{ - gpointer window; - GtkWidget *layout; - - gdk_threads_enter (); - window = gtk_scrolled_window_new (NULL, NULL); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, window); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_setScrollPosition - (JNIEnv *env, jobject obj, jint x, jint y) -{ - GtkAdjustment *hadj, *vadj; - GtkScrolledWindow *sw; - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - sw = GTK_SCROLLED_WINDOW (ptr); - - hadj = gtk_scrolled_window_get_hadjustment (sw); - vadj = gtk_scrolled_window_get_vadjustment (sw); - - gtk_adjustment_set_value (hadj, x); - gtk_adjustment_set_value (vadj, y); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_gtkScrolledWindowSetHScrollIncrement - (JNIEnv *env, jobject obj, jint u) -{ - GtkAdjustment *hadj; - GtkScrolledWindow *sw; - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - sw = GTK_SCROLLED_WINDOW(ptr); - - hadj = gtk_scrolled_window_get_hadjustment (sw); - hadj->step_increment = u; - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_gtkScrolledWindowSetVScrollIncrement - (JNIEnv *env, jobject obj, jint u) -{ - GtkAdjustment *vadj; - GtkScrolledWindow *sw; - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - sw = GTK_SCROLLED_WINDOW(ptr); - - vadj = gtk_scrolled_window_get_hadjustment (sw); - vadj->step_increment = u; - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_childResized - (JNIEnv *env, jobject obj, jint width, jint height) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - return; - - gdk_threads_enter (); - gtk_widget_set_usize (GTK_BIN (ptr)->child, width, height); - gdk_threads_leave (); -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_getHScrollbarHeight - (JNIEnv *env, jobject obj) -{ - void *ptr; - GtkScrolledWindow *sw; - jint height; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - sw = GTK_SCROLLED_WINDOW (ptr); - height = (sw->hscrollbar_visible) ? sw->hscrollbar->allocation.height : 0; - gdk_threads_leave (); - - return height; -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_getVScrollbarWidth - (JNIEnv *env, jobject obj) -{ - void *ptr; - GtkScrolledWindow *sw; - jint width; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - sw = GTK_SCROLLED_WINDOW (ptr); - width = (sw->vscrollbar_visible) ? sw->vscrollbar->allocation.width : 0; - gdk_threads_leave (); - - return width; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_setPolicy - (JNIEnv *env, jobject obj, jint policy) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - switch (policy) - { - case AWT_SCROLLPANE_SCROLLBARS_AS_NEEDED: - policy = GTK_POLICY_AUTOMATIC; - break; - case AWT_SCROLLPANE_SCROLLBARS_ALWAYS: - policy = GTK_POLICY_ALWAYS; - break; - case AWT_SCROLLPANE_SCROLLBARS_NEVER: - policy = GTK_POLICY_NEVER; - break; - } - - gdk_threads_enter (); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ptr), policy, policy); - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c deleted file mode 100644 index 8f58623d573..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c +++ /dev/null @@ -1,209 +0,0 @@ -/* gtktextareapeer.c -- Native implementation of GtkTextAreaPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkTextAreaPeer.h" - -#define TEXT_FROM_SW(obj) (GTK_TEXT(GTK_SCROLLED_WINDOW (obj)->container.child)) -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create - (JNIEnv *env, jobject obj, jint scroll) -{ - GtkWidget *text, *sw; - - gdk_threads_enter (); - text = gtk_text_new (NULL, NULL); - gtk_widget_show (text); - - sw = gtk_scrolled_window_new (NULL, NULL); - gtk_container_add (GTK_CONTAINER (sw), text); - - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - - /* horizontal scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER, - - /* vertical scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, sw); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_old_create - (JNIEnv *env, jobject obj, jobject parent_obj, - jstring contents, jint scroll) -{ - GtkWidget *text, *sw; - const char *str; - int pos=0; - void *parent; - - parent = NSA_GET_PTR (env, parent_obj); - str = (*env)->GetStringUTFChars (env, contents, NULL); - - gdk_threads_enter (); - - text = gtk_text_new (NULL, NULL); - gtk_text_set_editable (GTK_TEXT (text), TRUE); - - gtk_editable_insert_text (GTK_EDITABLE (text), str, - strlen (str), &pos); - - sw = gtk_scrolled_window_new (NULL, NULL); - gtk_container_add (GTK_CONTAINER (sw), text); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), - - /* horizontal scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER, - - /* vertical scrollbar */ - (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH - || scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ? - GTK_POLICY_ALWAYS : GTK_POLICY_NEVER); - - set_visible (text, TRUE); - set_parent (sw, GTK_CONTAINER (parent)); - - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, contents, str); - - NSA_SET_PTR (env, obj, sw); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_gtkTextGetSize - (JNIEnv *env, jobject obj, jint rows, jint cols, jintArray jdims) -{ - void *ptr; - jint *dims; - GtkWidget *text; - GtkScrolledWindow *sw; - GtkRequisition myreq; - - ptr = NSA_GET_PTR (env, obj); - - dims = (*env)->GetIntArrayElements (env, jdims, 0); - dims[0] = dims[1] = 0; - - gdk_threads_enter (); - - text = GTK_WIDGET (TEXT_FROM_SW (ptr)); - sw = GTK_SCROLLED_WINDOW (ptr); - - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - "size_request", &myreq); - //gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->hscrollbar), - // &myreq); - dims[0]=myreq.width+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - gtk_signal_emit_by_name (GTK_OBJECT (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - "size_request", &myreq); - //gtk_widget_size_request(GTK_WIDGET (GTK_SCROLLED_WINDOW(sw)->vscrollbar), - // &myreq); - dims[1]=myreq.width+GTK_SCROLLED_WINDOW_CLASS - (GTK_OBJECT (sw)->klass)->scrollbar_spacing; - - /* The '1' in the following assignments is from - #define TEXT_BORDER_ROOM 1 - in gtktext.c */ - - dims[0] += ((cols * gdk_char_width (text->style->font, 'W')) - + (2 * (text->style->klass->xthickness + 1))); - dims[1] += ((rows * gdk_char_height (text->style->font, 'W')) - + (2 * (text->style->klass->ythickness + 1))); - - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements (env, jdims, dims, 0); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_insert - (JNIEnv *env, jobject obj, jstring contents, jint position) -{ - void *ptr; - const char *str; - int pos=position; - - ptr = NSA_GET_PTR (env, obj); - str = (*env)->GetStringUTFChars (env, contents, NULL); - - gdk_threads_enter (); - gtk_editable_insert_text (GTK_EDITABLE (TEXT_FROM_SW (ptr)), - str, strlen (str), &pos); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, contents, str); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_replaceRange - (JNIEnv *env, jobject obj, jstring contents, jint start, jint end) -{ - void *ptr; - GtkEditable *text; - const char *str; - int pos = start; - - ptr = NSA_GET_PTR (env, obj); - str = (*env)->GetStringUTFChars (env, contents, NULL); - - gdk_threads_enter (); - - text = GTK_EDITABLE (TEXT_FROM_SW (ptr)); - gtk_text_freeze (GTK_TEXT (text)); - gtk_editable_delete_text (text, start, end); - gtk_editable_insert_text (text, str, strlen (str), &pos); - gtk_text_thaw (GTK_TEXT (text)); - - gdk_threads_leave (); - (*env)->ReleaseStringUTFChars (env, contents, str); -} - diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c deleted file mode 100644 index 0b6db8f1840..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c +++ /dev/null @@ -1,180 +0,0 @@ -/* gtktextcomponentpeer.c -- Native implementation of GtkTextComponentPeer - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkTextComponentPeer.h" - -#define GET_EDITABLE(obj) (GTK_IS_EDITABLE (obj) ? GTK_EDITABLE (obj) : \ - GTK_EDITABLE (GTK_SCROLLED_WINDOW (obj)->container.child)) - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition - (JNIEnv *env, jobject obj) -{ - void *ptr; - int pos; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - pos = gtk_editable_get_position (GET_EDITABLE (ptr)); - gdk_threads_leave (); - - return pos; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setCaretPosition - (JNIEnv *env, jobject obj, jint pos) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_editable_set_position (GET_EDITABLE (ptr), pos); - gdk_threads_leave (); -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart - (JNIEnv *env, jobject obj) -{ - void *ptr; - int pos; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - pos = GET_EDITABLE (ptr)->selection_start_pos; - gdk_threads_leave (); - - return pos; -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd - (JNIEnv *env, jobject obj) -{ - void *ptr; - int pos; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - pos = GET_EDITABLE (ptr)->selection_end_pos; - gdk_threads_leave (); - - return pos; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_select - (JNIEnv *env, jobject obj, jint start, jint end) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_editable_select_region (GET_EDITABLE (ptr), start, end); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setEditable - (JNIEnv *env, jobject obj, jboolean state) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_editable_set_editable (GET_EDITABLE (ptr), state); - gdk_threads_leave (); -} - -JNIEXPORT jstring JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getText - (JNIEnv *env, jobject obj) -{ - void *ptr; - char *contents; - jstring jcontents; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - contents = gtk_editable_get_chars (GET_EDITABLE (ptr), 0, -1); - gdk_threads_leave (); - - jcontents = (*env)->NewStringUTF (env, contents); - g_free (contents); - - return jcontents; -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_setText - (JNIEnv *env, jobject obj, jstring contents) -{ - void *ptr; - GtkEditable *text; - const char *str; - int pos = 0; - - ptr = NSA_GET_PTR (env, obj); - str = (*env)->GetStringUTFChars (env, contents, NULL); - - gdk_threads_enter (); - - text = GET_EDITABLE (ptr); - - if (GTK_IS_TEXT (text)) - gtk_text_freeze (GTK_TEXT (text)); - - gtk_editable_delete_text (text, 0, -1); - gtk_editable_insert_text (text, str, strlen (str), &pos); - - if (GTK_IS_TEXT (text)) - gtk_text_thaw (GTK_TEXT (text)); - - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, contents, str); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c deleted file mode 100644 index 9085a57937d..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c +++ /dev/null @@ -1,150 +0,0 @@ -/* gtktextfieldpeer.c -- Native implementation of GtkTextFieldPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkTextFieldPeer.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create - (JNIEnv *env, jobject obj) -{ - gpointer widget; - - gdk_threads_enter (); - widget = gtk_type_new (gtk_entry_get_type ()); - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, widget); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_awt_hook (env, obj, 2, - GTK_WIDGET (ptr)->window, - GTK_ENTRY (ptr)->text_area); - gdk_threads_leave (); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_old_create - (JNIEnv *env, jobject obj, jobject parent_obj, jstring text) -{ - GtkWidget *entry; - const char *str; - void *parent; - - parent = NSA_GET_PTR (env, parent_obj); - - str = (*env)->GetStringUTFChars (env, text, NULL); - gdk_threads_enter (); - - entry = gtk_entry_new (); - gtk_entry_set_text (GTK_ENTRY (entry), str); - - set_parent (entry, GTK_CONTAINER (parent)); - - gtk_widget_realize (entry); - connect_awt_hook (env, obj, 2, - entry->window, GTK_ENTRY (entry)->text_area); - - NSA_SET_PTR (env, obj, entry); - - gdk_threads_leave (); - (*env)->ReleaseStringUTFChars (env, text, str); -} - - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_gtkEntryGetSize - (JNIEnv *env, jobject obj, jint cols, jintArray jdims) -{ - void *ptr; - jint *dims; - GtkRequisition myreq; - GtkEntry *entry; - - ptr = NSA_GET_PTR (env, obj); - dims = (*env)->GetIntArrayElements (env, jdims, 0); - - gdk_threads_enter (); - entry = GTK_ENTRY (ptr); - - gtk_signal_emit_by_name (GTK_OBJECT (entry), "size_request", &myreq); - - dims[0]=myreq.width-150 + (cols * - gdk_char_width (GTK_WIDGET (entry)->style->font, - 'W')); - dims[1]=myreq.height; - - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements (env, jdims, dims, 0); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_setEchoChar - (JNIEnv *env, jobject obj, jchar c) -{ - void *ptr; - GtkEntry *entry; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - entry = GTK_ENTRY (ptr); - - if (c!=0) - { -/* gtk_entry_set_echo_char (entry, c); */ - gtk_entry_set_visibility (entry, FALSE); - } - else - gtk_entry_set_visibility (entry, TRUE); - - gdk_threads_leave (); -} diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c deleted file mode 100644 index 1436badea5a..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkToolkit.c +++ /dev/null @@ -1,87 +0,0 @@ -/* gtktoolkit.c -- Native portion of GtkToolkit - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkToolkit.h" - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkToolkit_beep (JNIEnv *env, jobject obj) -{ - gdk_threads_enter (); - gdk_beep (); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkToolkit_sync (JNIEnv *env, jobject obj) -{ - gdk_threads_enter (); - gdk_flush (); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenSizeDimensions -(JNIEnv *env, jobject obj, jintArray jdims) -{ - jint *dims = (*env)->GetIntArrayElements (env, jdims, 0); - - gdk_threads_enter (); - - dims[0] = gdk_screen_width (); - dims[1] = gdk_screen_height (); - - gdk_threads_leave (); - - (*env)->ReleaseIntArrayElements(env, jdims, dims, 0); -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkToolkit_getScreenResolution (JNIEnv *env, - jobject obj) -{ - jint res; - - gdk_threads_enter (); - - res = gdk_screen_width () / (gdk_screen_width_mm () / 25.4); - - gdk_threads_leave (); - return res; -} - diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c deleted file mode 100644 index 3b7c06bf057..00000000000 --- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c +++ /dev/null @@ -1,365 +0,0 @@ -/* gtkwindowpeer.c -- Native implementation of GtkWindowPeer - Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gtkpeer.h" -#include "gnu_java_awt_peer_gtk_GtkWindowPeer.h" -#include "gnu_java_awt_peer_gtk_GtkFramePeer.h" -#include <gdk/gdkprivate.h> -#include <gdk/gdkx.h> - -static void setBounds (GtkWidget *, jint, jint, jint, jint); - -/* - * Make a new window (any type) - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create - (JNIEnv *env, jobject obj, jint type) -{ - gpointer window; - GtkWidget *vbox, *layout; - - gdk_threads_enter (); - window = gtk_window_new (type); - - vbox = gtk_vbox_new (0, 0); - layout = gtk_layout_new (NULL, NULL); - gtk_box_pack_end (GTK_BOX (vbox), layout, 1, 1, 0); - gtk_container_add (GTK_CONTAINER (window), vbox); - - gtk_widget_show (layout); - gtk_widget_show (vbox); - - gdk_threads_leave (); - - NSA_SET_PTR (env, obj, window); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setVisible - (JNIEnv *env, jobject obj, jboolean visible) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - if (visible) - gtk_widget_show (GTK_WIDGET (ptr)); - else - gtk_widget_hide (GTK_WIDGET (ptr)); - - XFlush (GDK_DISPLAY ()); - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectHooks - (JNIEnv *env, jobject obj) -{ - void *ptr; - GtkWidget *layout; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - layout = GTK_WIDGET (gtk_container_children (GTK_CONTAINER (GTK_BIN (ptr)->child))->data); - gtk_widget_realize (layout); - connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window); - - gtk_widget_realize (GTK_WIDGET (ptr)); - connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window); - gdk_threads_leave (); -} - -void -setup_window (JNIEnv *env, jobject obj, GtkWidget *window, jint width, - jint height, jboolean visible) -{ - GtkWidget *layout, *vbox; - gint x, y; - - gtk_window_set_policy (GTK_WINDOW (window), 1, 1, 0); - gtk_widget_set_usize (window, width, height); - - vbox = gtk_vbox_new (0, 0); - layout = gtk_layout_new (NULL, NULL); - gtk_box_pack_end (GTK_BOX (vbox), layout, 1, 1, 0); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_widget_realize (layout); - connect_awt_hook (env, obj, 1, GTK_LAYOUT(layout)->bin_window); - gtk_widget_show (layout); - gtk_widget_show (vbox); - - gtk_widget_realize (window); -/* setBounds (window, x, y, width, height); */ - - connect_awt_hook (env, obj, 1, window->window); - set_visible (window, visible); -} - -/* - * Set a frame's title - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setTitle - (JNIEnv *env, jobject obj, jstring title) -{ - void *ptr; - const char *str; - - ptr = NSA_GET_PTR (env, obj); - - str = (*env)->GetStringUTFChars (env, title, NULL); - - gdk_threads_enter (); - gtk_window_set_title (GTK_WINDOW (ptr), str); - gdk_threads_leave (); - - (*env)->ReleaseStringUTFChars (env, title, str); -} - -/* - * Set a window's resizing policy - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setResizable - (JNIEnv *env, jobject obj, jboolean resize) -{ - void *ptr; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gtk_window_set_policy (GTK_WINDOW (ptr), resize, resize, 0); - gdk_threads_leave (); -} - - -/* - * Lower the z-level of a window. - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toBack (JNIEnv *env, - jobject obj) -{ - void *ptr; - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_window_lower (GTK_WIDGET (ptr)->window); - - XFlush (GDK_DISPLAY ()); - gdk_threads_leave (); -} - -/* - * Raise the z-level of a window. - */ - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkWindowPeer_toFront (JNIEnv *env, - jobject obj) -{ - void *ptr; - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - gdk_window_raise (GTK_WIDGET (ptr)->window); - - XFlush (GDK_DISPLAY ()); - gdk_threads_leave (); -} - -static void -setBounds (GtkWidget *widget, jint x, jint y, jint width, jint height) -{ - gint current_x, current_y; - gint origin_x, origin_y; - -/* gdk_window_get_root_origin (widget->window, ¤t_x, ¤t_y); */ - -/* if (current_x != x || current_y != y) */ -/* { */ -/* gdk_window_set_hints (widget->window, x, y, 0, 0, 0, 0, GDK_HINT_POS); */ -/* gdk_window_move (widget->window, x, y); */ -/* } */ - - gtk_widget_set_usize (widget, width, height); -} - -JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_setBounds - (JNIEnv *env, jobject obj, jint x, jint y, jint width, jint height) -{ - void *ptr; - GtkWidget *widget; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - - widget = GTK_WIDGET (ptr); - setBounds (widget, x, y, width, height); - - gdk_threads_leave (); -} - -JNIEXPORT void JNICALL -Java_gnu_java_awt_peer_gtk_GtkFramePeer_setMenuBarPeer - (JNIEnv *env, jobject obj, jobject menubar) -{ - void *wptr, *mptr; - GtkBox *box; - - if (!menubar) return; - - wptr = NSA_GET_PTR (env, obj); - mptr = NSA_GET_PTR (env, menubar); - - if (!mptr) return; /* this case should remove a menu */ - - gdk_threads_enter (); - box = GTK_BOX (GTK_BIN (wptr)->child); - gtk_box_pack_start (box, GTK_WIDGET (mptr), 0, 0, 0); - gdk_threads_leave (); -} - -JNIEXPORT jint JNICALL -Java_gnu_java_awt_peer_gtk_GtkFramePeer_getMenuBarHeight - (JNIEnv *env, jobject obj) -{ - void *ptr; - GList *children; - jint height = 0; - - ptr = NSA_GET_PTR (env, obj); - - gdk_threads_enter (); - children = gtk_container_children (GTK_CONTAINER (GTK_BIN (ptr)->child)); - if (g_list_length (children) == 2) - { - GtkWidget *menubar = GTK_WIDGET (children->data); - height = menubar->allocation.height; - - } - gdk_threads_leave (); - - return height; -} - - -void -gdk_window_get_root_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *border, - gint *depth) -{ - GdkWindowPrivate *private; - Window xwindow; - Window xparent; - Window root; - Window *children; - unsigned int nchildren; - - g_return_if_fail (window != NULL); - - private = (GdkWindowPrivate*) window; - if (x) - *x = 0; - if (y) - *y = 0; - if (width) - *width = 0; - if (height) - *height = 0; - if (border) - *border = 0; - if (depth) - *depth = 0; - - if (private->destroyed) - return; - - while (private->parent && ((GdkWindowPrivate*) private->parent)->parent) - private = (GdkWindowPrivate*) private->parent; - if (private->destroyed) - return; - - xparent = private->xwindow; - do - { - xwindow = xparent; - if (!XQueryTree (private->xdisplay, xwindow, - &root, &xparent, - &children, &nchildren)) - return; - - if (children) - XFree (children); - } - while (xparent != root); - - if (xparent == root) - { - unsigned int ww, wh, wb, wd; - int wx, wy; - - if (XGetGeometry (private->xdisplay, xwindow, &root, &wx, &wy, &ww, &wh, &wb, &wd)) - { - if (x) - *x = wx; - if (y) - *y = wy; - if (width) - *width = ww; - if (height) - *height = wh; - if (border) - *border = wb; - if (depth) - *depth = wd; - } - } -} - diff --git a/libjava/jni/gtk-peer/gthread-jni.c b/libjava/jni/gtk-peer/gthread-jni.c deleted file mode 100644 index 9409720f9ac..00000000000 --- a/libjava/jni/gtk-peer/gthread-jni.c +++ /dev/null @@ -1,169 +0,0 @@ -/* gthread-jni.c -- JNI threading routines for GLIB - Copyright (C) 1998 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include "gthread-jni.h" - -/* - * This code has been written specifically to be used with GTK+ 1.2. - * `Real' GLIB threading is not supported. We fake things where necessary. - * Once we know we're running on a 1.2 VM, we can write a real implementation. - */ - -static GMutex * -g_mutex_new_jni_impl (void) -{ - jclass obj_class; - jobject *mutex; - - obj_class = (*gdk_env)->FindClass (gdk_env, "java/lang/Object"); - if (obj_class == NULL) - return NULL; - - mutex = (jobject *) g_malloc (sizeof (jobject)); - *mutex = (*gdk_env)->AllocObject (gdk_env, obj_class); - if (*mutex == NULL) - { - g_free (mutex); - return NULL; - } - *mutex = (*gdk_env)->NewGlobalRef (gdk_env, *mutex); - - return (GMutex *) mutex; -} - -static void -g_mutex_lock_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) - (*gdk_env)->MonitorEnter (gdk_env, *((jobject *)mutex)); -} - -static gboolean -g_mutex_trylock_jni_impl (GMutex *mutex) -{ - return FALSE; -} - -static void -g_mutex_unlock_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) - (*gdk_env)->MonitorExit (gdk_env, *((jobject *)mutex)); -} - -static void -g_mutex_free_jni_impl (GMutex *mutex) -{ - if (mutex && mutex == gdk_threads_mutex) - { - (*gdk_env)->DeleteGlobalRef (gdk_env, *((jobject *)mutex)); - g_free (mutex); - } -} - -static GPrivate * -g_private_new_jni_impl (GDestroyNotify notify) -{ - return NULL; -} - -static gpointer -g_private_get_jni_impl (GPrivate *private) -{ - return NULL; -} - -static void -g_private_set_jni_impl (GPrivate *private, gpointer data) -{ -} - -static GCond * -g_cond_new_jni_impl () -{ - return NULL; -} - -static void -g_cond_signal_jni_impl (GCond *cond) -{ -} - -static void -g_cond_broadcast_jni_impl (GCond *cond) -{ -} - -static void -g_cond_wait_jni_impl (GCond *cond, GMutex *mutex) -{ -} - -static gboolean -g_cond_timed_wait_jni_impl (GCond *cond, GMutex *mutex) -{ - return FALSE; -} - -static void -g_cond_free_jni_impl (GCond *cond) -{ -} - -GThreadFunctions g_thread_jni_functions = -{ - g_mutex_new_jni_impl, /* mutex_new */ - g_mutex_lock_jni_impl, /* mutex_lock */ - g_mutex_trylock_jni_impl, /* mutex_try_lock */ - g_mutex_unlock_jni_impl, /* mutex_unlock */ - g_mutex_free_jni_impl, /* mutex_free */ - g_cond_new_jni_impl, /* cond_new */ - g_cond_signal_jni_impl, /* cond_signal */ - g_cond_broadcast_jni_impl, /* cond_broadcast */ - g_cond_wait_jni_impl, /* cond_wait */ - g_cond_timed_wait_jni_impl, /* cond_timed_wait */ - g_cond_free_jni_impl, /* cond_free */ - g_private_new_jni_impl, /* private_new */ - g_private_get_jni_impl, /* private_get */ - g_private_set_jni_impl /* private_set */ -}; - -void -gdk_threads_wake () -{ -} diff --git a/libjava/jni/gtk-peer/gthread-jni.h b/libjava/jni/gtk-peer/gthread-jni.h deleted file mode 100644 index 0bb5a56f1d8..00000000000 --- a/libjava/jni/gtk-peer/gthread-jni.h +++ /dev/null @@ -1,47 +0,0 @@ -/* gthread-jni.h - Copyright (C) 1998, 2002 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - -#ifndef __GTHREADJNI_H__ -#define __GTHREADJNI_H__ - -#include <jni.h> -#include <glib.h> -#include "gtkpeer.h" - -extern GThreadFunctions g_thread_jni_functions; - -#endif /* __GTHREADJNI_H__ */ diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h deleted file mode 100644 index fa1f19b5a1d..00000000000 --- a/libjava/jni/gtk-peer/gtkpeer.h +++ /dev/null @@ -1,299 +0,0 @@ -/* gtkpeer.h -- Some global variables and #defines - Copyright (C) 1998, 1999 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath 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, or (at your option) -any later version. - -GNU Classpath 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 GNU Classpath; see the file COPYING. If not, write to the -Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -02111-1307 USA. - -Linking this library statically or dynamically with other modules is -making a combined work based on this library. Thus, the terms and -conditions of the GNU General Public License cover the whole -combination. - -As a special exception, the copyright holders of this library give you -permission to link this library with independent modules to produce an -executable, regardless of the license terms of these independent -modules, and to copy and distribute the resulting executable under -terms of your choice, provided that you also meet, for each linked -independent module, the terms and conditions of the license of that -module. An independent module is a module which is not derived from -or based on this library. If you modify this library, you may extend -this exception to your version of the library, but you are not -obligated to do so. If you do not wish to do so, delete this -exception statement from your version. */ - - -#include <gtk/gtk.h> -#include <stdio.h> -#include <stdlib.h> -#include <string.h> -#include <config.h> -#include "native_state.h" - -#include <jni.h> - -#define RC_FILE ".classpath-gtkrc" -#define JVM_SUN -/* - #define JVM_JAPHAR -*/ - -#ifndef __GTKPEER_H__ -#define __GTKPEER_H__ - -#ifdef JVM_SUN - -extern struct state_table *native_state_table; - -#define NSA_INIT(env, clazz) \ - native_state_table = init_state_table (env, clazz) - -#define NSA_GET_PTR(env, obj) \ - get_state (env, obj, native_state_table) - -#define NSA_SET_PTR(env, obj, ptr) \ - set_state (env, obj, native_state_table, (void *)ptr) - -#define NSA_DEL_PTR(env, obj) \ - remove_state_slot (env, obj, native_state_table) - -#endif /* JVM_SUN */ - -struct graphics -{ - GdkDrawable *drawable; - GdkGC *gc; - GdkColormap *cm; - jint x_offset, y_offset; -}; - -#define AWT_DEFAULT_CURSOR 0 -#define AWT_CROSSHAIR_CURSOR 1 -#define AWT_TEXT_CURSOR 2 -#define AWT_WAIT_CURSOR 3 -#define AWT_SW_RESIZE_CURSOR 4 -#define AWT_SE_RESIZE_CURSOR 5 -#define AWT_NW_RESIZE_CURSOR 6 -#define AWT_NE_RESIZE_CURSOR 7 -#define AWT_N_RESIZE_CURSOR 8 -#define AWT_S_RESIZE_CURSOR 9 -#define AWT_W_RESIZE_CURSOR 10 -#define AWT_E_RESIZE_CURSOR 11 -#define AWT_HAND_CURSOR 12 -#define AWT_MOVE_CURSOR 13 - -#define SYNTHETIC_EVENT_MASK (1 << 10) - -#define AWT_SHIFT_MASK (1 << 0) -#define AWT_CTRL_MASK (1 << 1) -#define AWT_META_MASK (1 << 2) -#define AWT_ALT_MASK (1 << 3) - -#define AWT_BUTTON1_MASK (1 << 4) -#define AWT_BUTTON2_MASK AWT_ALT_MASK -#define AWT_BUTTON3_MASK AWT_META_MASK - -#define MULTI_CLICK_TIME 250 -/* as opposed to a MULTI_PASS_TIME :) */ - -#define AWT_MOUSE_CLICKED 500 -#define AWT_MOUSE_PRESSED 501 -#define AWT_MOUSE_RELEASED 502 -#define AWT_MOUSE_MOVED 503 -#define AWT_MOUSE_ENTERED 504 -#define AWT_MOUSE_EXITED 505 -#define AWT_MOUSE_DRAGGED 506 - -#define AWT_ADJUSTMENT_UNIT_INCREMENT 1 -#define AWT_ADJUSTMENT_UNIT_DECREMENT 2 -#define AWT_ADJUSTMENT_BLOCK_DECREMENT 3 -#define AWT_ADJUSTMENT_BLOCK_INCREMENT 4 -#define AWT_ADJUSTMENT_TRACK 5 - -#define AWT_SCROLLPANE_SCROLLBARS_AS_NEEDED 0 -#define AWT_SCROLLPANE_SCROLLBARS_ALWAYS 1 -#define AWT_SCROLLPANE_SCROLLBARS_NEVER 2 - -#define AWT_LABEL_LEFT 0 -#define AWT_LABEL_CENTER 1 -#define AWT_LABEL_RIGHT 2 - -#define AWT_TEXTAREA_SCROLLBARS_BOTH 0 -#define AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY 1 -#define AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY 2 - -#define AWT_ITEM_SELECTED 1 -#define AWT_ITEM_DESELECTED 2 - -#define AWT_KEY_TYPED 400 -#define AWT_KEY_PRESSED 401 -#define AWT_KEY_RELEASED 402 - -#define VK_UNDEFINED 0 -#define AWT_KEY_CHAR_UNDEFINED 0 - -#define VK_0 48 -#define VK_1 49 -#define VK_2 50 -#define VK_3 51 -#define VK_4 52 -#define VK_5 53 -#define VK_6 54 -#define VK_7 55 -#define VK_8 56 -#define VK_9 57 -#define VK_A 65 -#define VK_ACCEPT 30 -#define VK_ADD 107 -#define VK_ALT 18 -#define VK_B 66 -#define VK_BACK_QUOTE 192 -#define VK_BACK_SLASH 92 -#define VK_BACK_SPACE 8 -#define VK_C 67 -#define VK_CANCEL 3 -#define VK_CAPS_LOCK 20 -#define VK_CLEAR 12 -#define VK_CLOSE_BRACKET 93 -#define VK_COMMA 44 -#define VK_CONTROL 17 -#define VK_CONVERT 28 -#define VK_D 68 -#define VK_DECIMAL 110 -#define VK_DELETE 127 -#define VK_DIVIDE 111 -#define VK_DOWN 40 -#define VK_E 69 -#define VK_END 35 -#define VK_ENTER 10 -#define VK_ESCAPE 27 -#define VK_F 70 -#define VK_F1 112 -#define VK_F10 121 -#define VK_F11 122 -#define VK_F12 123 -#define VK_F2 113 -#define VK_F3 114 -#define VK_F4 115 -#define VK_F5 116 -#define VK_F6 117 -#define VK_F7 118 -#define VK_F8 119 -#define VK_F9 120 -#define VK_FINAL 24 -#define VK_G 71 -#define VK_H 72 -#define VK_HELP 156 -#define VK_HOME 36 -#define VK_I 73 -#define VK_INSERT 155 -#define VK_J 74 -#define VK_K 75 -#define VK_KANA 21 -#define VK_KANJI 25 -#define VK_L 76 -#define VK_LEFT 37 -#define VK_M 77 -#define VK_META 157 -#define VK_MODECHANGE 31 -#define VK_MULTIPLY 106 -#define VK_N 78 -#define VK_NONCONVERT 29 -#define VK_NUM_LOCK 144 -#define VK_NUMPAD0 96 -#define VK_NUMPAD1 97 -#define VK_NUMPAD2 98 -#define VK_NUMPAD3 99 -#define VK_NUMPAD4 100 -#define VK_NUMPAD5 101 -#define VK_NUMPAD6 102 -#define VK_NUMPAD7 103 -#define VK_NUMPAD8 104 -#define VK_NUMPAD9 105 -#define VK_O 79 -#define VK_OPEN_BRACKET 91 -#define VK_P 80 -#define VK_PAGE_DOWN 34 -#define VK_PAGE_UP 33 -#define VK_PAUSE 19 -#define VK_PERIOD 46 -#define VK_PRINTSCREEN 154 -#define VK_Q 81 -#define VK_QUOTE 222 -#define VK_R 82 -#define VK_RIGHT 39 -#define VK_S 83 -#define VK_SCROLL_LOCK 145 -#define VK_SEMICOLON 59 -#define VK_SEPARATOR 108 -#define VK_SHIFT 16 -#define VK_SLASH 47 -#define VK_SPACE 32 -#define VK_SUBTRACT 109 -#define VK_T 84 -#define VK_TAB 9 -#define VK_U 85 -#define VK_UP 38 -#define VK_V 86 -#define VK_W 87 -#define VK_X 88 -#define VK_Y 89 -#define VK_Z 90 - -#define AWT_FOCUS_LOST 1004 -#define AWT_FOCUS_GAINED 1005 - -extern jmethodID postActionEventID; -extern jmethodID postMenuActionEventID; -extern jmethodID postMouseEventID; -extern jmethodID postConfigureEventID; -extern jmethodID postExposeEventID; -extern jmethodID postKeyEventID; -extern jmethodID postFocusEventID; -extern jmethodID postAdjustmentEventID; -extern jmethodID postItemEventID; -extern jmethodID postListItemEventID; -extern jmethodID syncAttrsID; -extern jclass gdkColor; -extern jmethodID gdkColorID; -extern JNIEnv *gdk_env; - -void -gdk_window_get_root_geometry (GdkWindow *window, - gint *x, - gint *y, - gint *width, - gint *height, - gint *border, - gint *depth); - -void awt_event_handler (GdkEvent *event); - -void connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...); - -void set_visible (GtkWidget *widget, jboolean visible); -void set_parent (GtkWidget *widget, GtkContainer *parent); -GtkLayout *find_gtk_layout (GtkWidget *parent); -void setup_window (JNIEnv *env, jobject obj, GtkWidget *window, jint width, - jint height, jboolean visible); - -struct item_event_hook_info -{ - jobject peer_obj; - jobject item_obj; -}; - -#endif /* __GTKPEER_H */ |