ivtools-patch Mailing List for ivtools (Page 6)
Brought to you by:
johnston
You can subscribe to this list here.
| 1999 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2000 |
Jan
(17) |
Feb
(14) |
Mar
(7) |
Apr
(7) |
May
(20) |
Jun
(18) |
Jul
(5) |
Aug
(9) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(1) |
| 2001 |
Jan
(3) |
Feb
(2) |
Mar
(5) |
Apr
(7) |
May
(9) |
Jun
(15) |
Jul
(10) |
Aug
(2) |
Sep
(10) |
Oct
(15) |
Nov
(14) |
Dec
(2) |
| 2002 |
Jan
(8) |
Feb
(13) |
Mar
(10) |
Apr
(3) |
May
(2) |
Jun
(7) |
Jul
(5) |
Aug
(3) |
Sep
(1) |
Oct
(1) |
Nov
(10) |
Dec
|
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(3) |
| 2004 |
Jan
(2) |
Feb
(6) |
Mar
(1) |
Apr
(1) |
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2005 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(2) |
Oct
(4) |
Nov
(1) |
Dec
|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2008 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
(1) |
Jun
|
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
| 2010 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <ivt...@li...> - 2001-07-16 18:36:29
|
Patch: ivtools-010716-johnston-048 For: ivtools-0.9.4 Author: joh...@us... Subject: yet another tweak to configure socklen_t test Requires: This is an intermediate patch to ivtools-0.9.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - yet another tweak to configure socklen_t test Index: utils_ivtools/Imakefile diff -c utils_ivtools/Imakefile:1.2 utils_ivtools/Imakefile:1.3 *** utils_ivtools/Imakefile:1.2 Thu Jun 14 10:22:36 2001 --- src/utils/Imakefile Mon Jul 16 11:35:12 2001 *************** *** 44,50 **** CCSUFFIX = cc ! #define Obj(file) MakeObjectFromSrcFlags(file,) #if !LibStdCPlusPlusV3 Obj(downloader) --- 44,50 ---- CCSUFFIX = cc ! #define Obj(file) MakeObjectFromSrcFlags(file,-DSOCKLEN_T_DEFINED=$(SOCKLEN_T_DEFINED)) #if !LibStdCPlusPlusV3 Obj(downloader) *** /dev/null Mon Jul 16 11:35:17 PDT 2001 --- patches/ivtools-010716-johnston-048 *************** patches/ivtools-010716-johnston-048 *** 0 **** --- 1 ---- + ivtools-010716-johnston-048 |
|
From: <ivt...@li...> - 2001-07-16 18:29:17
|
Patch: ivtools-010716-johnston-047
For: ivtools-0.9.4
Author: joh...@us...
Subject: one more tweak to socklen_t configure test
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- one more tweak to socklen_t configure test
Index: top_ivtools/aclocal.m4
diff -c top_ivtools/aclocal.m4:1.5 top_ivtools/aclocal.m4:1.6
*** top_ivtools/aclocal.m4:1.5 Mon Jul 16 11:15:28 2001
--- ./aclocal.m4 Mon Jul 16 11:27:18 2001
***************
*** 45,52 ****
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
! [#include <sys/types.h>],
! [#include <sys/socket.h>],
[socklen_t len = 42; return len;],
ac_cv_type_socklen_t=YES,
ac_cv_type_socklen_t=NO)
--- 45,52 ----
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
! [#include <sys/types.h>
! #include <sys/socket.h>],
[socklen_t len = 42; return len;],
ac_cv_type_socklen_t=YES,
ac_cv_type_socklen_t=NO)
Index: top_ivtools/configure
diff -c top_ivtools/configure:1.7 top_ivtools/configure:1.8
*** top_ivtools/configure:1.7 Mon Jul 16 11:15:28 2001
--- ./configure Mon Jul 16 11:27:18 2001
***************
*** 1777,1794 ****
#line 1807 "configure"
#include "confdefs.h"
#include <sys/types.h>
- int main() {
#include <sys/socket.h>
; return 0; }
EOF
! if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
! socklen_t len = 42; return len;
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
! ac_cv_type_socklen_t=YES
fi
rm -f conftest*
--- 1777,1795 ----
#line 1807 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/socket.h>
+ int main() {
+ socklen_t len = 42; return len;
; return 0; }
EOF
! if { (eval echo configure:1815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
! ac_cv_type_socklen_t=YES
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
! ac_cv_type_socklen_t=NO
fi
rm -f conftest*
*** /dev/null Mon Jul 16 11:27:54 PDT 2001
--- patches/ivtools-010716-johnston-047
*************** patches/ivtools-010716-johnston-047
*** 0 ****
--- 1 ----
+ ivtools-010716-johnston-047
|
|
From: <ivt...@li...> - 2001-07-16 18:17:44
|
Patch: ivtools-010716-johnston-046
For: ivtools-0.9.4
Author: joh...@us...
Subject: better implementation of configure test for socklen_t
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- better implementation of configure test for socklen_t
Index: top_ivtools/aclocal.m4
diff -c top_ivtools/aclocal.m4:1.4 top_ivtools/aclocal.m4:1.5
*** top_ivtools/aclocal.m4:1.4 Mon Jul 9 17:13:34 2001
--- ./aclocal.m4 Mon Jul 16 11:15:28 2001
***************
*** 45,50 ****
--- 45,51 ----
[AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
[
AC_TRY_COMPILE(
+ [#include <sys/types.h>],
[#include <sys/socket.h>],
[socklen_t len = 42; return len;],
ac_cv_type_socklen_t=YES,
Index: top_ivtools/configure
diff -c top_ivtools/configure:1.6 top_ivtools/configure:1.7
*** top_ivtools/configure:1.6 Mon Jul 9 17:13:34 2001
--- ./configure Mon Jul 16 11:15:28 2001
***************
*** 28,35 ****
ac_help="$ac_help
--with-iue-libs=<path> path to compiled IUE libs"
ac_help="$ac_help
- --with-x use the X Window System"
- ac_help="$ac_help
--enable-install-relative[=ARG] enable installation relative to the source tree"
ac_help="$ac_help
--enable-use-rpath[=ARG] enable use of -rpath when linking"
--- 28,33 ----
***************
*** 170,202 ****
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
- [same as prefix]
- --bindir=DIR user executables in DIR [EPREFIX/bin]
- --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
- --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
- --datadir=DIR read-only architecture-independent data in DIR
- [PREFIX/share]
- --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
- --sharedstatedir=DIR modifiable architecture-independent data in DIR
- [PREFIX/com]
- --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
- --libdir=DIR object code libraries in DIR [EPREFIX/lib]
- --includedir=DIR C header files in DIR [PREFIX/include]
- --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
- --infodir=DIR info documentation in DIR [PREFIX/info]
- --mandir=DIR man documentation in DIR [PREFIX/man]
- --srcdir=DIR find the sources in DIR [configure dir or ..]
- --program-prefix=PREFIX prepend PREFIX to installed program names
- --program-suffix=SUFFIX append SUFFIX to installed program names
- --program-transform-name=PROGRAM
- run sed PROGRAM on installed program names
- EOF
- cat << EOF
- Host type:
- --build=BUILD configure for building on BUILD [BUILD=HOST]
- --host=HOST configure for HOST [guessed]
- --target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--- 168,173 ----
***************
*** 1805,1823 ****
cat > conftest.$ac_ext <<EOF
#line 1807 "configure"
#include "confdefs.h"
! #include <sys/socket.h>
int main() {
! socklen_t len = 42; return len;
; return 0; }
EOF
if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
! ac_cv_type_socklen_t=YES
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
! ac_cv_type_socklen_t=NO
fi
rm -f conftest*
--- 1776,1794 ----
cat > conftest.$ac_ext <<EOF
#line 1807 "configure"
#include "confdefs.h"
! #include <sys/types.h>
int main() {
! #include <sys/socket.h>
; return 0; }
EOF
if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
! socklen_t len = 42; return len;
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
! ac_cv_type_socklen_t=YES
fi
rm -f conftest*
Index: utils_ivtools/sockets.h
diff -c utils_ivtools/sockets.h:1.2 utils_ivtools/sockets.h:1.3
*** utils_ivtools/sockets.h:1.2 Mon Jul 9 17:14:06 2001
--- src/utils/sockets.h Mon Jul 16 11:15:36 2001
***************
*** 41,47 ****
#include "thrower.h"
const int DownLoadAmount = 1024; // Amount per socket read.
! #if !defined(_typedef_socklen_t_) || !_typedef_socklen_t
typedef int socklen_t;
#endif
--- 41,47 ----
#include "thrower.h"
const int DownLoadAmount = 1024; // Amount per socket read.
! #if !defined(SOCKLEN_T_DEFINED) || !SOCKLEN_T_DEFINED
typedef int socklen_t;
#endif
Index: config_ivtools/config.defs.in
diff -c config_ivtools/config.defs.in:1.6 config_ivtools/config.defs.in:1.7
*** config_ivtools/config.defs.in:1.6 Mon Jul 9 17:14:10 2001
--- config/config.defs.in Mon Jul 16 11:15:38 2001
***************
*** 50,57 ****
#undef LibStdCPlusPlusV3
#define LibStdCPlusPlusV3 @LIBSTDCPLUSPLUS3@
! #undef _typedef_socklen_t_
! #define _typedef_socklen_t_ @ac_cv_type_socklen_t@
#undef InstallRelative
#define InstallRelative @INSTALLRELATIVE@
--- 50,57 ----
#undef LibStdCPlusPlusV3
#define LibStdCPlusPlusV3 @LIBSTDCPLUSPLUS3@
! #undef Typedef_socklen_t
! #define Typedef_socklen_t @ac_cv_type_socklen_t@
#undef InstallRelative
#define InstallRelative @INSTALLRELATIVE@
Index: config_ivtools/params.def
diff -c config_ivtools/params.def:1.7 config_ivtools/params.def:1.8
*** config_ivtools/params.def:1.7 Wed Jun 20 14:01:59 2001
--- config/params.def Mon Jul 16 11:15:38 2001
***************
*** 1277,1279 ****
--- 1277,1284 ----
XLIBDIR = XLibDir /* installed X libraries */
PSFONTDIR = PSFontDir /* installed PS font metrics (afm) */
+ #if defined(Typedef_socklen_t)&&!Typedef_socklen_t
+ SOCKLEN_T_DEFINED = NO
+ #else
+ SOCKLEN_T_DEFINED = YES
+ #endif
*** /dev/null Mon Jul 16 11:15:39 PDT 2001
--- patches/ivtools-010716-johnston-046
*************** patches/ivtools-010716-johnston-046
*** 0 ****
--- 1 ----
+ ivtools-010716-johnston-046
|
|
From: <ivt...@li...> - 2001-07-16 17:16:19
|
Patch: ivtools-010716-johnston-045 For: ivtools-0.9.4 Author: joh...@us... Subject: add -c to every install for the benefit of BSD Requires: This is an intermediate patch to ivtools-0.9.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - add a -c argument (copy instead of move) to every install command for the benefit of the BSD's. Index: include_interviews/Imakefile diff -c include_interviews/Imakefile:1.1 include_interviews/Imakefile:1.2 *** include_interviews/Imakefile:1.1 Thu Jan 4 15:33:34 2001 --- src/include/InterViews/Imakefile Mon Jul 16 10:14:15 2001 *************** *** 10,15 **** XCOMM install:: XCOMM MakeDir($(INCDIR)/InterViews) ! XCOMM $(INSTALL) $(INSTINCFLAGS) *.h $(INCDIR)/IInterViews --- 10,15 ---- XCOMM install:: XCOMM MakeDir($(INCDIR)/InterViews) ! XCOMM $(INSTALL) -c $(INSTINCFLAGS) *.h $(INCDIR)/IInterViews Index: config_ivtools/Imakefile diff -c config_ivtools/Imakefile:1.1 config_ivtools/Imakefile:1.2 *** config_ivtools/Imakefile:1.1 Thu Jan 4 15:34:05 2001 --- config/Imakefile Mon Jul 16 10:14:18 2001 *************** *** 12,18 **** #if !InstallRelative install:: MakeDir($(CONFIGDIR)) ! $(INSTALL) $(INSTINCFLAGS) *.def* template *.mk $(CONFIGDIR) uninstall:: (cd $(CONFIGDIR);$(RM) *.def* template *.mk) --- 12,18 ---- #if !InstallRelative install:: MakeDir($(CONFIGDIR)) ! $(INSTALL) -c $(INSTINCFLAGS) *.def* template *.mk $(CONFIGDIR) uninstall:: (cd $(CONFIGDIR);$(RM) *.def* template *.mk) Index: config_ivtools/rules.def diff -c config_ivtools/rules.def:1.4 config_ivtools/rules.def:1.5 *** config_ivtools/rules.def:1.4 Tue Mar 27 11:08:20 2001 --- config/rules.def Mon Jul 16 10:14:19 2001 *************** *** 1064,1070 **** #define InstallIncludes(dir) @@\ install:: @@\ MakeDir($(INCDIR)/dir) @@\ ! $(INSTALL) $(INSTINCFLAGS) *.h $(INCDIR)/dir @@\ @@\ uninstall:: @@\ (cd $(INCDIR)/dir;$(RM) *.h) --- 1064,1070 ---- #define InstallIncludes(dir) @@\ install:: @@\ MakeDir($(INCDIR)/dir) @@\ ! $(INSTALL) -c $(INSTINCFLAGS) *.h $(INCDIR)/dir @@\ @@\ uninstall:: @@\ (cd $(INCDIR)/dir;$(RM) *.h) *************** *** 1081,1087 **** #define InstallInclude(dir, file) @@\ install:: @@\ MakeDir($(INCDIR)/dir) @@\ ! $(INSTALL) $(INSTINCFLAGS) file $(INCDIR)/dir @@\ @@\ uninstall:: @@\ $(RM) $(INCDIR)/dir/file --- 1081,1087 ---- #define InstallInclude(dir, file) @@\ install:: @@\ MakeDir($(INCDIR)/dir) @@\ ! $(INSTALL) -c $(INSTINCFLAGS) file $(INCDIR)/dir @@\ @@\ uninstall:: @@\ $(RM) $(INCDIR)/dir/file Index: config_iv/Imakefile diff -c config_iv/Imakefile:1.1 config_iv/Imakefile:1.2 *** config_iv/Imakefile:1.1 Thu Jan 4 15:34:07 2001 --- config/InterViews/Imakefile Mon Jul 16 10:14:20 2001 *************** *** 9,15 **** #if !InstallRelative install:: MakeDir($(CONFIGDIR)/InterViews) ! $(INSTALL) $(INSTINCFLAGS) *.cf $(CONFIGDIR)/InterViews uninstall:: (cd $(CONFIGDIR)/InterViews; $(RM) *.cf) --- 9,15 ---- #if !InstallRelative install:: MakeDir($(CONFIGDIR)/InterViews) ! $(INSTALL) -c $(INSTINCFLAGS) *.cf $(CONFIGDIR)/InterViews uninstall:: (cd $(CONFIGDIR)/InterViews; $(RM) *.cf) *** /dev/null Mon Jul 16 10:14:21 PDT 2001 --- patches/ivtools-010716-johnston-045 *************** patches/ivtools-010716-johnston-045 *** 0 **** --- 1 ---- + ivtools-010716-johnston-045 |
|
From: <ivt...@li...> - 2001-07-11 23:49:30
|
Patch: ivtools-010711-johnston-044
For: ivtools-0.9.4
Author: joh...@us...
Subject: fix detection of availability of X11 shared memory extension
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- fix the test for whether the X11 Shared Memory extensions exists in
the server, and whether it can be utilized (which requires co-resident
client and server).
Index: src_x11/xraster.c
diff -c src_x11/xraster.c:1.1 src_x11/xraster.c:1.2
*** src_x11/xraster.c:1.1 Thu Jan 4 15:31:53 2001
--- src/IV-X11/xraster.c Wed Jul 11 16:47:36 2001
***************
*** 186,192 ****
XDisplay* dpy = dr->display_;
int i;
! shared_memory = XShmQueryVersion(dpy, &i, &i, &i) ? true : false;
if (shared_memory) {
image = XShmCreateImage(
--- 186,192 ----
XDisplay* dpy = dr->display_;
int i;
! shared_memory = XShmQueryExtension(dpy) ? true : false;
if (shared_memory) {
image = XShmCreateImage(
*** /dev/null Wed Jul 11 16:47:51 PDT 2001
--- patches/ivtools-010711-johnston-044
*************** patches/ivtools-010711-johnston-044
*** 0 ****
--- 1 ----
+ ivtools-010711-johnston-044
|
|
From: <ivt...@li...> - 2001-07-11 23:25:50
|
Patch: ivtools-010711-johnston-043
For: ivtools-0.9.4
Author: joh...@us...
Subject: touchups for compiling on FREEBSD with ACE and gcc-2.7.2
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- touchups for compiling on FREEBSD with ACE and gcc-2.7.2
Index: top_ivtools/INSTALL
diff -c top_ivtools/INSTALL:1.7 top_ivtools/INSTALL:1.8
*** top_ivtools/INSTALL:1.7 Wed Jun 20 14:01:26 2001
--- ./INSTALL Wed Jul 11 16:24:12 2001
***************
*** 17,30 ****
probably would gcc-2.7.2. You will also need an equivalent copy of
libstdc++. The libstdc++ version numbers stay roughly in synch with
the gcc version numbers. If you have gcc-2.8.1 you'd want
! libstdc++-2.8.1, etc..
! Versions more recent than gcc-2.95.? are not approved by the gcc
! steering committee at this date. But attempts have been made to get
! everything compiled with the forthcoming gcc-3.0 if you want to try it
! out.
!
! Also be aware that sometimes the include files for libstdc++ are in
/usr/local/include/g++-2, a place that cannot be auto-determined by
the configure script. Establishing a symbolic link to
/usr/local/include/g++ will fix the problem.
--- 17,25 ----
probably would gcc-2.7.2. You will also need an equivalent copy of
libstdc++. The libstdc++ version numbers stay roughly in synch with
the gcc version numbers. If you have gcc-2.8.1 you'd want
! libstdc++-2.8.1, etc.. libstdc++ comes bundled with gcc-3.0.
! Be aware that sometimes the include files for libstdc++ are in
/usr/local/include/g++-2, a place that cannot be auto-determined by
the configure script. Establishing a symbolic link to
/usr/local/include/g++ will fix the problem.
Index: ComTerp/comhandler.c
diff -c ComTerp/comhandler.c:1.4 ComTerp/comhandler.c:1.5
*** ComTerp/comhandler.c:1.4 Tue Jul 3 17:01:13 2001
--- src/ComTerp/comhandler.c Wed Jul 11 16:24:14 2001
***************
*** 28,34 ****
--- 28,37 ----
#include <ComTerp/comterpserv.h>
#include <iostream.h>
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ #else
#include <vector.h>
+ #endif
#if BUFSIZ>1024
#undef BUFSIZ
***************
*** 141,147 ****
--- 144,155 ----
int
ComterpHandler::handle_input (ACE_HANDLE fd)
{
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ char inv[BUFSIZ];
+ int inv_cnt = 0;
+ #else
vector<char> inv;
+ #endif
char ch;
#if __GNUG__<3
***************
*** 149,158 ****
istream istr(&ibuf);
// problem handling new-lines embedded in character strings
while(istr.good() && istr.get(ch),ch!='\n'&&ch!='\0')
inv.push_back(ch);
inv.push_back('\0');
! char* inbuf = &inv[0];
boolean input_good = istr.good();
#else
--- 157,171 ----
istream istr(&ibuf);
// problem handling new-lines embedded in character strings
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ while(istr.good() && istr.get(ch),ch!='\n'&&ch!='\0' && inv_cnt<BUFSIZ-1)
+ inv[inv_cnt++] = ch;
+ inv[inv_cnt++] = '\0';
+ #else
while(istr.good() && istr.get(ch),ch!='\n'&&ch!='\0')
inv.push_back(ch);
inv.push_back('\0');
! #endif
boolean input_good = istr.good();
#else
Index: ComTerp/debugfunc.c
diff -c ComTerp/debugfunc.c:1.4 ComTerp/debugfunc.c:1.5
*** ComTerp/debugfunc.c:1.4 Tue Jul 3 17:01:13 2001
--- src/ComTerp/debugfunc.c Wed Jul 11 16:24:14 2001
***************
*** 25,31 ****
--- 25,34 ----
#include <ComTerp/debugfunc.h>
#include <ComTerp/comterpserv.h>
#include <strstream.h>
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ #else
#include <vector.h>
+ #endif
#if __GNUG__>=3
#include <fstream.h>
#endif
***************
*** 107,122 ****
--- 110,142 ----
? comterp()->handler()->wrfptr() : stdout, ios_base::out);
#endif
ostream out(&fbufout);
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ char cvect[BUFSIZ];
+ int cvect_cnt = 0;
+ #else
vector<char> cvect;
+ #endif
ComValue retval;
do {
char ch;
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
+ cvect[0] = '\0';
+ #else
cvect.erase(cvect.begin(), cvect.end());
+ #endif
/* need to handle embedded newlines differently */
+ #if __GNUC__==2 && __GNUC_MINOR__<=7
do {
ch = in.get();
+ cvect[cvect_cnt++] = ch;
+ } while (in.good() && ch != '\n' && cvect_cnt<BUFSIZ-1);
+ cvect[cvect_cnt]='\0';
+ #else
+ do {
+ ch = in.get();
cvect.push_back(ch);
} while (in.good() && ch != '\n');
+ #endif
if (cvect[0] != '\n') {
if (comterpserv()) {
retval.assignval(comterpserv()->run(&cvect[0]));
*** /dev/null Wed Jul 11 16:24:28 PDT 2001
--- patches/ivtools-010711-johnston-043
*************** patches/ivtools-010711-johnston-043
*** 0 ****
--- 1 ----
+ ivtools-010711-johnston-043
|
|
From: <ivt...@li...> - 2001-07-10 00:20:01
|
Patch: ivtools-010709-johnston-042
For: ivtools-0.9.4
Author: joh...@us...
Subject: built-in support for PNG rasters, FreeBSD configure work
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- adds built-in support for PNG rasters. That means they can be
imported and save/restored by pathname (like JPEG and GIF). This
requires that pngtopnm be available to be invoked by the ivtools
drawing editors.
- added test for whether socklen_t is typedef'ed to the configure
script. Seems FreeBSD doesn't have this.
Index: top_ivtools/aclocal.m4
diff -c top_ivtools/aclocal.m4:1.3 top_ivtools/aclocal.m4:1.4
*** top_ivtools/aclocal.m4:1.3 Thu Jun 14 10:21:14 2001
--- ./aclocal.m4 Mon Jul 9 17:13:34 2001
***************
*** 40,42 ****
--- 40,57 ----
AC_MSG_RESULT(${CXX_INCLUDE_DIR})
AC_SUBST(CXX_INCLUDE_DIR)
])dnl
+
+ AC_DEFUN(AC_TYPE_SOCKLEN_T,
+ [AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
+ [
+ AC_TRY_COMPILE(
+ [#include <sys/socket.h>],
+ [socklen_t len = 42; return len;],
+ ac_cv_type_socklen_t=YES,
+ ac_cv_type_socklen_t=NO)
+ ])
+ if test $ac_cv_type_socklen_t != yes; then
+ AC_DEFINE(socklen_t, int)
+ fi
+ ])
+
Index: top_ivtools/configure
diff -c top_ivtools/configure:1.5 top_ivtools/configure:1.6
*** top_ivtools/configure:1.5 Thu Jun 14 10:21:14 2001
--- ./configure Mon Jul 9 17:13:34 2001
***************
*** 28,33 ****
--- 28,35 ----
ac_help="$ac_help
--with-iue-libs=<path> path to compiled IUE libs"
ac_help="$ac_help
+ --with-x use the X Window System"
+ ac_help="$ac_help
--enable-install-relative[=ARG] enable installation relative to the source tree"
ac_help="$ac_help
--enable-use-rpath[=ARG] enable use of -rpath when linking"
***************
*** 168,173 ****
--- 170,202 ----
Directory and file names:
--prefix=PREFIX install architecture-independent files in PREFIX
[$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [same as prefix]
+ --bindir=DIR user executables in DIR [EPREFIX/bin]
+ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin]
+ --libexecdir=DIR program executables in DIR [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data in DIR
+ [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data in DIR
+ [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var]
+ --libdir=DIR object code libraries in DIR [EPREFIX/lib]
+ --includedir=DIR C header files in DIR [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include]
+ --infodir=DIR info documentation in DIR [PREFIX/info]
+ --mandir=DIR man documentation in DIR [PREFIX/man]
+ --srcdir=DIR find the sources in DIR [configure dir or ..]
+ --program-prefix=PREFIX prepend PREFIX to installed program names
+ --program-suffix=SUFFIX append SUFFIX to installed program names
+ --program-transform-name=PROGRAM
+ run sed PROGRAM on installed program names
+ EOF
+ cat << EOF
+ Host type:
+ --build=BUILD configure for building on BUILD [BUILD=HOST]
+ --host=HOST configure for HOST [guessed]
+ --target=TARGET configure for TARGET [TARGET=HOST]
Features and packages:
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
***************
*** 1767,1773 ****
--- 1796,1838 ----
# AC_TRY_RUN(int access(); int main() { return access("/bin/bash", 1); },BIN_BASH=1,BIN_BASH=0,BIN_BASH=1)
+ echo $ac_n "checking for socklen_t""... $ac_c" 1>&6
+ echo "configure:1801: checking for socklen_t" >&5
+ if eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+
+ cat > conftest.$ac_ext <<EOF
+ #line 1807 "configure"
+ #include "confdefs.h"
+ #include <sys/socket.h>
+ int main() {
+ socklen_t len = 42; return len;
+ ; return 0; }
+ EOF
+ if { (eval echo configure:1814: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_type_socklen_t=YES
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_type_socklen_t=NO
+ fi
+ rm -f conftest*
+ fi
+
+ echo "$ac_t""$ac_cv_type_socklen_t" 1>&6
+ if test $ac_cv_type_socklen_t != yes; then
+ cat >> confdefs.h <<\EOF
+ #define socklen_t int
+ EOF
+
+ fi
+
+
+
#AC_SUBST(OPENGL)
#AC_SUBST(XGL)
#AC_SUBST(TCL)
***************
*** 1802,1807 ****
--- 1867,1873 ----
#AC_SUBST(BIN_BASH)
+
#output to config-$host_fragd
PWD=`pwd`; export PWD
trap '' 1 2 15
***************
*** 1983,1988 ****
--- 2049,2055 ----
s%@INSTALLRELATIVE@%$INSTALLRELATIVE%g
s%@USERPATH@%$USERPATH%g
s%@INSTALLSUBDIR@%$INSTALLSUBDIR%g
+ s%@ac_cv_type_socklen_t@%$ac_cv_type_socklen_t%g
CEOF
EOF
Index: top_ivtools/configure.in
diff -c top_ivtools/configure.in:1.5 top_ivtools/configure.in:1.6
*** top_ivtools/configure.in:1.5 Thu Jun 14 10:21:14 2001
--- ./configure.in Mon Jul 9 17:13:34 2001
***************
*** 292,297 ****
--- 292,299 ----
# AC_TRY_RUN(int access(); int main() { return access("/bin/bash", 1); },BIN_BASH=1,BIN_BASH=0,BIN_BASH=1)
+ AC_TYPE_SOCKLEN_T
+
AC_SUBST(prefix)
#AC_SUBST(OPENGL)
#AC_SUBST(XGL)
***************
*** 326,331 ****
--- 328,334 ----
AC_SUBST(USERPATH)
AC_SUBST(INSTALLSUBDIR)
#AC_SUBST(BIN_BASH)
+ AC_SUBST(ac_cv_type_socklen_t)
#output to config-$host_fragd
PWD=`pwd`; export PWD
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.11 OverlayUnidraw/ovimport.c:1.12
*** OverlayUnidraw/ovimport.c:1.11 Tue Jul 3 17:01:32 2001
--- src/OverlayUnidraw/ovimport.c Mon Jul 9 17:13:55 2001
***************
*** 807,812 ****
--- 807,815 ----
else if (CheckMagicBytes(JPEG_MAGIC_BYTES, line))
strncpy(creator, "JPEG", creator_size);
+ else if (strncmp(line, "\211PNG", 4)==0)
+ strncpy(creator, "PNG", creator_size);
+
/* One-byte Magic numbers */
else {
switch (line[0]) {
***************
*** 932,937 ****
--- 935,943 ----
else if (CheckMagicBytes(JPEG_MAGIC_BYTES, line))
strncpy(creator, "JPEG", creator_size);
+ else if (strncmp(line, "\211PNG", 4)==0)
+ strncpy(creator, "PNG", creator_size);
+
/* One-byte Magic numbers */
else {
switch (line[0]) {
***************
*** 1646,1652 ****
--- 1652,1684 ----
} else
cerr << "djpeg or stdcmapppm not found\n";
+ } else if (strncmp(creator, "PNG", 3)==0) {
+ if (OverlayKit::bincheck("pngtopnm")) {
+ if (pathname && !return_fd) {
+ char buffer[BUFSIZ];
+ if (compressed)
+ sprintf(buffer, "gzip -c %s | pngtopnm", pathname);
+ else
+ sprintf(buffer, "pngtopnm %s", pathname);
+ FILE* pptr = popen(buffer, "r");
+ if (pptr) {
+ cerr << "input opened with " << buffer << "\n";
+ #if __GNUG__<3
+ ifstream new_in;
+ new_in.rdbuf()->attach(fileno(pptr));
+ #else
+ filebuf fbuf(pptr, ios_base::in);
+ istream new_in(&fbuf);
+ #endif
+ comp = PNM_Image(new_in);
+ pclose(pptr);
+ }
+ } else
+ comp = PNM_Image_Filter(*in, return_fd, pnmfd, "pngtopnm");
+ } else
+ cerr << "pngtopnm not found\n";
}
+
if (comp && comp->IsA(OVRASTER_COMP))
((RasterOvComp*)comp)->SetByPathnameFlag(false);
Index: OverlayUnidraw/ovimport.h
diff -c OverlayUnidraw/ovimport.h:1.1 OverlayUnidraw/ovimport.h:1.2
*** OverlayUnidraw/ovimport.h:1.1 Thu Jan 4 15:33:06 2001
--- src/OverlayUnidraw/ovimport.h Mon Jul 9 17:13:55 2001
***************
*** 172,184 ****
static const char* ReadCreator(const char* pathname);
// read creator from 'pathname', returning one of "COMPRESS", "GZIP",
// "TIFF", "SUN", "PBM", "PGM", "PPM", "PBMA", "PGMA", "PPMA", "JPEG",
! // "BM", "ATK", "MP", "X11", "PCX", "IFF", "GIF", "RLE", "idraw", or
! // something else for arbitrary "PostScript".
static const char* ReadCreator(istream& in, FileType& type);
// read creator from istream, returning one of "COMPRESS", "GZIP",
// "TIFF", "SUN", "PBM", "PGM", "PPM", "PBMA", "PGMA", "PPMA", "JPEG",
! // "BM", "ATK", "MP", "X11", "PCX", "IFF", "GIF", "RLE", "idraw", or
! // something else for arbitrary "PostScript", plus a FileType enum.
// The bytes read to determine the creator are pushed back onto
// the istream.
--- 172,184 ----
static const char* ReadCreator(const char* pathname);
// read creator from 'pathname', returning one of "COMPRESS", "GZIP",
// "TIFF", "SUN", "PBM", "PGM", "PPM", "PBMA", "PGMA", "PPMA", "JPEG",
! // "BM", "ATK", "MP", "X11", "PCX", "IFF", "GIF", "RLE", "PNG", "idraw",
! // or something else for arbitrary "PostScript".
static const char* ReadCreator(istream& in, FileType& type);
// read creator from istream, returning one of "COMPRESS", "GZIP",
// "TIFF", "SUN", "PBM", "PGM", "PPM", "PBMA", "PGMA", "PPMA", "JPEG",
! // "BM", "ATK", "MP", "X11", "PCX", "IFF", "GIF", "RLE", "PNG", "idraw",
! // or something else for arbitrary "PostScript", plus a FileType enum.
// The bytes read to determine the creator are pushed back onto
// the istream.
Index: OverlayUnidraw/ovraster.c
diff -c OverlayUnidraw/ovraster.c:1.6 OverlayUnidraw/ovraster.c:1.7
*** OverlayUnidraw/ovraster.c:1.6 Fri Jun 15 15:44:34 2001
--- src/OverlayUnidraw/ovraster.c Mon Jul 9 17:13:55 2001
***************
*** 586,592 ****
} else if (!urlflag && strcmp(creator, "PPM") == 0) {
ovraster = OvImportCmd::PPM_Raster(pathname, delayed);
} else if (!urlflag &&
! (strcmp(creator, "JPEG") == 0 || strcmp(creator, "GIF")==0)) {
OvImportCmd importcmd((Editor*)nil);
OverlayComp* tempcomp = (OverlayComp*)importcmd.Import(pathname);
if (tempcomp && tempcomp->IsA(OVRASTER_COMP)) {
--- 586,593 ----
} else if (!urlflag && strcmp(creator, "PPM") == 0) {
ovraster = OvImportCmd::PPM_Raster(pathname, delayed);
} else if (!urlflag &&
! (strcmp(creator, "JPEG") == 0 || strcmp(creator, "GIF")==0 ||
! strcmp(creator, "PNG")==0)) {
OvImportCmd importcmd((Editor*)nil);
OverlayComp* tempcomp = (OverlayComp*)importcmd.Import(pathname);
if (tempcomp && tempcomp->IsA(OVRASTER_COMP)) {
***************
*** 1773,1779 ****
if (byte > max) byte = max;
#if 0
unsigned int ival =
! (unsigned int)Math::Math::round(pow( mingray, ((n - byte) / float(n) ) ) * float(n));
#else
double val = (byte-((double)min)) / nvals * (e - 1.0) + 1.0;
unsigned int ival = (unsigned int) (log(val)*n);
--- 1774,1780 ----
if (byte > max) byte = max;
#if 0
unsigned int ival =
! (unsigned int)Math::round(pow( mingray, ((n - byte) / float(n) ) ) * float(n));
#else
double val = (byte-((double)min)) / nvals * (e - 1.0) + 1.0;
unsigned int ival = (unsigned int) (log(val)*n);
***************
*** 1885,1892 ****
}
}
! width = Math::Math::round(fw);
! height = Math::Math::round(fh);
}
--- 1886,1893 ----
}
}
! width = Math::round(fw);
! height = Math::round(fh);
}
Index: OverlayUnidraw/ovstencil.c
diff -c OverlayUnidraw/ovstencil.c:1.1 OverlayUnidraw/ovstencil.c:1.2
*** OverlayUnidraw/ovstencil.c:1.1 Thu Jan 4 15:33:06 2001
--- src/OverlayUnidraw/ovstencil.c Mon Jul 9 17:13:55 2001
***************
*** 288,294 ****
else if (urlflag ||
strcmp(creator, "JPEG") == 0 ||
! strcmp(creator, "GIF")==0) {
OvImportCmd importcmd((Editor*)nil);
OverlayComp* tempcomp = (OverlayComp*)importcmd.Import(pathname);
if (tempcomp && tempcomp->IsA(OVSTENCIL_COMP)) {
--- 288,295 ----
else if (urlflag ||
strcmp(creator, "JPEG") == 0 ||
! strcmp(creator, "GIF") == 0 ||
! strcmp(creator, "PNG")==0) {
OvImportCmd importcmd((Editor*)nil);
OverlayComp* tempcomp = (OverlayComp*)importcmd.Import(pathname);
if (tempcomp && tempcomp->IsA(OVSTENCIL_COMP)) {
Index: utils_ivtools/sockets.h
diff -c utils_ivtools/sockets.h:1.1 utils_ivtools/sockets.h:1.2
*** utils_ivtools/sockets.h:1.1 Thu Jan 4 15:33:51 2001
--- src/utils/sockets.h Mon Jul 9 17:14:06 2001
***************
*** 41,46 ****
--- 41,50 ----
#include "thrower.h"
const int DownLoadAmount = 1024; // Amount per socket read.
+ #if !defined(_typedef_socklen_t_) || !_typedef_socklen_t
+ typedef int socklen_t;
+ #endif
+
// Perhaps.. a value of 0 allows the system to choose a port.
const int ListenPort = 20003; // Port for receiving FTP data.
Index: config_ivtools/config.defs.in
diff -c config_ivtools/config.defs.in:1.5 config_ivtools/config.defs.in:1.6
*** config_ivtools/config.defs.in:1.5 Thu Jun 14 10:22:41 2001
--- config/config.defs.in Mon Jul 9 17:14:10 2001
***************
*** 50,55 ****
--- 50,58 ----
#undef LibStdCPlusPlusV3
#define LibStdCPlusPlusV3 @LIBSTDCPLUSPLUS3@
+ #undef _typedef_socklen_t_
+ #define _typedef_socklen_t_ @ac_cv_type_socklen_t@
+
#undef InstallRelative
#define InstallRelative @INSTALLRELATIVE@
*** /dev/null Mon Jul 9 17:14:12 PDT 2001
--- patches/ivtools-010709-johnston-042
*************** patches/ivtools-010709-johnston-042
*** 0 ****
--- 1 ----
+ ivtools-010709-johnston-042
|
|
From: <ivt...@li...> - 2001-07-04 00:12:55
|
Patch: ivtools-010703-johnston-040
For: ivtools-0.9.4
Author: joh...@us...
Subject: final mods required by conjunction of ACE and gcc-3.0
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- all the necessary changes to support ACE and gcc-3.0 at the same
time. The majority of the work is in deferring (or avoiding) an
fclose on a fdopen'ed socket, by a) saving a FILE* in some class to be
fclose'd later, or b) rewriting without iostreams. Now there should
no longer be any dangling FILE*'s to worry about.
Index: ComTerp/comhandler.c
diff -c ComTerp/comhandler.c:1.3 ComTerp/comhandler.c:1.4
*** ComTerp/comhandler.c:1.3 Wed Jun 20 14:01:30 2001
--- src/ComTerp/comhandler.c Tue Jul 3 17:01:13 2001
***************
*** 47,52 ****
--- 47,53 ----
comterp_->handler(this);
comterp_->add_defaults();
_timeoutscriptid = -1;
+ _wrfptr = _rdfptr = nil;
}
ComterpHandler::~ComterpHandler() {
***************
*** 89,94 ****
--- 90,103 ----
if (_timeoutscriptid<0)
delete comterp_;
else /* timer could be still running */;
+ if (_wrfptr) {
+ fclose(_wrfptr);
+ _wrfptr = nil;
+ }
+ if (_rdfptr) {
+ fclose(_rdfptr);
+ _rdfptr = nil;
+ }
}
int
***************
*** 148,153 ****
--- 157,165 ----
boolean input_good = istr.good();
#else
+ if (!_wrfptr) _wrfptr = fdopen(fd, "w");
+ if (!_rdfptr) _rdfptr = fdopen(fd, "r");
+
ch = '\0';
int status;
while (ch != '\n') {
***************
*** 171,182 ****
ostr.flush();
return 0;
#else
! FILE* ofptr = nil;
! filebuf obuf(fd ? ofptr = fdopen(fd, "w") : stdout, ios_base::out);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
- if (ofptr&&0) fclose(ofptr);
return 0;
#endif
}
--- 183,192 ----
ostr.flush();
return 0;
#else
! filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
return 0;
#endif
}
***************
*** 198,209 ****
ostr << "\n";
ostr.flush();
#else
! FILE* ofptr = nil;
! filebuf obuf(fd ? fdopen(fd, "w") : stdout, ios_base::out);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
- if (ofptr&&0) fclose(ofptr);
#endif
return (input_good && inbuf[0]!='\004') ? 0 : -1;
}
--- 208,217 ----
ostr << "\n";
ostr.flush();
#else
! filebuf obuf(fd ? wrfptr() : stdout, ios_base::out);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
#endif
return (input_good && inbuf[0]!='\004') ? 0 : -1;
}
Index: ComTerp/comhandler.h
diff -c ComTerp/comhandler.h:1.4 ComTerp/comhandler.h:1.5
*** ComTerp/comhandler.h:1.4 Fri Apr 27 15:06:16 2001
--- src/ComTerp/comhandler.h Tue Jul 3 17:01:13 2001
***************
*** 86,91 ****
--- 86,97 ----
static int logger_mode() { return _logger_mode; }
// return flag that indicates comterp is in logging-only mode
+ FILE* wrfptr() { return _wrfptr; }
+ // file pointer for writing to handle
+
+ FILE* rdfptr() { return _rdfptr; }
+ // file pointer for reading from handle
+
protected:
// = Demultiplexing hooks.
virtual int handle_input (ACE_HANDLE);
***************
*** 105,110 ****
--- 111,122 ----
int _seconds;
// timeout in seconds
+
+ FILE* _wrfptr;
+ // file pointer for writing to handle
+
+ FILE* _rdfptr;
+ // file pointer for reading from handle
static int _logger_mode;
// mode for logging commands: 0 = no log, 1 = log only
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.5 ComTerp/comterp.c:1.6
*** ComTerp/comterp.c:1.5 Thu Jun 14 13:09:34 2001
--- src/ComTerp/comterp.c Tue Jul 3 17:01:13 2001
***************
*** 262,269 ****
filebuf fbufout;
fbufout.attach(handler() ? Math::max(1, handler()->get_handle()) : fileno(stdout));
#else
! FILE* ofptr = handler() ? fdopen(Math::max(1, handler()->get_handle()), "w") : stdout;
! filebuf fbufout(ofptr, ios_base::out);
#endif
ostream out(&fbufout);
out << ">>> " << *func << "(" << *func->funcstate() << ")\n";
--- 262,270 ----
filebuf fbufout;
fbufout.attach(handler() ? Math::max(1, handler()->get_handle()) : fileno(stdout));
#else
! filebuf fbufout(handler() && handler()->wrfptr()
! ? handler()->wrfptr() : stdout,
! ios_base::out);
#endif
ostream out(&fbufout);
out << ">>> " << *func << "(" << *func->funcstate() << ")\n";
***************
*** 274,283 ****
stepfunc->execute();
stepfunc->pop_funcstate();
pop_stack();
- #if __GNUG__>=3
- if (handler())
- fclose(ofptr);
- #endif
}
func->execute();
--- 275,280 ----
***************
*** 813,822 ****
} else
fbuf.attach(fileno(stdout));
#else
! FILE* ofptr = nil;
! filebuf fbuf(handler()
! ? (ofptr = fdopen(Math::max(1, handler()->get_handle()), "w"))
! : stdout,
ios_base::out);
#endif
ostream out(&fbuf);
--- 810,817 ----
} else
fbuf.attach(fileno(stdout));
#else
! filebuf fbuf(handler() && handler()->wrfptr()
! ? handler()->wrfptr() : stdout,
ios_base::out);
#endif
ostream out(&fbuf);
***************
*** 861,869 ****
}
if (status==1 && _pfnum==0) status=2;
if (nested && status!=2) _stack_top--;
- #if __GNUG__>3
- if (ofptr) fclose(ofptr);
- #endif
return status;
}
--- 856,861 ----
Index: ComTerp/comterpserv.c
diff -c ComTerp/comterpserv.c:1.3 ComTerp/comterpserv.c:1.4
*** ComTerp/comterpserv.c:1.3 Tue Jun 19 11:24:47 2001
--- src/ComTerp/comterpserv.c Tue Jul 3 17:01:13 2001
***************
*** 154,161 ****
in.gets(&instr);
#else
char instr[BUFSIZ];
! FILE* ifptr = fdopen(fd, "r");
! filebuf fbuf(ifptr, ios_base::in);
istream in (&fbuf);
in.get(instr, BUFSIZ); // needs to be generalized with <vector.h>
in.get(newline);
--- 154,160 ----
in.gets(&instr);
#else
char instr[BUFSIZ];
! filebuf fbuf(server->_fptr, ios_base::in);
istream in (&fbuf);
in.get(instr, BUFSIZ); // needs to be generalized with <vector.h>
in.get(newline);
***************
*** 181,190 ****
/* append a null byte */
outstr[outpos] = '\0';
- #if __GNUG__>=3
- if (ifptr) fclose(ifptr);
- #endif
-
return s;
}
--- 180,185 ----
***************
*** 199,215 ****
filebuf fbuf;
fbuf.attach(fd);
#else
! FILE* ofptr = fdopen(fd, "w");
! filebuf fbuf(ofptr, ios_base::out);
#endif
ostream out(&fbuf);
for (; outpos < bufsize-1 && s[outpos]; outpos++)
out.put(s[outpos]);
out.flush();
outpos = 0;
- #if __GNUG__>=3
- if (ofptr) fclose(ofptr);
- #endif
return 1;
}
--- 194,206 ----
filebuf fbuf;
fbuf.attach(fd);
#else
! filebuf fbuf(server->_fptr, ios_base::out);
#endif
ostream out(&fbuf);
for (; outpos < bufsize-1 && s[outpos]; outpos++)
out.put(s[outpos]);
out.flush();
outpos = 0;
return 1;
}
***************
*** 315,328 ****
#if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
#else
! FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
! filebuf obuf(ofptr, ios_base::out);
#endif
ostream ostr(&obuf);
ostr.flush();
- #if __GNUG__>=3
- if (ofptr) fclose(ofptr);
- #endif
status = -1;
} else if (quitflag()) {
status = 1;
--- 306,317 ----
#if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
#else
! filebuf obuf(handler() && handler()->wrfptr()
! ? handler()->wrfptr() : stdout,
! ios_base::out);
#endif
ostream ostr(&obuf);
ostr.flush();
status = -1;
} else if (quitflag()) {
status = 1;
***************
*** 336,349 ****
#if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
#else
! FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
! filebuf obuf(ofptr, ios_base::out);
#endif
ostream ostr(&obuf);
ostr.flush();
- #if __GNUG__>=3
- if (ofptr) fclose(ofptr);
- #endif
status = -1;
}
}
--- 325,336 ----
#if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
#else
! filebuf obuf(handler() && handler()->wrfptr()
! ? handler()->wrfptr() : stdout,
! ios_base::out);
#endif
ostream ostr(&obuf);
ostr.flush();
status = -1;
}
}
Index: ComTerp/ctrlfunc.c
diff -c ComTerp/ctrlfunc.c:1.2 ComTerp/ctrlfunc.c:1.3
*** ComTerp/ctrlfunc.c:1.2 Tue Jun 19 11:24:47 2001
--- src/ComTerp/ctrlfunc.c Tue Jul 3 17:01:13 2001
***************
*** 144,160 ****
filebuf ofbuf;
ofbuf.attach(socket.get_handle());
#else
! FILE* ofptr = fdopen(socket.get_handle(), "w");
! filebuf ofbuf(ofptr, ios_base::out);
#endif
ostream out(&ofbuf);
const char* cmdstr = cmdstrv.string_ptr();
out << cmdstr;
if (cmdstr[strlen(cmdstr)-1] != '\n') out << "\n";
out.flush();
- #if __GNUG__>=3
- fclose(ofptr);
- #endif
if (nowaitv.is_false()) {
#if __GNUG__<3
filebuf ifbuf;
--- 144,157 ----
filebuf ofbuf;
ofbuf.attach(socket.get_handle());
#else
! filebuf ofbuf(comterp()->handler() && comterp()->handler()->wrfptr()
! ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
#endif
ostream out(&ofbuf);
const char* cmdstr = cmdstrv.string_ptr();
out << cmdstr;
if (cmdstr[strlen(cmdstr)-1] != '\n') out << "\n";
out.flush();
if (nowaitv.is_false()) {
#if __GNUG__<3
filebuf ifbuf;
***************
*** 163,175 ****
char* buf;
in.gets(&buf);
#else
! FILE* ifptr = fdopen(socket.get_handle(), "r");
! filebuf ifbuf(ifptr, ios_base::in);
istream in(&ifbuf);
char buf[BUFSIZ];
in.get(buf, BUFSIZ);
in.get(newline);
- fclose(ifptr);
#endif
ComValue& retval = comterpserv()->run(buf, true);
push_stack(retval);
--- 160,170 ----
char* buf;
in.gets(&buf);
#else
! filebuf ifbuf(comterp()->handler()->rdfptr(), ios_base::in);
istream in(&ifbuf);
char buf[BUFSIZ];
in.get(buf, BUFSIZ);
in.get(newline);
#endif
ComValue& retval = comterpserv()->run(buf, true);
push_stack(retval);
Index: ComTerp/debugfunc.c
diff -c ComTerp/debugfunc.c:1.3 ComTerp/debugfunc.c:1.4
*** ComTerp/debugfunc.c:1.3 Thu Jun 14 10:21:26 2001
--- src/ComTerp/debugfunc.c Tue Jul 3 17:01:13 2001
***************
*** 91,102 ****
} else
fbufin.attach(fileno(stdin));
#else
! FILE* ifptr;
! if (comterp()->handler())
! ifptr = fdopen(max(0, comterp()->handler()->get_handle()), "r");
! else
! ifptr = stdin;
! filebuf fbufin(ifptr, ios_base::in);
#endif
istream in(&fbufin);
#if __GNUG__<3
--- 91,98 ----
} else
fbufin.attach(fileno(stdin));
#else
! filebuf fbufin(comterp() && comterp()->handler() && comterp()->handler()->rdfptr()
! ? comterp()->handler()->rdfptr() : stdin, ios_base::in);
#endif
istream in(&fbufin);
#if __GNUG__<3
***************
*** 107,118 ****
} else
fbufout.attach(fileno(stdout));
#else
! FILE* ofptr;
! if (comterp()->handler())
! ofptr = fdopen(max(1, comterp()->handler()->get_handle()), "w");
! else
! ofptr = stdout;
! filebuf fbufout(ofptr, ios_base::out);
#endif
ostream out(&fbufout);
vector<char> cvect;
--- 103,110 ----
} else
fbufout.attach(fileno(stdout));
#else
! filebuf fbufout(comterp()->handler() && comterp()->handler()->wrfptr()
! ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
#endif
ostream out(&fbufout);
vector<char> cvect;
***************
*** 140,151 ****
sbuf_e.put('\0');
cerr << sbuf_e.str();
push_stack(retval);
- #if __GNUG__>=3
- if (comterp()->handler()) {
- fclose(ifptr);
- fclose(ofptr);
- }
- #endif
}
void ComterpPauseFunc::execute() {
--- 132,137 ----
Index: ComTerp/helpfunc.c
diff -c ComTerp/helpfunc.c:1.5 ComTerp/helpfunc.c:1.6
*** ComTerp/helpfunc.c:1.5 Wed Jun 20 14:01:30 2001
--- src/ComTerp/helpfunc.c Tue Jul 3 17:01:13 2001
***************
*** 130,138 ****
ostream outs( comterp()->handler() ? ((streambuf*)&fbuf) : (streambuf*)&sbuf );
ostream *out = &outs;
#else
! ofdstream fdout(Math::max(1, comterp()->handler() ? comterp()->handler()->get_handle() : 0));
! ostream outs((streambuf*)&sbuf);
! ostream* out = comterp()->handler() ? &fdout : &outs;
#endif
if (noargs) {
--- 130,139 ----
ostream outs( comterp()->handler() ? ((streambuf*)&fbuf) : (streambuf*)&sbuf );
ostream *out = &outs;
#else
! filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
! ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
! ostream outs(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf);
! ostream *out = &outs;
#endif
if (noargs) {
Index: ComTerp/iofunc.c
diff -c ComTerp/iofunc.c:1.3 ComTerp/iofunc.c:1.4
*** ComTerp/iofunc.c:1.3 Thu Jun 14 13:01:04 2001
--- src/ComTerp/iofunc.c Tue Jul 3 17:01:13 2001
***************
*** 75,87 ****
}
#else
streambuf* strmbuf = nil;
- FILE* ofptr = nil;
if (stringflag.is_false() && strflag.is_false() &&
symbolflag.is_false() && symflag.is_false()) {
filebuf * fbuf = nil;
if (comterp()->handler()) {
! int fd = Math::max(1, comterp()->handler()->get_handle());
! fbuf = new filebuf(ofptr = fdopen(fd, "w"), ios_base::out);
} else
fbuf = new filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
strmbuf = fbuf;
--- 75,86 ----
}
#else
streambuf* strmbuf = nil;
if (stringflag.is_false() && strflag.is_false() &&
symbolflag.is_false() && symflag.is_false()) {
filebuf * fbuf = nil;
if (comterp()->handler()) {
! fbuf = new filebuf(comterp()->handler() && comterp()->handler()->wrfptr()
! ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
} else
fbuf = new filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
strmbuf = fbuf;
***************
*** 186,193 ****
push_stack(retval);
}
delete strmbuf;
- #if __GNUG__>=3
- if (ofptr) fclose(ofptr);
- #endif
}
--- 185,189 ----
Index: ComTerp/postfunc.c
diff -c ComTerp/postfunc.c:1.3 ComTerp/postfunc.c:1.4
*** ComTerp/postfunc.c:1.3 Thu Jun 14 13:01:04 2001
--- src/ComTerp/postfunc.c Tue Jul 3 17:01:13 2001
***************
*** 53,63 ****
} else
fbuf.attach(fileno(stdout));
#else
! FILE* ofptr = nil;
! filebuf fbuf(comterp()->handler()
! ? (ofptr=fdopen(Math::max(1, comterp()->handler()->get_handle()), "w"))
! : stdout,
! ios_base::out);
#endif
ostream out(&fbuf);
--- 53,60 ----
} else
fbuf.attach(fileno(stdout));
#else
! filebuf fbuf(comterp()->handler() && comterp()->handler()->wrfptr()
! ? comterp()->handler()->wrfptr() : stdout, ios_base::out);
#endif
ostream out(&fbuf);
***************
*** 85,93 ****
}
comterp()->brief(oldbrief);
reset_stack();
- #if __GNUG__>=3
- if (ofptr) fclose(ofptr);
- #endif
}
/*****************************************************************************/
--- 82,87 ----
Index: OverlayUnidraw/aceimport.c
diff -c OverlayUnidraw/aceimport.c:1.2 OverlayUnidraw/aceimport.c:1.3
*** OverlayUnidraw/aceimport.c:1.2 Wed Jun 20 14:01:47 2001
--- src/OverlayUnidraw/aceimport.c Tue Jul 3 17:01:32 2001
***************
*** 44,49 ****
--- 44,50 ----
_import_cmd = new OvImportCmd(unidraw->GetEditor(i), &ImportChooser::instance());
_inptr = nil;
_filebuf = nil;
+ _infptr = nil;
}
void
***************
*** 54,59 ****
--- 55,64 ----
IMPORT_REACTOR::instance ()->cancel_timer (this);
#endif
this->peer ().close ();
+ if (_infptr) {
+ fclose(_infptr);
+ _infptr = nil;
+ }
}
int
***************
*** 87,94 ****
filebuf fbuf;
if(fbuf.attach(fd)==0) return -1;
#else
! FILE* ifptr = nil;
! filebuf fbuf(ifptr = fdopen(fd, "r"), ios_base::in);
#endif
istream in(&fbuf);
int ch = in.get();
--- 92,99 ----
filebuf fbuf;
if(fbuf.attach(fd)==0) return -1;
#else
! if (!_infptr) _infptr = fdopen(fd, "r");
! filebuf fbuf(_infptr, ios_base::in);
#endif
istream in(&fbuf);
int ch = in.get();
***************
*** 97,105 ****
_import_cmd->instream(&in);
_import_cmd->Execute();
}
- #if __GNUG__>=3
- fclose(ifptr);
- #endif
return -1; /* only return -1, which indicates input handling is fini */
#endif
}
--- 102,107 ----
Index: OverlayUnidraw/aceimport.h
diff -c OverlayUnidraw/aceimport.h:1.3 OverlayUnidraw/aceimport.h:1.4
*** OverlayUnidraw/aceimport.h:1.3 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/aceimport.h Tue Jul 3 17:01:32 2001
***************
*** 70,75 ****
--- 70,76 ----
OvImportCmd* _import_cmd; // associated import command
filebuf* _filebuf; // associated input buffer
istream* _inptr; // associated input stream
+ FILE* _infptr; // associated FILE*
};
//: a Reactor Singleton.
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.10 OverlayUnidraw/ovimport.c:1.11
*** OverlayUnidraw/ovimport.c:1.10 Tue Jun 19 11:24:57 2001
--- src/OverlayUnidraw/ovimport.c Tue Jul 3 17:01:32 2001
***************
*** 616,624 ****
GraphicComp* comp = OvImportCmd::DoImport(
*ifs, empty, _helper, _ed, true, _path, newfd
);
- #if __GNUG__>=3
- if (ifptr) fclose(ifptr);
- #endif
#if defined(OPEN_DRAWTOOL_URL)
if (comp && comp->IsA(OVERLAY_IDRAW_COMP)) {
--- 616,621 ----
***************
*** 1451,1456 ****
--- 1448,1455 ----
GraphicComp* comp = nil;
pnmfd = -1;
OverlayCatalog* catalog = (OverlayCatalog*)unidraw->GetCatalog();
+ static boolean dithermap_flag = catalog->GetAttribute("dithermap") &&
+ strcmp(catalog->GetAttribute("dithermap"),"false")!=0;
int len = 255;
char buf[len];
***************
*** 1525,1533 ****
if (pathname && !return_fd) {
char buffer[BUFSIZ];
if (compressed)
! sprintf(buffer, "gzip -c %s | pstoedit -f idraw", pathname);
else
! sprintf(buffer, "pstoedit -f idraw %s", pathname);
pptr = popen(buffer, "r");
cerr << "input opened with " << buffer << "\n";
if (pptr)
--- 1524,1532 ----
if (pathname && !return_fd) {
char buffer[BUFSIZ];
if (compressed)
! sprintf(buffer, "gzip -c %s | pstoedit -f idraw", pathname, "%d");
else
! sprintf(buffer, "pstoedit -f idraw %s", pathname, "%d");
pptr = popen(buffer, "r");
cerr << "input opened with " << buffer << "\n";
if (pptr)
***************
*** 1539,1552 ****
new_in.rdbuf()->attach(new_fd);
#else
FILE* ifptr = fdopen(new_fd, "r");
filebuf fbuf(ifptr, ios_base::in);
istream new_in(&fbuf);
#endif
comp = catalog->ReadPostScript(new_in);
if (pptr) pclose(pptr);
- #if __GNUG__>=3
- if (ifptr) fclose(ifptr);
- #endif
} else
cerr << "pstoedit not found\n";
}
--- 1538,1549 ----
new_in.rdbuf()->attach(new_fd);
#else
FILE* ifptr = fdopen(new_fd, "r");
+ helper.add_file(ifptr);
filebuf fbuf(ifptr, ios_base::in);
istream new_in(&fbuf);
#endif
comp = catalog->ReadPostScript(new_in);
if (pptr) pclose(pptr);
} else
cerr << "pstoedit not found\n";
}
***************
*** 1615,1631 ****
if (pathname && !return_fd) {
char buffer[BUFSIZ];
! #if 0
! if (compressed)
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;gzip -c %s | djpeg -map $cm -dither fs -pnm;rm $cm", pathname);
! else
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;djpeg -map $cm -dither fs -pnm %s;rm $cm", pathname);
! #else
! if (compressed)
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;gzip -c %s | djpeg -pnm;rm $cm", pathname);
! else
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;djpeg -pnm %s;rm $cm", pathname);
! #endif
FILE* pptr = popen(buffer, "r");
helper.add_pipe(pptr);
if (pptr) {
--- 1612,1628 ----
if (pathname && !return_fd) {
char buffer[BUFSIZ];
! if (dithermap_flag) {
! if (compressed)
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;gzip -c %s | djpeg -map $cm -dither fs -pnm;rm $cm", pathname);
! else
! sprintf(buffer, "cm=`ivtmpnam`;stdcmapppm>$cm;djpeg -map $cm -dither fs -pnm %s;rm $cm", pathname);
! } else {
! if (compressed)
! sprintf(buffer, "gzip -c %s | djpeg -pnm", pathname);
! else
! sprintf(buffer, "djpeg -pnm %s", pathname);
! }
FILE* pptr = popen(buffer, "r");
helper.add_pipe(pptr);
if (pptr) {
***************
*** 1640,1647 ****
helper.add_stream(new_in);
comp = PNM_Image(*new_in);
}
! } else
! comp = PNM_Image_Filter(*in, return_fd, pnmfd, "cm=`ivtmpnam`;stdcmapppm>$cm;djpeg -map $cm -dither fs -pnm;rm $cm");
} else
cerr << "djpeg or stdcmapppm not found\n";
--- 1637,1648 ----
helper.add_stream(new_in);
comp = PNM_Image(*new_in);
}
! } else {
! if (dithermap_flag)
! comp = PNM_Image_Filter(*in, return_fd, pnmfd, "cm=`ivtmpnam`;stdcmapppm>$cm;djpeg -map $cm -dither fs -pnm;rm $cm");
! else
! comp = PNM_Image_Filter(*in, return_fd, pnmfd, "djpeg -pnm");
! }
} else
cerr << "djpeg or stdcmapppm not found\n";
***************
*** 2404,2421 ****
ifstream in2;
in2.rdbuf()->attach(outfd);
#else
! FILE* outfptr = fdopen(outfd, "w");
! filebuf fbuf(outfptr, ios_base::out);
istream in2(&fbuf);
#endif
comp = PNM_Image(in2);
- #if __GNUG__>=3
- fclose(outfptr);
- #endif
if(close(outfd)==-1)
cerr << "error in parent closing last end of the pipes\n";
}
return comp;
--- 2405,2422 ----
ifstream in2;
in2.rdbuf()->attach(outfd);
#else
! FILE* infptr = fdopen(outfd, "r");
! filebuf fbuf(infptr, ios_base::in);
istream in2(&fbuf);
#endif
comp = PNM_Image(in2);
if(close(outfd)==-1)
cerr << "error in parent closing last end of the pipes\n";
+ #if __GNUG__>=3
+ if (infptr) fclose(infptr);
+ #endif
}
return comp;
***************
*** 2480,2490 ****
#if __GNUG__<3
ofstream out;
out.rdbuf()->attach(pipe1[1]);
- #else
- FILE* ofptr = fdopen(pipe1[1], "w");
- filebuf fbuf(ofptr, ios_base::out);
- ostream out(&fbuf);
- #endif
char buffer[BUFSIZ];
while (!in.eof() && in.good()) {
in.read(buffer, BUFSIZ);
--- 2481,2486 ----
***************
*** 2492,2499 ****
out.write(buffer, in.gcount());
}
out.flush();
! #if __GNUG__>=3
! fclose(ofptr);
#endif
if(close(pipe1[1])==-1)
cerr << "error in child closing its output pipe\n";
--- 2488,2500 ----
out.write(buffer, in.gcount());
}
out.flush();
! #else
! char buffer[BUFSIZ];
! while (!in.eof() && in.good()) {
! in.read(buffer, BUFSIZ);
! if (!in.eof() || in.gcount())
! write(pipe1[1], buffer, in.gcount());
! }
#endif
if(close(pipe1[1])==-1)
cerr << "error in child closing its output pipe\n";
Index: drawtool/main.c
diff -c drawtool/main.c:1.2 drawtool/main.c:1.3
*** drawtool/main.c:1.2 Tue May 15 14:56:37 2001
--- src/drawtool/main.c Tue Jul 3 17:01:35 2001
***************
*** 158,163 ****
--- 158,164 ----
{ "*zoomer_off", "false" },
{ "*opaque_off", "false" },
{ "*ptrloc", "false" },
+ { "*dithermap", "false" },
#ifdef HAVE_ACE
{ "*import", "20001" },
#endif
***************
*** 192,197 ****
--- 193,199 ----
{ "-opaque_off", "*opaque_off", OptionValueImplicit, "true" },
{ "-opoff", "*opaque_off", OptionValueImplicit, "true" },
{ "-ptrloc", "*ptrloc", OptionValueImplicit, "true" },
+ { "-dithermap", "*dithermap", OptionValueImplicit, "true" },
#ifdef HAVE_ACE
{ "-import", "*import", OptionValueNext },
#endif
***************
*** 201,209 ****
};
static char* usage =
! "Usage: drawtool [any idraw parameter] [-color5] [-gray5] [-gray6] [-gray7] \n\
! [-nocolor6] [-opaque_off|-opoff] [-pagecols|-ncols n] [-pagerows|-nrows n] \n\
! [-panner_align|-pal tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
[-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] \n\
[-slider_off|-soff] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
--- 203,211 ----
};
static char* usage =
! "Usage: drawtool [any idraw parameter] [-color5] [-dithermap] [-gray5] [-gray6] \n\
! [-gray7] [-nocolor6] [-opaque_off|-opoff] [-pagecols|-ncols n] \n\
! [-pagerows|-nrows n] [-panner_align|-pal tl|tc|tr|cl|c|cr|cl|bl|br|l|r|t|b|hc|vc] \n\
[-panner_off|-poff] [-ptrloc] [-scribble_pointer|-scrpt ] \n\
[-slider_off|-soff] [-toolbarloc|-tbl r|l ] [-zoomer_off|-zoff] [file]";
Index: ComUnidraw/unifunc.c
diff -c ComUnidraw/unifunc.c:1.11 ComUnidraw/unifunc.c:1.12
*** ComUnidraw/unifunc.c:1.11 Wed Jun 20 14:01:50 2001
--- src/ComUnidraw/unifunc.c Tue Jul 3 17:01:36 2001
***************
*** 457,463 ****
ACE_ERROR ((LM_ERROR, "%p\n", "open"));
pfbuf = new filebuf(ofptr = fdopen(socket->get_handle(), "r"), output);
} else if (comterp()->handler() && comterp()->handler()->get_handle()>-1) {
! pfbuf = new filebuf(ofptr = fdopen(comterp()->handler()->get_handle(), "r"), output);
} else
#endif
pfbuf = new filebuf(stdout, output);
--- 457,463 ----
ACE_ERROR ((LM_ERROR, "%p\n", "open"));
pfbuf = new filebuf(ofptr = fdopen(socket->get_handle(), "r"), output);
} else if (comterp()->handler() && comterp()->handler()->get_handle()>-1) {
! pfbuf = new filebuf(comterp()->handler()->rdfptr(), output);
} else
#endif
pfbuf = new filebuf(stdout, output);
***************
*** 535,541 ****
delete out;
#if __GNUG__>=3
- if (ofptr) fclose(ofptr);
delete pfbuf;
#endif
--- 535,540 ----
Index: include_std/iostream.h
diff -c include_std/iostream.h:1.1 include_std/iostream.h:1.2
*** include_std/iostream.h:1.1 Wed Jun 20 14:12:11 2001
--- src/include/ivstd/iostream.h Tue Jul 3 17:01:46 2001
***************
*** 3,8 ****
--- 3,9 ----
#include_next <iostream.h>
#if __GNUG__>=3
+ #if 0
#include <unistd.h>
// from a posting to lib...@gc... by Carlo Wood
***************
*** 40,45 ****
--- 41,47 ----
ofdstream(int fd) : std::ostream(&M_fdbuf), M_fdbuf(fd) { }
fdbuf* rdbuf(void) const { return &M_fdbuf; }
};
+ #endif
#endif
#endif
*** /dev/null Tue Jul 3 17:01:51 PDT 2001
--- patches/ivtools-010703-johnston-040
*************** patches/ivtools-010703-johnston-040
*** 0 ****
--- 1 ----
+ ivtools-010703-johnston-040
|
|
From: <ivt...@li...> - 2001-06-20 21:15:03
|
Patch: ivtools-010620-johnston-039
For: ivtools-0.9.4
Author: joh...@us...
Subject: add the iostream.h stub that contains fdbuf/ofdstream
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- add the iostream.h stub that contains the fdbuf and ofdstream
classes for an ostream accessed by file descriptor.
Index: top_ivtools/MANIFEST
diff -c top_ivtools/MANIFEST:1.6 top_ivtools/MANIFEST:1.7
*** top_ivtools/MANIFEST:1.6 Fri Jun 15 16:24:50 2001
--- ./MANIFEST Wed Jun 20 14:12:01 2001
***************
*** 1537,1542 ****
--- 1537,1543 ----
ivtools-0.9/src/include/ivstd/Makefile
ivtools-0.9/src/include/ivstd/fstream.h
ivtools-0.9/src/include/ivstd/iosfwd
+ ivtools-0.9/src/include/ivstd/iostream.h
ivtools-0.9/src/include/ivstd/math.h
ivtools-0.9/src/include/ivstd/nan.h
ivtools-0.9/src/include/ivstd/osfcn.h
Index: include_std/iostream.h
diff -c /dev/null include_std/iostream.h:1.1
*** /dev/null Wed Jun 20 14:12:12 2001
--- src/include/ivstd/iostream.h Wed Jun 20 14:12:11 2001
***************
*** 0 ****
--- 1,45 ----
+ #ifndef _iv_iostream_h_
+ #define _iv_iostream_h_
+ #include_next <iostream.h>
+
+ #if __GNUG__>=3
+ #include <unistd.h>
+
+ // from a posting to lib...@gc... by Carlo Wood
+ // Quick and dirty unbuffered file descriptor streambuf.
+ class fdbuf : public std::basic_streambuf<char, std::char_traits<char> > {
+ public:
+ typedef std::char_traits<char> traits_type;
+ typedef traits_type::int_type int_type;
+ private:
+ int M_fd;
+ public:
+ fdbuf(int fd) : M_fd(fd) { }
+ protected:
+ virtual int_type overflow(int_type c = traits_type::eof())
+ {
+ if (!traits_type::eq_int_type(c, traits_type::eof()))
+ {
+ char cp[1];
+ *cp = c;
+ if (write(M_fd, cp, 1) != 1)
+ return traits_type::eof();
+ }
+ return 0;
+ }
+ // This would be needed if it was buffered.
+ // virtual std::streamsize xsputn(char const* s, std::streamsize num) { return write(M_fd, s, num); }
+ };
+
+ // Unbuffered file descriptor stream.
+ class ofdstream : public std::ostream {
+ private:
+ mutable fdbuf M_fdbuf;
+ public:
+ explicit
+ ofdstream(int fd) : std::ostream(&M_fdbuf), M_fdbuf(fd) { }
+ fdbuf* rdbuf(void) const { return &M_fdbuf; }
+ };
+ #endif
+
+ #endif
*** /dev/null Wed Jun 20 14:12:14 PDT 2001
--- patches/ivtools-010620-johnston-039
*************** patches/ivtools-010620-johnston-039
*** 0 ****
--- 1 ----
+ ivtools-010620-johnston-039
|
|
From: <ivt...@li...> - 2001-06-20 21:11:55
|
Patch: ivtools-010620-johnston-038 For: ivtools-0.9.4 Author: joh...@us... Subject: more ACE/gcc-3.0 hacking Requires: This is an intermediate patch to ivtools-0.9.4. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - more work on getting ivtools compiled, linked, and working in the face of ACE and gcc-3.0 - the good news is I've been able to compile ACE from source myself for the first time in over two years (and have it work with ivtools). The secret was to build without thread support. - the bad news is that the iostreams of libstdc++ v3 are not socket-happy. I inserted a quick-and-dirty ostream derivative that seems to work for the most part, and used it one place for now. The problem with that class is one use of ostream::put shuts down subsequent output. As for istream's, it looks like the simplest solution will be to rewrite them all with straight file descriptors accessed via read(2). All of this confusion stemmed from Microsoft's decision to treat socket handles and file handles differently. So to be "portable" the ANSI C++ standard refused to use anything but pathnames for constructing an istream or ostream. How you open a socket with a pathname, I don't know. For now I'm taking a break from all this, and waiting to see how a relevant discussion evolves on lib...@gc.... Maybe I'll get my filebuf::attach after all. Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.6 top_ivtools/INSTALL:1.7 *** top_ivtools/INSTALL:1.6 Fri Jun 15 16:24:50 2001 --- ./INSTALL Wed Jun 20 14:01:26 2001 *************** *** 59,75 **** http://www.cs.wustl.edu/%7Eschmidt/ACE.html ! We are currently using ACE-5.1 on Debian 2.4 (sid -- libace5.1-dev). ! With g++ in considerable flux it is currently problematic to build ACE ! from source yourself (so that it works with ivtools), so you might ! want to consider skipping this library if you are not using Debian. ! Hopefully these problems will go away once the migration to gcc-3.0 is ! done. 0.f if you want to build the ivxt example program, which demonstrates the embedding of a ivtools drawing editor inside Motif widgets, you'll need some version of lesstif or Motif (libXm). To enable the ivxt ! build change line 7 of src/Imakefile from "#if 0" to "#if 1".Without these libraries and include files the build of ivxt will fail, which can be safely ignored. --- 59,86 ---- http://www.cs.wustl.edu/%7Eschmidt/ACE.html ! We are currently using ACE-5.1 built without threads support. Follow ! these steps to build it from source, or use the Debian binary if you ! happen to be working on that platform (libace5.1-dev): + tar xvfz ACE-5.1.tar.gz + cd ACE_wrappers + export ACE_ROOT=`pwd` # csh: setenv ACE_ROOT `pwd` + cd ace + cp config-linux.h config.h # substitute appropriate OS name + cd ../include/makeinclude + cp platform_linux.GNU platform_macros.GNU # substitute OS + emacs platform_macros.GNU # add "threads = 0" near top of file + cd ../../ace + make + + Then use "--with-ace=$ACE_ROOT" when running the configure script as + described below. + 0.f if you want to build the ivxt example program, which demonstrates the embedding of a ivtools drawing editor inside Motif widgets, you'll need some version of lesstif or Motif (libXm). To enable the ivxt ! build, change line 7 of src/Imakefile from "#if 0" to "#if 1". Without these libraries and include files the build of ivxt will fail, which can be safely ignored. Index: ComUtil/symbols.c diff -c ComUtil/symbols.c:1.1 ComUtil/symbols.c:1.2 *** ComUtil/symbols.c:1.1 Thu Jan 4 15:31:36 2001 --- src/ComUtil/symbols.c Wed Jun 20 14:01:28 2001 *************** *** 190,198 **** --- 190,202 ---- { if (sym_beg == NULL) /* if NULL, allocate some space for symbol table */ { + #if !defined(DMM_OFF) dmm_mblock_stats(NULL,&nbytes,NULL,NULL,NULL); sym_alloc_num = (nbytes < LOTS_OF_MEM) ? SYM_ALLOC_NUM_LOW: SYM_ALLOC_NUM_HIGH; + #else + sym_alloc_num = SYM_ALLOC_NUM_HIGH; + #endif if ( dmm_calloc((void**)&sym_beg,(long) sym_alloc_num,sizeof(char)) != 0) goto error_return; /* goto error return; INSUFFICIENT MEMORY */ sym_nbytes = sym_alloc_num; Index: ComTerp/comhandler.c diff -c ComTerp/comhandler.c:1.2 ComTerp/comhandler.c:1.3 *** ComTerp/comhandler.c:1.2 Tue Jun 19 11:24:47 2001 --- src/ComTerp/comhandler.c Wed Jun 20 14:01:30 2001 *************** *** 132,153 **** int ComterpHandler::handle_input (ACE_HANDLE fd) { - #if 0 - const int bufsiz = BUFSIZ; //*BUFSIZ; - char inbuf[bufsiz]; - inbuf[0] = '\0'; - filebuf ibuf(fd); - istream istr(&ibuf); - istr.getline(inbuf, bufsiz); - #else vector<char> inv; char ch; #if __GNUG__<3 filebuf ibuf(fd); - #else - FILE* ifptr = fdopen(fd, "r"); - filebuf ibuf(ifptr, ios_base::in); - #endif istream istr(&ibuf); // problem handling new-lines embedded in character strings --- 132,142 ---- int ComterpHandler::handle_input (ACE_HANDLE fd) { vector<char> inv; char ch; + #if __GNUG__<3 filebuf ibuf(fd); istream istr(&ibuf); // problem handling new-lines embedded in character strings *************** *** 155,167 **** inv.push_back(ch); inv.push_back('\0'); char* inbuf = &inv[0]; - #endif ! boolean istr_good = istr.good(); ! #if __GNUG__>=3 ! fclose(ifptr); #endif ! if (!comterp_ || !istr_good) return -1; else if (!inbuf || !*inbuf) { #if __GNUG__<3 --- 144,167 ---- inv.push_back(ch); inv.push_back('\0'); char* inbuf = &inv[0]; ! boolean input_good = istr.good(); ! #else ! ! ch = '\0'; ! int status; ! while (ch != '\n') { ! status = read(fd, &ch, 1); ! if (status == 1 && ch != '\n') inv.push_back(ch); ! } ! inv.push_back('\0'); ! ! boolean input_good = status != -1; ! #endif ! ! char* inbuf = &inv[0]; ! if (!comterp_ || !input_good) return -1; else if (!inbuf || !*inbuf) { #if __GNUG__<3 *************** *** 176,182 **** ostream ostr(&obuf); ostr << "\n"; ostr.flush(); ! if (ofptr) fclose(ofptr); return 0; #endif } --- 176,182 ---- ostream ostr(&obuf); ostr << "\n"; ostr.flush(); ! if (ofptr&&0) fclose(ofptr); return 0; #endif } *************** *** 188,194 **** comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs; int status = comterp_->ComTerp::run(false /* !once */, false /* !nested */); ! return (istr_good ? 0 : -1) && status; } else { if (inbuf[0]!='\004') cout << inbuf << "\n"; --- 188,194 ---- comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs; int status = comterp_->ComTerp::run(false /* !once */, false /* !nested */); ! return (input_good ? 0 : -1) && status; } else { if (inbuf[0]!='\004') cout << inbuf << "\n"; *************** *** 203,211 **** ostream ostr(&obuf); ostr << "\n"; ostr.flush(); ! if (ofptr) fclose(ofptr); #endif ! return (istr_good && inbuf[0]!='\004') ? 0 : -1; } } --- 203,211 ---- ostream ostr(&obuf); ostr << "\n"; ostr.flush(); ! if (ofptr&&0) fclose(ofptr); #endif ! return (input_good && inbuf[0]!='\004') ? 0 : -1; } } Index: ComTerp/helpfunc.c diff -c ComTerp/helpfunc.c:1.4 ComTerp/helpfunc.c:1.5 *** ComTerp/helpfunc.c:1.4 Thu Jun 14 12:56:20 2001 --- src/ComTerp/helpfunc.c Wed Jun 20 14:01:30 2001 *************** *** 127,144 **** int fd = Math::max(1, comterp()->handler()->get_handle()); fbuf.attach(fd); } #else ! FILE* ofptr; ! ofptr = fdopen(Math::max(1, comterp()->handler() ? comterp()->handler()->get_handle() : 0), "w"); ! filebuf fbuf(ofptr, ios_base::out); #endif - ostream out(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf); if (noargs) { ! out << "help available on these commands:\n"; ! comterp()->list_commands(out, true); ! out << "\n(provide any of the above, operators in quotes, as arguments to help,\ni.e. help(help) or help(\"++\"))\n"; } else { boolean first=true; --- 127,145 ---- int fd = Math::max(1, comterp()->handler()->get_handle()); fbuf.attach(fd); } + ostream outs( comterp()->handler() ? ((streambuf*)&fbuf) : (streambuf*)&sbuf ); + ostream *out = &outs; #else ! ofdstream fdout(Math::max(1, comterp()->handler() ? comterp()->handler()->get_handle() : 0)); ! ostream outs((streambuf*)&sbuf); ! ostream* out = comterp()->handler() ? &fdout : &outs; #endif if (noargs) { ! *out << "help available on these commands:\n"; ! comterp()->list_commands(*out, true); ! *out << "\n(provide any of the above, operators in quotes, as arguments to help,\ni.e. help(help) or help(\"++\"))\n"; } else { boolean first=true; *************** *** 151,165 **** if (first) first = false; else ! out.put('\n'); #if __GNUG__<3 ! out.form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i])); #else { char buffer[BUFSIZ]; snprintf(buffer, BUFSIZ, comfuncs[i]->docstring(), symbol_pntr(command_ids[i])); ! out << buffer; } #endif printed = true; --- 152,170 ---- if (first) first = false; else ! #if 0 ! out->put('\n'); ! #else ! *out << '\n'; ! #endif #if __GNUG__<3 ! out->form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i])); #else { char buffer[BUFSIZ]; snprintf(buffer, BUFSIZ, comfuncs[i]->docstring(), symbol_pntr(command_ids[i])); ! *out << buffer; } #endif printed = true; *************** *** 180,206 **** if (first) first = false; else ! out.put('\n'); #if __GNUG__<3 ! out.form(comfunc->docstring(), symbol_pntr(value->command_symid())); #else { char buffer[BUFSIZ]; snprintf(buffer, BUFSIZ, comfunc->docstring(), symbol_pntr(value->command_symid())); ! out << buffer; } #endif } else ! #if __GNUG__<3 ! out.form("unknown operator: %s\n", symbol_pntr(command_ids[i])); ! #else ! { ! char buffer[BUFSIZ]; ! snprintf(buffer, BUFSIZ, "unknown operator: %s\n", symbol_pntr(command_ids[i])); ! out << buffer; ! } ! #endif } } --- 185,203 ---- if (first) first = false; else ! out->put('\n'); #if __GNUG__<3 ! out->form(comfunc->docstring(), symbol_pntr(value->command_symid())); #else { char buffer[BUFSIZ]; snprintf(buffer, BUFSIZ, comfunc->docstring(), symbol_pntr(value->command_symid())); ! *out << buffer; } #endif } else ! out_form(*out, "unknown operator: %s\n", symbol_pntr(command_ids[i])); } } *************** *** 208,218 **** if (first) first = false; else ! out.put('\n'); ! if (str_flags[i]) out.put('"'); ! out << symbol_pntr(command_ids[i]); ! if (str_flags[i]) out.put('"'); ! out << " unknown"; } } } --- 205,215 ---- if (first) first = false; else ! out->put('\n'); ! if (str_flags[i]) out->put('"'); ! *out << symbol_pntr(command_ids[i]); ! if (str_flags[i]) out->put('"'); ! *out << " unknown"; } } } *************** *** 220,237 **** if (!comterp()->handler()) { ! out << '\0'; int help_str_symid = symbol_add(sbuf.str()); ComValue retval(sbuf.str()); push_stack(retval); ! } delete command_ids; delete comfuncs; delete str_flags; - #if __GNUG__>=3 - if (ofptr) fclose(ofptr); - #endif } --- 217,232 ---- if (!comterp()->handler()) { ! *out << '\0'; int help_str_symid = symbol_add(sbuf.str()); ComValue retval(sbuf.str()); push_stack(retval); ! } else ! out->flush(); delete command_ids; delete comfuncs; delete str_flags; } Index: comterp/main.c diff -c comterp/main.c:1.2 comterp/main.c:1.3 *** comterp/main.c:1.2 Tue Jun 19 11:24:49 2001 --- src/comterp_/main.c Wed Jun 20 14:01:32 2001 *************** *** 54,60 **** #endif #if __GNUG__>=3 ! static int newline; #endif int main(int argc, char *argv[]) { --- 54,60 ---- #endif #if __GNUG__>=3 ! static char newline; #endif int main(int argc, char *argv[]) { Index: OverlayUnidraw/aceimport.c diff -c OverlayUnidraw/aceimport.c:1.1 OverlayUnidraw/aceimport.c:1.2 *** OverlayUnidraw/aceimport.c:1.1 Thu Jan 4 15:33:05 2001 --- src/OverlayUnidraw/aceimport.c Wed Jun 20 14:01:47 2001 *************** *** 83,90 **** --- 83,95 ---- } return _inptr->good() ? 0 : -1; #else + #if __GNUG__<3 filebuf fbuf; if(fbuf.attach(fd)==0) return -1; + #else + FILE* ifptr = nil; + filebuf fbuf(ifptr = fdopen(fd, "r"), ios_base::in); + #endif istream in(&fbuf); int ch = in.get(); if (ch != EOF && in.good()) { *************** *** 92,98 **** _import_cmd->instream(&in); _import_cmd->Execute(); } ! return -1; #endif } --- 97,106 ---- _import_cmd->instream(&in); _import_cmd->Execute(); } ! #if __GNUG__>=3 ! fclose(ifptr); ! #endif ! return -1; /* only return -1, which indicates input handling is fini */ #endif } Index: ComUnidraw/unifunc.c diff -c ComUnidraw/unifunc.c:1.10 ComUnidraw/unifunc.c:1.11 *** ComUnidraw/unifunc.c:1.10 Fri Jun 15 15:44:37 2001 --- src/ComUnidraw/unifunc.c Wed Jun 20 14:01:50 2001 *************** *** 57,62 **** --- 57,67 ---- #include <fstream.h> #endif + #ifdef HAVE_ACE + #include <ComTerp/comhandler.h> + #include <ace/SOCK_Connector.h> + #endif + #define TITLE "UnidrawFunc" /*****************************************************************************/ *************** *** 427,434 **** ComterpHandler* handler = (ComterpHandler*)terp->handler(); if (handler) { ACE_SOCK_Stream peer = handler->peer(); ! ofptr = fdopen(peer.get_handle()); ! pfbuf = new fbuf(ofptr, output); } else #endif --- 432,439 ---- ComterpHandler* handler = (ComterpHandler*)terp->handler(); if (handler) { ACE_SOCK_Stream peer = handler->peer(); ! ofptr = fdopen(peer.get_handle(), "r"); ! pfbuf = new filebuf(ofptr, output); } else #endif Index: config_ivtools/config.mk diff -c config_ivtools/config.mk:1.2 config_ivtools/config.mk:1.3 *** config_ivtools/config.mk:1.2 Thu Jun 14 10:22:41 2001 --- config/config.mk Wed Jun 20 14:01:59 2001 *************** *** 1,5 **** XCONFIGDIR = /usr/X11R6/lib/X11/config ABSTOP = /home/scott/src/ivtools-0.9 CPU = LINUX ! LIBSTDCPLUSPLUS2 = 1 LIBSTDCPLUSPLUS3 = 1 --- 1,5 ---- XCONFIGDIR = /usr/X11R6/lib/X11/config ABSTOP = /home/scott/src/ivtools-0.9 CPU = LINUX ! LIBSTDCPLUSPLUS2 = 0 LIBSTDCPLUSPLUS3 = 1 Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.6 config_ivtools/params.def:1.7 *** config_ivtools/params.def:1.6 Fri Jun 15 16:26:01 2001 --- config/params.def Wed Jun 20 14:01:59 2001 *************** *** 446,452 **** #ifndef AceCCDefines #ifdef AceDir ! #define AceCCDefines -DHAVE_ACE #else #define AceCCDefines /**/ #endif --- 446,452 ---- #ifndef AceCCDefines #ifdef AceDir ! #define AceCCDefines -DHAVE_ACE -DACE_MT_SAFE=0 #else #define AceCCDefines /**/ #endif *** /dev/null Wed Jun 20 14:02:01 PDT 2001 --- patches/ivtools-010620-johnston-038 *************** patches/ivtools-010620-johnston-038 *** 0 **** --- 1 ---- + ivtools-010620-johnston-038 |
|
From: <ivt...@li...> - 2001-06-19 18:38:07
|
Patch: ivtools-010614-johnston-026
For: ivtools-0.9.3
Author: joh...@us...
Subject: gcc-3.0 damage control
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- monstrous patch of changes required by forthcoming gcc-3.0. The
heavy lifting was mostly due to the absence of filebuf::attach in v3
of libstdc++.
Other issues to deal with: templated iostreams, change to meaning of
-U (undefine compiler option), can't have static const char
initializes in class definition, need class between "friend" and class
name, use of <iosfwd>, missing ostream::form, missing istream::gets,
round needs to be Math::round.
Unfortunately, gdb can't debug C++ generated by gcc-3.0 yet, so
although things mostly work, I can't resolve problems with the wild
iostream hacking I did. My recommendation: stick to gcc-2.95.* for
now.
Index: configure.in
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/configure.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -c -r1.4 -r1.5
*** ./configure.in 2001/03/27 19:08:11 1.4
--- ./configure.in 2001/06/14 17:21:14 1.5
***************
*** 232,238 ****
# check for gettimeofday
#AC_TWO_ARG_TIMEOFDAY
# check for libstdc++
! AC_CHECK_LIB(stdc++,peek__7istream,LIBSTDCPLUSPLUS=1,LIBSTDCPLUSPLUS=0)
# check for bigendian
#AC_C_BIGENDIAN
--- 232,239 ----
# check for gettimeofday
#AC_TWO_ARG_TIMEOFDAY
# check for libstdc++
! AC_CHECK_LIB(stdc++,peek__7istream,LIBSTDCPLUSPLUS2=1,LIBSTDCPLUSPLUS2=0)
! AC_CHECK_LIB(stdc++,_ZNSi4peekEv,LIBSTDCPLUSPLUS3=1,LIBSTDCPLUSPLUS3=0)
# check for bigendian
#AC_C_BIGENDIAN
***************
*** 297,302 ****
--- 298,305 ----
#AC_SUBST(TCL)
#AC_SUBST(CXX_HDRDIR)
AC_SUBST(CXX_INCLUDE_DIR)
+ AC_SUBST(LIBSTDCPLUSPLUS2)
+ AC_SUBST(LIBSTDCPLUSPLUS3)
AC_SUBST(x_includes)
AC_SUBST(x_libraries)
#AC_SUBST(BUILD_TREE)
***************
*** 410,417 ****
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\"
! echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk
echo
echo "now do a \"make\""
echo
--- 413,422 ----
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
! echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
! echo LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3 >>config/config.mk
echo
echo "now do a \"make\""
echo
Index: configure
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/configure,v
retrieving revision 1.4
retrieving revision 1.5
diff -c -r1.4 -r1.5
*** ./configure 2001/03/27 19:08:11 1.4
--- ./configure 2001/06/14 17:21:14 1.5
***************
*** 1585,1591 ****
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
--- 1585,1591 ----
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-v3 /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
***************
*** 1641,1653 ****
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
! LIBSTDCPLUSPLUS=1
else
echo "$ac_t""no" 1>&6
! LIBSTDCPLUSPLUS=0
fi
# check for bigendian
#AC_C_BIGENDIAN
#if test $ac_cv_c_bigendian = yes; then
--- 1641,1694 ----
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
! LIBSTDCPLUSPLUS2=1
else
echo "$ac_t""no" 1>&6
! LIBSTDCPLUSPLUS2=0
fi
+ echo $ac_n "checking for _ZNSi4peekEv in -lstdc++""... $ac_c" 1>&6
+ echo "configure:1681: checking for _ZNSi4peekEv in -lstdc++" >&5
+ ac_lib_var=`echo stdc++'_'_ZNSi4peekEv | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+ LIBS="-lstdc++ $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 1689 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+ char _ZNSi4peekEv();
+
+ int main() {
+ _ZNSi4peekEv()
+ ; return 0; }
+ EOF
+ if { (eval echo configure:1700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+ fi
+ rm -f conftest*
+ LIBS="$ac_save_LIBS"
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBSTDCPLUSPLUS3=1
+ else
+ echo "$ac_t""no" 1>&6
+ LIBSTDCPLUSPLUS3=0
+ fi
+
+
# check for bigendian
#AC_C_BIGENDIAN
#if test $ac_cv_c_bigendian = yes; then
***************
*** 1732,1737 ****
--- 1773,1780 ----
#AC_SUBST(TCL)
#AC_SUBST(CXX_HDRDIR)
+
+
#AC_SUBST(BUILD_TREE)
***************
*** 1916,1921 ****
--- 1959,1966 ----
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@CXX_INCLUDE_DIR@%$CXX_INCLUDE_DIR%g
+ s%@LIBSTDCPLUSPLUS2@%$LIBSTDCPLUSPLUS2%g
+ s%@LIBSTDCPLUSPLUS3@%$LIBSTDCPLUSPLUS3%g
s%@x_includes@%$x_includes%g
s%@x_libraries@%$x_libraries%g
s%@ACE@%$ACE%g
***************
*** 2128,2135 ****
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\"
! echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk
echo
echo "now do a \"make\""
echo
--- 2173,2182 ----
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
! echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
! echo LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3 >>config/config.mk
echo
echo "now do a \"make\""
echo
Index: aclocal.m4
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/aclocal.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** ./aclocal.m4 2001/03/06 17:43:03 1.2
--- ./aclocal.m4 2001/06/14 17:21:14 1.3
***************
*** 25,31 ****
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
--- 25,31 ----
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-v3 /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
Index: Attribute/attribute.h
diff -c Attribute/attribute.h:1.1 Attribute/attribute.h:1.2
*** Attribute/attribute.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attribute.h Thu Jun 14 10:21:22 2001
***************
*** 62,68 ****
int symbolid;
AttributeValue* valueptr;
! friend AttributeList;
CLASS_SYMID("Attribute");
};
--- 62,68 ----
int symbolid;
AttributeValue* valueptr;
! friend class AttributeList;
CLASS_SYMID("Attribute");
};
Index: Attribute/attrlist.h
diff -c Attribute/attrlist.h:1.1 Attribute/attrlist.h:1.2
*** Attribute/attrlist.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attrlist.h Thu Jun 14 10:21:22 2001
***************
*** 39,46 ****
class ALIterator;
class AList;
! class istream;
! class ostream;
class Attribute;
class AttributeValue;
--- 39,45 ----
class ALIterator;
class AList;
! #include <iosfwd>
class Attribute;
class AttributeValue;
Index: Attribute/attrvalue.c
diff -c Attribute/attrvalue.c:1.2 Attribute/attrvalue.c:1.3
*** Attribute/attrvalue.c:1.2 Tue May 1 14:50:06 2001
--- src/Attribute/attrvalue.c Thu Jun 14 10:21:22 2001
***************
*** 760,770 ****
--- 760,788 ----
break;
case AttributeValue::FloatType:
+ #if __GNUG__<3
out.form("%.6f", svp->float_val());
+ #else
+ {
+ const int bufsiz=256;
+ char buffer[bufsiz];
+ snprintf(buffer, bufsiz, "%.6f", svp->float_val());
+ out << buffer;
+ }
+ #endif
break;
case AttributeValue::DoubleType:
+ #if __GNUG__<3
out.form("%.6f", svp->double_val());
+ #else
+ {
+ const int bufsiz=256;
+ char buffer[bufsiz];
+ snprintf(buffer, bufsiz, "%.6f", svp->double_val());
+ out << buffer;
+ }
+ #endif
break;
case AttributeValue::EofType:
Index: Attribute/attrvalue.h
diff -c Attribute/attrvalue.h:1.1 Attribute/attrvalue.h:1.2
*** Attribute/attrvalue.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attrvalue.h Thu Jun 14 10:21:22 2001
***************
*** 37,43 ****
}
class AttributeValueList;
! class ostream;
//: struct for symbol value, symid + global flag for symbol value
// used in attr_value.
--- 37,43 ----
}
class AttributeValueList;
! #include <iosfwd>
//: struct for symbol value, symid + global flag for symbol value
// used in attr_value.
Index: Attribute/paramlist.h
diff -c Attribute/paramlist.h:1.3 Attribute/paramlist.h:1.4
*** Attribute/paramlist.h:1.3 Thu Mar 22 16:27:32 2001
--- src/Attribute/paramlist.h Thu Jun 14 10:21:22 2001
***************
*** 35,42 ****
class ALIterator;
class LexScan;
class AList;
! class istream;
! class ostream;
//: signature of static methods for reading parameter data from an istream.
typedef int (*param_callback)(istream&, void*, void*, void*, void*);
--- 35,41 ----
class ALIterator;
class LexScan;
class AList;
! #include <iosfwd>
//: signature of static methods for reading parameter data from an istream.
typedef int (*param_callback)(istream&, void*, void*, void*, void*);
Index: TopoFace/fgeomobjs.h
diff -c TopoFace/fgeomobjs.h:1.1 TopoFace/fgeomobjs.h:1.2
*** TopoFace/fgeomobjs.h:1.1 Thu Jan 4 15:31:40 2001
--- src/TopoFace/fgeomobjs.h Thu Jun 14 10:21:24 2001
***************
*** 32,38 ****
#include <Unidraw/enter-scope.h>
class UList;
! class ostream;
class FPointObj {
public:
--- 32,38 ----
#include <Unidraw/enter-scope.h>
class UList;
! #include <iosfwd>
class FPointObj {
public:
Index: ComTerp/Imakefile
diff -c ComTerp/Imakefile:1.1 ComTerp/Imakefile:1.2
*** ComTerp/Imakefile:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/Imakefile Thu Jun 14 10:21:26 2001
***************
*** 46,52 ****
ObjA(comhandler)
#endif
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(comterp)
IncludeDependencies()
--- 46,52 ----
ObjA(comhandler)
#endif
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(comterp)
IncludeDependencies()
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.2 ComTerp/comterp.c:1.3
*** ComTerp/comterp.c:1.2 Mon Apr 30 16:32:33 2001
--- src/ComTerp/comterp.c Thu Jun 14 10:21:26 2001
***************
*** 50,61 ****
--- 50,65 ----
#include <ComTerp/xformfunc.h>
#include <Attribute/attrlist.h>
#include <Attribute/attribute.h>
+ #include <OS/math.h>
#include <ctype.h>
#include <iostream.h>
#include <string.h>
#include <strstream.h>
#include <unistd.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "ComTerp"
***************
*** 254,261 ****
--- 258,270 ----
}
if (stepflag()) {
+ #if __GNUG__<3
filebuf fbufout;
fbufout.attach(handler() ? max(1, handler()->get_handle()) : fileno(stdout));
+ #else
+ FILE* ofptr = handler() ? fdopen(Math::max(1, handler()->get_handle()), "w") : stdout;
+ filebuf fbufout(ofptr, ios_base::out);
+ #endif
ostream out(&fbufout);
out << ">>> " << *func << "(" << *func->funcstate() << ")\n";
static int pause_symid = symbol_add("pause");
***************
*** 265,270 ****
--- 274,283 ----
stepfunc->execute();
stepfunc->pop_funcstate();
pop_stack();
+ #if __GNUG__>=3
+ if (handler())
+ fclose(ofptr);
+ #endif
}
func->execute();
***************
*** 791,802 ****
--- 804,824 ----
char errbuf_save[BUFSIZ];
errbuf_save[0] = '\0';
+
+ #if __GNUG__<3
filebuf fbuf;
if (handler()) {
int fd = max(1, handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
+ #else
+ FILE* ofptr = nil;
+ filebuf fbuf(handler()
+ ? (ofptr = fdopen(Math::max(1, handler()->get_handle()), "w"))
+ : stdout,
+ ios_base::out);
+ #endif
ostream out(&fbuf);
boolean eolflag = false;
***************
*** 839,844 ****
--- 861,869 ----
}
if (status==1 && _pfnum==0) status=2;
if (nested && status!=2) _stack_top--;
+ #if __GNUG__>3
+ if (ofptr) fclose(ofptr);
+ #endif
return status;
}
***************
*** 1002,1008 ****
--- 1027,1037 ----
if (read_expr()) {
if (eval_expr(true)) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(1);
+ #else
+ filebuf obuf(stdout, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr << "err\n";
ostr.flush();
Index: ComTerp/comterp.h
diff -c ComTerp/comterp.h:1.1 ComTerp/comterp.h:1.2
*** ComTerp/comterp.h:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/comterp.h Thu Jun 14 10:21:26 2001
***************
*** 41,47 ****
class ComFuncState;
class ComTerpState;
class ComValue;
! class ostream;
class ComterpHandler;
--- 41,47 ----
class ComFuncState;
class ComTerpState;
class ComValue;
! #include <iosfwd>
class ComterpHandler;
Index: ComTerp/comterpserv.c
diff -c ComTerp/comterpserv.c:1.1 ComTerp/comterpserv.c:1.2
*** ComTerp/comterpserv.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/comterpserv.c Thu Jun 14 10:21:26 2001
***************
*** 28,35 ****
--- 28,39 ----
#include <ComTerp/comterpserv.h>
#include <ComTerp/comvalue.h>
#include <ComTerp/ctrlfunc.h>
+ #include <OS/math.h>
#include <iostream.h>
#include <string.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#if BUFSIZ>1024
#undef BUFSIZ
***************
*** 140,151 ****
char* ComTerpServ::fd_fgets(char* s, int n, void* serv) {
ComTerpServ* server = (ComTerpServ*)serv;
char* instr;
- int fd = max(server->_fd, 1);
filebuf fbuf;
fbuf.attach(fd);
istream in (&fbuf);
in.gets(&instr);
server->_instat = in.good();
char* outstr = s;
--- 144,163 ----
char* ComTerpServ::fd_fgets(char* s, int n, void* serv) {
ComTerpServ* server = (ComTerpServ*)serv;
+ int fd = Math::max(server->_fd, 1);
+ #if __GNUG__<3
char* instr;
filebuf fbuf;
fbuf.attach(fd);
istream in (&fbuf);
in.gets(&instr);
+ #else
+ char instr[BUFSIZ];
+ FILE* ifptr = fdopen(fd, "r");
+ filebuf fbuf(ifptr, ios_base::in);
+ istream in (&fbuf);
+ in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
+ #endif
server->_instat = in.good();
char* outstr = s;
***************
*** 167,172 ****
--- 179,188 ----
/* append a null byte */
outstr[outpos] = '\0';
+ #if __GNUG__>=3
+ if (ifptr) fclose(ifptr);
+ #endif
+
return s;
}
***************
*** 177,189 ****
--- 193,213 ----
int& bufsize = server->_bufsiz;
int fd = (int)server->_fd;
+ #if __GNUG__<3
filebuf fbuf;
fbuf.attach(fd);
+ #else
+ FILE* ofptr = fdopen(fd, "w");
+ filebuf fbuf(ofptr, ios_base::out);
+ #endif
ostream out(&fbuf);
for (; outpos < bufsize-1 && s[outpos]; outpos++)
out.put(s[outpos]);
out.flush();
outpos = 0;
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
return 1;
}
***************
*** 262,269 ****
--- 286,297 ----
char inbuf[bufsiz];
char outbuf[bufsiz];
inbuf[0] = '\0';
+ #if __GNUG__<3
filebuf ibuf;
ibuf.open(filename, "r");
+ #else
+ filebuf ibuf(fopen(filename, "r"), ios_base::in);
+ #endif
istream istr(&ibuf);
ComValue* retval = nil;
int status = 0;
***************
*** 282,290 ****
--- 310,326 ----
if (*inbuf && read_expr()) {
if (eval_expr(true)) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
+ #else
+ FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
+ filebuf obuf(ofptr, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr.flush();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
status = -1;
} else if (quitflag()) {
status = 1;
***************
*** 295,303 ****
--- 331,347 ----
}
} else if (*inbuf) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
+ #else
+ FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
+ filebuf obuf(ofptr, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr.flush();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
status = -1;
}
}
Index: ComTerp/debugfunc.c
diff -c ComTerp/debugfunc.c:1.2 ComTerp/debugfunc.c:1.3
*** ComTerp/debugfunc.c:1.2 Tue Mar 27 09:32:28 2001
--- src/ComTerp/debugfunc.c Thu Jun 14 10:21:26 2001
***************
*** 26,31 ****
--- 26,34 ----
#include <ComTerp/comterpserv.h>
#include <strstream.h>
#include <vector.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "DebugFunc"
***************
*** 80,98 ****
--- 83,119 ----
cerr << sbuf2_s.str();
comterp()->push_servstate();
+ #if __GNUG__<3
filebuf fbufin;
if (comterp()->handler()) {
int fd = max(0, comterp()->handler()->get_handle());
fbufin.attach(fd);
} else
fbufin.attach(fileno(stdin));
+ #else
+ FILE* ifptr;
+ if (comterp()->handler())
+ ifptr = fdopen(max(0, comterp()->handler()->get_handle()), "r");
+ else
+ ifptr = stdin;
+ filebuf fbufin(ifptr, ios_base::in);
+ #endif
istream in(&fbufin);
+ #if __GNUG__<3
filebuf fbufout;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbufout.attach(fd);
} else
fbufout.attach(fileno(stdout));
+ #else
+ FILE* ofptr;
+ if (comterp()->handler())
+ ofptr = fdopen(max(1, comterp()->handler()->get_handle()), "w");
+ else
+ ofptr = stdout;
+ filebuf fbufout(ofptr, ios_base::out);
+ #endif
ostream out(&fbufout);
vector<char> cvect;
ComValue retval;
***************
*** 119,124 ****
--- 140,151 ----
sbuf_e.put('\0');
cerr << sbuf_e.str();
push_stack(retval);
+ #if __GNUG__>=3
+ if (comterp()->handler()) {
+ fclose(ifptr);
+ fclose(ofptr);
+ }
+ #endif
}
void ComterpPauseFunc::execute() {
Index: ComTerp/helpfunc.c
diff -c ComTerp/helpfunc.c:1.2 ComTerp/helpfunc.c:1.3
*** ComTerp/helpfunc.c:1.2 Mon Apr 30 16:32:33 2001
--- src/ComTerp/helpfunc.c Thu Jun 14 10:21:26 2001
***************
*** 29,36 ****
--- 29,41 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ #include <OS/math.h>
+
#include <iostream.h>
#include <strstream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "HelpFunc"
***************
*** 115,131 ****
reset_stack();
- filebuf fbuf;
strstreambuf sbuf;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
! #if 0
! else
! fbuf.attach(fileno(stdout));
#endif
! ostream out(comterp()->handler() ? &fbuf : &sbuf);
if (noargs) {
--- 120,138 ----
reset_stack();
strstreambuf sbuf;
+ #if __GNUG__<3
+ filebuf fbuf;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
! #else
! FILE* ofptr;
! ofptr = fdopen(Math::max(1, comterp()->handler() ? comterp()->handler()->get_handle() : 0), "w");
! filebuf fbuf(ofptr, ios_base::out);
#endif
! ostream out(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf);
if (noargs) {
***************
*** 145,152 ****
first = false;
else
out.put('\n');
! ;
out.form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
printed = true;
}
}
--- 152,167 ----
first = false;
else
out.put('\n');
! #if __GNUG__<3
out.form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ,
+ comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
+ out << buffer;
+ }
+ #endif
printed = true;
}
}
***************
*** 166,174 ****
--- 181,206 ----
first = false;
else
out.put('\n');
+ #if __GNUG__<3
out.form(comfunc->docstring(), symbol_pntr(value->command_symid()));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ,
+ comfunc->docstring(), symbol_pntr(value->command_symid()));
+ out << buffer;
+ }
+ #endif
} else
+ #if __GNUG__<3
out.form("unknown operator: %s\n", symbol_pntr(command_ids[i]));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ, "unknown operator: %s\n", symbol_pntr(command_ids[i]));
+ out << buffer;
+ }
+ #endif
}
}
***************
*** 198,202 ****
--- 230,237 ----
delete comfuncs;
delete str_flags;
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
}
Index: ComTerp/iofunc.c
diff -c ComTerp/iofunc.c:1.1 ComTerp/iofunc.c:1.2
*** ComTerp/iofunc.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/iofunc.c Thu Jun 14 10:21:26 2001
***************
*** 28,35 ****
--- 28,39 ----
#include <ComTerp/comterp.h>
#include <Attribute/aliterator.h>
#include <Attribute/attrlist.h>
+ #include <OS/math.h>
#include <iostream.h>
#include <strstream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "IoFunc"
***************
*** 55,60 ****
--- 59,65 ----
const char* fstr = formatstr.is_string() ? formatstr.string_ptr() : "nil";
+ #if __GNUG__<3
streambuf* strmbuf = nil;
if (stringflag.is_false() && strflag.is_false() &&
symbolflag.is_false() && symflag.is_false()) {
***************
*** 68,73 ****
--- 73,93 ----
} else {
strmbuf = new strstreambuf();
}
+ #else
+ streambuf* strmbuf = nil;
+ FILE* ofptr = nil;
+ if (stringflag.is_false() && strflag.is_false() &&
+ symbolflag.is_false() && symflag.is_false()) {
+ filebuf * fbuf = nil;
+ if (comterp()->handler()) {
+ int fd = Math::max(1, comterp()->handler()->get_handle());
+ fbuf = new filebuf(ofptr = fdopen(fd, "w"), ios_base::out);
+ } else
+ fbuf = new filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
+ strmbuf = fbuf;
+ } else
+ strmbuf = new strstreambuf();
+ #endif
ostream out(strmbuf);
if (nargs()==1) {
***************
*** 82,124 ****
{
case ComValue::SymbolType:
case ComValue::StringType:
! out.form(fstr, symbol_pntr( printval.symbol_ref()));
break;
case ComValue::BooleanType:
! out.form(fstr, printval.boolean_ref());
break;
case ComValue::CharType:
! out.form(fstr, printval.char_ref());
break;
case ComValue::UCharType:
! out.form(fstr, printval.uchar_ref());
break;
case ComValue::IntType:
! out.form(fstr, printval.int_ref());
break;
case ComValue::UIntType:
! out.form(fstr, printval.uint_ref());
break;
case ComValue::LongType:
! out.form(fstr, printval.long_ref());
break;
case ComValue::ULongType:
! out.form(fstr, printval.ulong_ref());
break;
case ComValue::FloatType:
! out.form(fstr, printval.float_ref());
break;
case ComValue::DoubleType:
! out.form(fstr, printval.double_ref());
break;
case ComValue::ArrayType:
--- 102,144 ----
{
case ComValue::SymbolType:
case ComValue::StringType:
! out_form(out, fstr, symbol_pntr( printval.symbol_ref()));
break;
case ComValue::BooleanType:
! out_form(out, fstr, printval.boolean_ref());
break;
case ComValue::CharType:
! out_form(out, fstr, printval.char_ref());
break;
case ComValue::UCharType:
! out_form(out, fstr, printval.uchar_ref());
break;
case ComValue::IntType:
! out_form(out, fstr, printval.int_ref());
break;
case ComValue::UIntType:
! out_form(out, fstr, printval.uint_ref());
break;
case ComValue::LongType:
! out_form(out, fstr, printval.long_ref());
break;
case ComValue::ULongType:
! out_form(out, fstr, printval.ulong_ref());
break;
case ComValue::FloatType:
! out_form(out, fstr, printval.float_ref());
break;
case ComValue::DoubleType:
! out_form(out, fstr, printval.double_ref());
break;
case ComValue::ArrayType:
***************
*** 146,152 ****
break;
case ComValue::UnknownType:
! out.form(fstr);
break;
default:
--- 166,172 ----
break;
case ComValue::UnknownType:
! out_form(out, fstr, nil);
break;
default:
***************
*** 166,171 ****
push_stack(retval);
}
delete strmbuf;
!
}
--- 186,193 ----
push_stack(retval);
}
delete strmbuf;
! #if __GNUG__>=3
! if (ofptr) fclose(ofptr);
! #endif
}
Index: ComTerp/parser.c
diff -c ComTerp/parser.c:1.1 ComTerp/parser.c:1.2
*** ComTerp/parser.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/parser.c Thu Jun 14 10:21:26 2001
***************
*** 131,138 ****
--- 131,143 ----
char* Parser::istream_fgets(char* s, int n, void* instreamp) {
istream& in = *(istream*)instreamp;
+ #if __GNUG__<3
char *instr;
in.gets(&instr);
+ #else
+ char instr[BUFSIZ];
+ in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
+ #endif
if (in.good()) {
int i = 0;
for (; i<n-2; i++) {
Index: ComTerp/parser.h
diff -c ComTerp/parser.h:1.1 ComTerp/parser.h:1.2
*** ComTerp/parser.h:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/parser.h Thu Jun 14 10:21:26 2001
***************
*** 31,37 ****
#include <ComTerp/commodule.h>
#include <ComTerp/_comterp.h>
! class istream;
//: C++ wrapper for ComUtil parser capability.
class Parser : public ComTerpModule {
--- 31,37 ----
#include <ComTerp/commodule.h>
#include <ComTerp/_comterp.h>
! #include <iosfwd>
//: C++ wrapper for ComUtil parser capability.
class Parser : public ComTerpModule {
Index: ComTerp/postfunc.c
diff -c ComTerp/postfunc.c:1.1 ComTerp/postfunc.c:1.2
*** ComTerp/postfunc.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/postfunc.c Thu Jun 14 10:21:26 2001
***************
*** 29,35 ****
--- 29,40 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ #include <OS/math.h>
+
#include <iostream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "PostFunc"
***************
*** 40,51 ****
void PostFixFunc::execute() {
// print everything on the stack for this function
filebuf fbuf;
if (comterp()->handler()) {
! int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
ostream out(&fbuf);
boolean oldbrief = comterp()->brief();
--- 45,64 ----
void PostFixFunc::execute() {
// print everything on the stack for this function
+ #if __GNUG__>3
filebuf fbuf;
if (comterp()->handler()) {
! int fd = Math::max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
+ #else
+ FILE* ofptr = nil;
+ filebuf fbuf(comterp()->handler()
+ ? (ofptr=fdopen(Math::max(1, comterp()->handler()->get_handle()), "w"))
+ : stdout,
+ ios_base::out);
+ #endif
ostream out(&fbuf);
boolean oldbrief = comterp()->brief();
***************
*** 72,77 ****
--- 85,93 ----
}
comterp()->brief(oldbrief);
reset_stack();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
}
/*****************************************************************************/
Index: src_interviews/field.c
diff -c src_interviews/field.c:1.1 src_interviews/field.c:1.2
*** src_interviews/field.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/field.c Thu Jun 14 10:21:29 2001
***************
*** 61,66 ****
--- 61,67 ----
#include <OS/math.h>
#include <OS/string.h>
#include <stdio.h>
+ #include <string.h>
class FieldStringEditor : public StringEditor {
public:
Index: src_interviews/ol_kit.c
diff -c src_interviews/ol_kit.c:1.1 src_interviews/ol_kit.c:1.2
*** src_interviews/ol_kit.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/ol_kit.c Thu Jun 14 10:21:29 2001
***************
*** 1051,1057 ****
class OLKitImpl {
private:
! friend OLKit;
OLKitImpl(OLKit*);
~OLKitImpl();
--- 1051,1057 ----
class OLKitImpl {
private:
! friend class OLKit;
OLKitImpl(OLKit*);
~OLKitImpl();
Index: src_interviews/printer.c
diff -c src_interviews/printer.c:1.1 src_interviews/printer.c:1.2
*** src_interviews/printer.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/printer.c Thu Jun 14 10:21:29 2001
***************
*** 372,378 ****
out << "\\" << char(c);
} else if (c > 127) {
#ifdef __GNUC__
! out.form("\\%03o", c);
#else
out << "\\";
int old_width = out.width(3);
--- 372,378 ----
out << "\\" << char(c);
} else if (c > 127) {
#ifdef __GNUC__
! out_form(out, "\\%03o", c);
#else
out << "\\";
int old_width = out.width(3);
***************
*** 443,449 ****
}
}
#ifdef __GNUC__
! out.form("%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
--- 443,449 ----
}
}
#ifdef __GNUC__
! out_form(out, "%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
***************
*** 484,490 ****
raster->peek(ix, iy, r, g, b, alpha);
int byte = int(0xff * (r + g + b) / 3);
#ifdef __GNUC__
! out.form("%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
--- 484,490 ----
raster->peek(ix, iy, r, g, b, alpha);
int byte = int(0xff * (r + g + b) / 3);
#ifdef __GNUC__
! out_form(out, "%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
Index: src_iv-2_6/xpainter.c
diff -c src_iv-2_6/xpainter.c:1.1 src_iv-2_6/xpainter.c:1.2
*** src_iv-2_6/xpainter.c:1.1 Thu Jan 4 15:31:51 2001
--- src/IV-2_6/xpainter.c Thu Jun 14 10:21:31 2001
***************
*** 64,70 ****
dashgc = XCreateGC(d->display_, d->root_, 0, nil);
fillbg = true;
overwrite = false;
! xor = false;
clipped = false;
}
--- 64,70 ----
dashgc = XCreateGC(d->display_, d->root_, 0, nil);
fillbg = true;
overwrite = false;
! x_or = false;
clipped = false;
}
***************
*** 133,142 ****
rep->fillbg = copy->rep->fillbg;
rep->overwrite = copy->rep->overwrite;
Copy(copy);
! if (copy->rep->xor) {
Begin_xor();
}
! rep->xor = copy->rep->xor;
if (rep->overwrite) {
XSetSubwindowMode(dpy, rep->fillgc, IncludeInferiors);
XSetSubwindowMode(dpy, rep->dashgc, IncludeInferiors);
--- 133,142 ----
rep->fillbg = copy->rep->fillbg;
rep->overwrite = copy->rep->overwrite;
Copy(copy);
! if (copy->rep->x_or) {
Begin_xor();
}
! rep->x_or = copy->rep->x_or;
if (rep->overwrite) {
XSetSubwindowMode(dpy, rep->fillgc, IncludeInferiors);
XSetSubwindowMode(dpy, rep->dashgc, IncludeInferiors);
***************
*** 155,161 ****
void Painter::FillBg(boolean b) {
if (rep->fillbg != b) {
! if (rep->xor) {
End_xor();
}
rep->fillbg = b;
--- 155,161 ----
void Painter::FillBg(boolean b) {
if (rep->fillbg != b) {
! if (rep->x_or) {
End_xor();
}
rep->fillbg = b;
***************
*** 171,177 ****
boolean Painter::BgFilled() const { return rep->fillbg; }
void Painter::SetColors(const Color* f, const Color* b) {
! if (rep->xor) {
End_xor();
}
--- 171,177 ----
boolean Painter::BgFilled() const { return rep->fillbg; }
void Painter::SetColors(const Color* f, const Color* b) {
! if (rep->x_or) {
End_xor();
}
***************
*** 205,211 ****
}
void Painter::SetPattern(const Pattern* pat) {
! if (rep->xor) {
End_xor();
}
if (pattern != pat) {
--- 205,211 ----
}
void Painter::SetPattern(const Pattern* pat) {
! if (rep->x_or) {
End_xor();
}
if (pattern != pat) {
***************
*** 219,225 ****
}
void Painter::SetBrush(const Brush* b) {
! if (rep->xor) {
End_xor();
}
if (br != b) {
--- 219,225 ----
}
void Painter::SetBrush(const Brush* b) {
! if (rep->x_or) {
End_xor();
}
if (br != b) {
***************
*** 363,370 ****
}
void Painter::Begin_xor() {
! if (!rep->xor) {
! rep->xor = true;
DisplayRep& d = *rep->display->rep();
XDisplay* dpy = d.display_;
unsigned long xor_pixel = d.default_visual_->x_or(*d.style_);
--- 363,370 ----
}
void Painter::Begin_xor() {
! if (!rep->x_or) {
! rep->x_or = true;
DisplayRep& d = *rep->display->rep();
XDisplay* dpy = d.display_;
unsigned long xor_pixel = d.default_visual_->x_or(*d.style_);
***************
*** 378,385 ****
}
void Painter::End_xor() {
! if (rep->xor) {
! rep->xor = false;
XDisplay* dpy = rep->display->rep()->display_;
XSetFunction(dpy, rep->fillgc, GXcopy);
unsigned long pixel = foreground->PixelValue();
--- 378,385 ----
}
void Painter::End_xor() {
! if (rep->x_or) {
! rep->x_or = false;
XDisplay* dpy = rep->display->rep()->display_;
XSetFunction(dpy, rep->fillgc, GXcopy);
unsigned long pixel = foreground->PixelValue();
***************
*** 664,670 ****
if (xid == CanvasRep::unbound) {
return;
}
! if (rep->xor) {
End_xor();
}
int tx = TxKey(matrix, bitmap->pwidth(), bitmap->pheight());
--- 664,670 ----
if (xid == CanvasRep::unbound) {
return;
}
! if (rep->x_or) {
End_xor();
}
int tx = TxKey(matrix, bitmap->pwidth(), bitmap->pheight());
Index: src_x11/xdrag.c
diff -c src_x11/xdrag.c:1.1 src_x11/xdrag.c:1.2
*** src_x11/xdrag.c:1.1 Thu Jan 4 15:31:53 2001
--- src/IV-X11/xdrag.c Thu Jun 14 10:21:33 2001
***************
*** 130,136 ****
char buffer[256];
ostrstream name(buffer, 256);
name << dragName << "_" << Host::name() << "_" << getpid() << "_" <<
! dropUid++ << ends;
property = XInternAtom(display, name.str(), False);
XChangeProperty(
--- 130,136 ----
char buffer[256];
ostrstream name(buffer, 256);
name << dragName << "_" << Host::name() << "_" << getpid() << "_" <<
! dropUid++ << '\0';
property = XInternAtom(display, name.str(), False);
XChangeProperty(
Index: src_x11/xwindow.c
diff -c src_x11/xwindow.c:1.1 src_x11/xwindow.c:1.2
*** src_x11/xwindow.c:1.1 Thu Jan 4 15:31:53 2001
--- src/IV-X11/xwindow.c Thu Jun 14 10:21:33 2001
***************
*** 1624,1630 ****
return (i ^ (i>>1)) & i;
}
! unsigned long WindowVisual::xor(const Style& s) const {
return x_or(s);
}
--- 1624,1630 ----
return (i ^ (i>>1)) & i;
}
! unsigned long WindowVisual::x_or_(const Style& s) const {
return x_or(s);
}
Index: src_os/string.c
diff -c src_os/string.c:1.1 src_os/string.c:1.2
*** src_os/string.c:1.1 Thu Jan 4 15:31:55 2001
--- src/OS/string.c Thu Jun 14 10:21:34 2001
***************
*** 328,334 ****
};
ostream& operator<< (ostream& out, const String& str) {
! #if defined(sun) && !defined(solaris)
out.write(str.string(), str.length());
#else
out.write(str.string(), (streamsize)str.length());
--- 328,334 ----
};
ostream& operator<< (ostream& out, const String& str) {
! #if defined(sun) && !defined(solaris) || __GNUG__>=3
out.write(str.string(), str.length());
#else
out.write(str.string(), (streamsize)str.length());
Index: src_dispatch/dispatcher.c
diff -c src_dispatch/dispatcher.c:1.1 src_dispatch/dispatcher.c:1.2
*** src_dispatch/dispatcher.c:1.1 Thu Jan 4 15:31:58 2001
--- src/Dispatch/dispatcher.c Thu Jun 14 10:21:36 2001
***************
*** 60,66 ****
#endif
}
! #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2)
#define fds_bits __fds_bits
#endif
--- 60,66 ----
#endif
}
! #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2) && __GNUG__<3
#define fds_bits __fds_bits
#endif
***************
*** 653,659 ****
sv.sa_flags = SV_INTERRUPT;
sigaction(SIGCLD, &sv, &osv);
#else
! sv.sv_handler = fxSIGVECHANDLER(&Dispatcher::sigCLD);
sv.sv_flags = SV_INTERRUPT;
sigvec(SIGCLD, &sv, &osv);
#endif
--- 653,659 ----
sv.sa_flags = SV_INTERRUPT;
sigaction(SIGCLD, &sv, &osv);
#else
! sv.sv_handler = (void (*)(int)) fxSIGVECHANDLER(&Dispatcher::sigCLD);
sv.sv_flags = SV_INTERRUPT;
sigvec(SIGCLD, &sv, &osv);
#endif
Index: iclass/dialogs.c
diff -c iclass/dialogs.c:1.1 iclass/dialogs.c:1.2
*** iclass/dialogs.c:1.1 Thu Jan 4 15:32:02 2001
--- src/iclass/dialogs.c Thu Jun 14 10:21:38 2001
***************
*** 37,42 ****
--- 37,43 ----
#include <InterViews/scrollbar.h>
#include <InterViews/sensor.h>
#include <InterViews/streditor.h>
+ #include <OS/math.h>
#include <OS/types.h>
#include <stdlib.h>
***************
*** 108,114 ****
/*****************************************************************************/
AcknowledgeDialog::AcknowledgeDialog (const char* msg, const char* btnLbl) {
! int space = round(fspace*ivcm);
Insert(
new MarginFrame(
--- 109,115 ----
/*****************************************************************************/
AcknowledgeDialog::AcknowledgeDialog (const char* msg, const char* btnLbl) {
! int space = Math::round(fspace*ivcm);
Insert(
new MarginFrame(
***************
*** 177,183 ****
}
Interactor* ConfirmDialog::Interior (const char* msg) {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 178,184 ----
}
Interactor* ConfirmDialog::Interior (const char* msg) {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 219,225 ****
void StringDialog::Select (int left, int right) { _sedit->Select(left, right);}
void StringDialog::Init (const char* msg, const char* confirmLbl, int width) {
! int space = round(fspace*ivcm);
_sedit = new StringEditor(state, "");
HBox* framedSedit = new HBox;
--- 220,226 ----
void StringDialog::Select (int left, int right) { _sedit->Select(left, right);}
void StringDialog::Init (const char* msg, const char* confirmLbl, int width) {
! int space = Math::round(fspace*ivcm);
_sedit = new StringEditor(state, "");
HBox* framedSedit = new HBox;
***************
*** 287,293 ****
FileDialog::FileDialog (
const char* msg, const char* dir, const char* confirmLbl
) {
! int space = round(fspace*ivcm);
_browser = new FileBrowser(state, dir, 20, 35, false, Reversed,"\000\007");
_dirs = new FileBrowser(
"dirBrowser", state, dir, 20, 24, true, Reversed,"d\007"
--- 288,294 ----
FileDialog::FileDialog (
const char* msg, const char* dir, const char* confirmLbl
) {
! int space = Math::round(fspace*ivcm);
_browser = new FileBrowser(state, dir, 20, 35, false, Reversed,"\000\007");
_dirs = new FileBrowser(
"dirBrowser", state, dir, 20, 24, true, Reversed,"d\007"
Index: iclass/iclass.c
diff -c iclass/iclass.c:1.1 iclass/iclass.c:1.2
*** iclass/iclass.c:1.1 Thu Jan 4 15:32:02 2001
--- src/iclass/iclass.c Thu Jun 14 10:21:38 2001
***************
*** 50,55 ****
--- 50,56 ----
#include <InterViews/streditor.h>
#include <InterViews/textbuffer.h>
#include <InterViews/world.h>
+ #include <OS/math.h>
#include <OS/types.h>
#include <stdio.h>
***************
*** 195,201 ****
if (f != nil) {
struct stat filestats;
stat(filename, &filestats);
! _bufsize = max(round(filestats.st_size * 1.2), MINTEXTSIZE);
_buf = new char[_bufsize];
char* b = _buf;
int remaining = _bufsize;
--- 196,202 ----
if (f != nil) {
struct stat filestats;
stat(filename, &filestats);
! _bufsize = max(Math::round(filestats.st_size * 1.2), MINTEXTSIZE);
_buf = new char[_bufsize];
char* b = _buf;
int remaining = _bufsize;
***************
*** 448,454 ****
}
Interactor* IClass::Interior () {
! int space = round(fspace*ivcm);
const char* showButton = GetAttribute("showButton");
Interactor* selector = SelectedClass();
--- 449,455 ----
}
Interactor* IClass::Interior () {
! int space = Math::round(fspace*ivcm);
const char* showButton = GetAttribute("showButton");
Interactor* selector = SelectedClass();
***************
*** 501,507 ****
const char* name, MenuInfo* item, IClass* ic
) {
PulldownMenu* menu = new PulldownMenu(
! new Message(name, Left, round(.1*ivcm))
);
for (MenuInfo* i = item; i->_lbl != nil; i++) {
--- 502,508 ----
const char* name, MenuInfo* item, IClass* ic
) {
PulldownMenu* menu = new PulldownMenu(
! new Message(name, Left, Math::round(.1*ivcm))
);
for (MenuInfo* i = item; i->_lbl != nil; i++) {
***************
*** 653,659 ****
void IClass::ForwardSearchCmd () {
if (_fwdSearch == nil) {
! _fwdSearch = new StringDialog("Search forward for: ", round(3*ivinches));
}
InsertDialog(_fwdSearch);
--- 654,660 ----
void IClass::ForwardSearchCmd () {
if (_fwdSearch == nil) {
! _fwdSearch = new StringDialog("Search forward for: ", Math::round(3*ivinches));
}
InsertDialog(_fwdSearch);
***************
*** 670,676 ****
void IClass::BackwardSearchCmd () {
if (_bwdSearch == nil) {
! _bwdSearch = new StringDialog("Search backward for:", round(3*ivinches));
}
InsertDialog(_bwdSearch);
--- 671,677 ----
void IClass::BackwardSearchCmd () {
if (_bwdSearch == nil) {
! _bwdSearch = new StringDialog("Search backward for:", Math::round(3*ivinches));
}
InsertDialog(_bwdSearch);
Index: IVGlyph/bdvalue.c
diff -c IVGlyph/bdvalue.c:1.1 IVGlyph/bdvalue.c:1.2
*** IVGlyph/bdvalue.c:1.1 Thu Jan 4 15:32:07 2001
--- src/IVGlyph/bdvalue.c Thu Jun 14 10:21:41 2001
***************
*** 48,53 ****
--- 48,54 ----
#include <IVGlyph/bdvalue.h>
#include <stdio.h>
+ #include <string.h>
/* class BoundedValue */
Index: AttrGlyph/Imakefile
diff -c AttrGlyph/Imakefile:1.1 AttrGlyph/Imakefile:1.2
*** AttrGlyph/Imakefile:1.1 Thu Jan 4 15:32:53 2001
--- src/AttrGlyph/Imakefile Thu Jun 14 10:21:54 2001
***************
*** 14,20 ****
#define Obj(file,flags) MakeObjectFromSrcFlags(file,flags)
! Obj(attredit,-DLibStdCPlusPlus=$(LIBSTDCPLUSPLUS))
IncludeDependencies()
--- 14,20 ----
#define Obj(file,flags) MakeObjectFromSrcFlags(file,flags)
! Obj(attredit,-DLibStdCPlusPlus2=$(LIBSTDCPLUSPLUS2) -DLibStdCPlusPlus3=$(LIBSTDCPLUSPLUS3))
IncludeDependencies()
Index: AttrGlyph/attredit.c
diff -c AttrGlyph/attredit.c:1.2 AttrGlyph/attredit.c:1.3
*** AttrGlyph/attredit.c:1.2 Thu Apr 5 09:39:41 2001
--- src/AttrGlyph/attredit.c Thu Jun 14 10:21:54 2001
***************
*** 43,49 ****
#include <strstream.h>
#include <string.h>
! #if LibStdCPlusPlus
#define STL_VECTOR
#include <vector.h>
#endif
--- 43,49 ----
#include <strstream.h>
#include <string.h>
! #if defined(LibStdCPlusPlus2) || defined(LibStdCPlusPlus3)
#define STL_VECTOR
#include <vector.h>
#endif
Index: ComGlyph/Imakefile
diff -c ComGlyph/Imakefile:1.1 ComGlyph/Imakefile:1.2
*** ComGlyph/Imakefile:1.1 Thu Jan 4 15:32:54 2001
--- src/ComGlyph/Imakefile Thu Jun 14 10:21:56 2001
***************
*** 13,19 ****
MakeLibrary($(LIB),$(VERSION))
#define Obj26(file) MakeObjectFromSrcFlags(file,)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(attrdialog)
Obj31(comtextedit)
--- 13,19 ----
MakeLibrary($(LIB),$(VERSION))
#define Obj26(file) MakeObjectFromSrcFlags(file,)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(attrdialog)
Obj31(comtextedit)
Index: Unidraw/align.c
diff -c Unidraw/align.c:1.1 Unidraw/align.c:1.2
*** Unidraw/align.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/align.c Thu Jun 14 10:21:58 2001
***************
*** 44,49 ****
--- 44,51 ----
#include <InterViews/transformer.h>
+ #include <OS/math.h>
+
#include <stream.h>
#include <IV-2_6/_enter.h>
***************
*** 173,180 ****
g->Parent()->TotalTransformation(t);
t.Invert();
! Coord cx = round(refx);
! Coord cy = round(refy);
grid->Constrain(cx, cy);
--- 175,182 ----
g->Parent()->TotalTransformation(t);
t.Invert();
! Coord cx = Math::round(refx);
! Coord cy = Math::round(refy);
grid->Constrain(cx, cy);
Index: Unidraw/catalog.c
diff -c Unidraw/catalog.c:1.1 Unidraw/catalog.c:1.2
*** Unidraw/catalog.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/catalog.c Thu Jun 14 10:21:58 2001
***************
*** 52,57 ****
--- 52,58 ----
#include <InterViews/transformer.h>
#include <IV-2_6/InterViews/world.h>
+ #include <OS/math.h>
#include <OS/memory.h>
#include <IV-2_6/_enter.h>
***************
*** 68,73 ****
--- 69,75 ----
#include <unistd.h>
#endif
#include <sys/file.h>
+ #include <fstream.h>
#ifdef __DECCXX
extern "C" {
***************
*** 104,112 ****
static const char* HexEncode (
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
! unsigned int r = round(ir * color_base);
! unsigned int g = round(ig * color_base);
! unsigned int b = round(ib * color_base);
static char enc[hex_encode+1];
enc[hex_encode] = '\0';
--- 106,114 ----
static const char* HexEncode (
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
! unsigned int r = Math::round(ir * color_base);
! unsigned int g = Math::round(ig * color_base);
! unsigned int b = Math::round(ib * color_base);
static char enc[hex_encode+1];
enc[hex_encode] = '\0';
***************
*** 143,149 ****
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
ColorIntensity igray = 0.30 * ir + 0.59 * ig + 0.11 * ib;
! unsigned int gray = round(igray * color_base);
static char enc[hex_gray_encode+1];
enc[hex_gray_encode] = '\0';
--- 145,151 ----
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
ColorIntensity igray = 0.30 * ir + 0.59 * ig + 0.11 * ib;
! unsigned int gray = Math::round(igray * color_base);
static char enc[hex_gray_encode+1];
enc[hex_gray_encode] = '\0';
***************
*** 438,444 ****
if (edInfo == nil) {
filebuf fbuf;
ok = fbuf.open((char*) name, input) != 0;
-
if (ok) {
istream in(&fbuf);
edInfo = ReadEditorInfo(in);
--- 440,445 ----
***************
*** 655,661 ****
for (int i = 0; !in.eof() && !FoundDelim(delim, *extra_data); ++i) {
char c;
in.get(c);
! extra_data->Insert((void*) c, i);
}
}
--- 656,662 ----
for (int i = 0; !in.eof() && !FoundDelim(delim, *extra_data); ++i) {
char c;
in.get(c);
! extra_data->Insert((void*)(unsigned int)c, i);
}
}
***************
*** 1217,1225 ****
}
if (defined && in.good()) {
! int ir = round(r * float(0xffff));
! int ig = round(g * float(0xffff));
! int ib = round(b * float(0xffff));
color = FindColor(name, ir, ig, ib);
}
--- 1218,1226 ----
}
if (defined && in.good()) {
! int ir = Math::round(r * float(0xffff));
! int ig = Math::round(g * float(0xffff));
! int ib = Math::round(b * float(0xffff));
color = FindColor(name, ir, ig, ib);
}
***************
*** 1417,1423 ****
0x0505, 0x0405, 0x0401, 0x0001,
0x0000
};
! return shades[round(graylevel * (SHADES - 1))];
}
static const int* ExpandToFullSize (const int* orig_data, int size) {
--- 1418,1424 ----
0x0505, 0x0405, 0x0401, 0x0001,
0x0000
};
! return shades[Math::round(graylevel * (SHADES - 1))];
}
static const int* ExpandToFullSize (const int* orig_data, int size) {
Index: Unidraw/catcmds.c
diff -c Unidraw/catcmds.c:1.1 Unidraw/catcmds.c:1.2
*** Unidraw/catcmds.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/catcmds.c Thu Jun 14 10:21:58 2001
***************
*** 47,52 ****
--- 47,53 ----
#include <stdlib.h>
#include <stream.h>
#include <string.h>
+ #include <fstream.h>
/*****************************************************************************/
Index: Unidraw/dialogs.c
diff -c Unidraw/dialogs.c:1.1 Unidraw/dialogs.c:1.2
*** Unidraw/dialogs.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/dialogs.c Thu Jun 14 10:21:58 2001
***************
*** 44,49 ****
--- 44,51 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
***************
*** 139,145 ****
}
Interactor* AcknowledgeDialog::Interior () {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 141,147 ----
}
Interactor* AcknowledgeDialog::Interior () {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 188,194 ****
}
Interactor* ConfirmDialog::Interior () {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 190,196 ----
}
Interactor* ConfirmDialog::Interior () {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 284,290 ****
}
Interactor* UChooser::Interior (const char* acptlbl) {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
new HBox(_subtitle, new HGlue)
--- 286,292 ----
}
Interactor* UChooser::Interior (const char* acptlbl) {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
new HBox(_subtitle, new HGlue)
***************
*** 403,409 ****
}
Interactor* PrintDialog::Interior () {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(title, new HGlue),
new HBox(subtitle, new HGlue)
--- 405,411 ----
}
Interactor* PrintDialog::Interior () {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(title, new HGlue),
new HBox(subtitle, new HGlue)
***************
*** 485,491 ****
}
Interactor* GridDialog::Interior () {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
--- 487,493 ----
}
Interactor* GridDialog::Interior () {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
Index: Unidraw/editorinfo.c
diff -c Unidraw/editorinfo.c:1.1 Unidraw/editorinfo.c:1.2
*** Unidraw/editorinfo.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/editorinfo.c Thu Jun 14 10:21:58 2001
***************
*** 43,49 ****
virtual void* id();
virtual void* tag();
private:
! void* _idstring;
char* _tagstring;
};
--- 43,49 ----
virtual void* id();
virtual void* tag();
private:
! char* _idstring;
char* _tagstring;
};
Index: Unidraw/ellipses.c
diff -c Unidraw/ellipses.c:1.1 Unidraw/ellipses.c:1.2
*** Unidraw/ellipses.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/ellipses.c Thu Jun 14 10:21:59 2001
***************
*** 34,39 ****
--- 34,41 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
/*****************************************************************************/
Coord Ellipse::_x[8];
***************
*** 156,163 ****
if (t == nil) {
Coord px1, py1, px2, py2;
! px1 = round(float(_r1)*axis); py1 = round(float(_r2)*axis);
! px2 = round(float(_r1)*seen); py2 = round(float(_r2)*seen);
_x[0] = _x0 + px1; _y[0] = _y0 + py2;
_x[1] = _x0 - px1; _y[1] = _y[0];
--- 158,165 ----
if (t == nil) {
Coord px1, py1, px2, py2;
! px1 = Math::round(float(_r1)*axis); py1 = Math::round(float(_r2)*axis);
! px2 = Math::round(float(_r1)*seen); py2 = Math::round(float(_r2)*seen);
_x[0] = _x0 + px1; _y[0] = _y0 + py2;
_x[1] = _x0 - px1; _y[1] = _y[0];
***************
*** 185,192 ****
for (int i = 0; i < 8; ++i) {
t->Transform(tx[i], ty[i], tmpx, tmpy);
! _x[i] = round(tmpx);
! _y[i] = round(tmpy);
}
}
}
--- 187,194 ----
for (int i = 0; i < 8; ++i) {
t->Transform(tx[i], ty[i], tmpx, tmpy);
! _x[i] = Math::round(tmpx);
! _y[i] = Math::round(tmpy);
}
}
}
***************
*** 235,241 ****
void S_Ellipse::draw (Canvas *c, Graphic* gs) {
if (!gs->GetBrush()->None()) {
update(gs);
! #if __GNUC__>=2 && __GNUC_MINOR__>=5
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
--- 237,243 ----
void S_Ellipse::draw (Canvas *c, Graphic* gs) {
if (!gs->GetBrush()->None()) {
update(gs);
! #if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
***************
*** 352,358 ****
_p->FillEllipse(c, _x0, _y0, _r1, _r2);
}
if (!gs->GetBrush()->None()) {
! #if __GNUC__>=2 && __GNUC_MINOR__>=5
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
--- 354,360 ----
_p->FillEllipse(c, _x0, _y0, _r1, _r2);
}
if (!gs->GetBrush()->None()) {
! #if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
Index: Unidraw/geomobjs.c
diff -c Unidraw/geomobjs.c:1.1 Unidraw/geomobjs.c:1.2
*** Unidraw/geomobjs.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/geomobjs.c Thu Jun 14 10:21:59 2001
***************
*** 29,34 ****
--- 29,35 ----
#include <Unidraw/Graphic/util.h>
#include <Unidraw/ulist.h>
+ #include <OS/math.h>
#include <OS/memory.h>
#include <IV-2_6/_enter.h>
***************
*** 241,252 ****
GrowBuf();
}
if (mlcount == 0) {
! mlx[mlcount] = round(x0);
! mly[mlcount] = round(y0);
++mlcount;
}
! mlx[mlcount] = round(x1);
! mly[mlcount] = round(y1);
++mlcount;
}
--- 242,253 ----
GrowBuf();
}
if (mlcount == 0) {
! mlx[mlcount] = Math::round(x0);
! mly[mlcount] = Math::round(y0);
++mlcount;
}
! mlx[mlcount] = Math::round(x1);
! mly[mlcount] = Math::round(y1);
++mlcount;
}
Index: Unidraw/grblock.c
diff -c Unidraw/grblock.c:1.1 Unidraw/grblock.c:1.2
*** Unidraw/grblock.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/grblock.c Thu Jun 14 10:21:59 2001
***************
*** 39,44 ****
--- 39,46 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
#include <math.h>
#include <stdlib.h>
***************
*** 263,281 ****
if (p->width != np.width) {
hfactor = float(p->width) / float(np.width);
! np.x0 = round(hfactor * float(np.x0));
np.width = p->width;
! np.curx = round(hfactor * float(np.curx));
! np.curwidth = round(hfactor * float(np.curwidth));
! np.sx = round(hfactor * float(np.sx));
}
if (p->height != np.height) {
vfactor = float(p->height) / float(np.height);
! np.y0 = round(vfactor * float(np.y0));
np.height = p->height;
! np.cury = round(vfactor * float(np.cury));
! np.curheight = round(vfactor * float(np.curheight));
! np.sy = round(vfactor * float(np.sy));
}
}
--- 265,283 ----
if (p->width != np.width) {
hfactor = float(p->width) / float(np.width);
! np.x0 = Math::round(hfactor * float(np.x0));
np.width = p->width;
! np.curx = Math::round(hfactor * float(np.curx));
! np.curwidth = Math::round(hfactor * float(np.curwidth));
! np.sx = Math::round(hfactor * float(np.sx));
}
if (p->height != np.height) {
vfactor = float(p->height) / float(np.height);
! np.y0 = Math::round(vfactor * float(np.y0));
np.height = p->height;
! np.cury = Math::round(vfactor * float(np.cury));
! np.curheight = Math::round(vfactor * float(np.curheight));
! np.sy = Math::round(vfactor * float(np.sy));
}
}
***************
*** 328,339 ****
_graphic->Translate(dx, dy);
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = round((_x0 + dx - halfw)*factor + halfw);
! _y0 = round((_y0 + dy - halfh)*factor + halfh);
! p->width = round(p->width * factor);
! p->height = round(p->height * factor);
! p->curx = round(float(cx) * factor) - halfw;
! p->cury = round(float(cy) * factor) - halfh;
}
_mag *= factor;
}
--- 330,341 ----
_graphic->Translate(dx, dy);
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = Math::round((_x0 + dx - halfw)*factor + halfw);
! _y0 = Math::round((_y0 + dy - halfh)*factor + halfh);
! p->width = Math::round(p->width * factor);
! p->height = Math::round(p->height * factor);
! p->curx = Math::round(float(cx) * factor) - halfw;
! p->cury = Math::round(float(cy) * factor) - halfh;
}
_mag *= factor;
}
***************
*** 418,429 ****
cy = p->cury + halfh;
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = round((_x0 - halfw)*factor + halfw);
! _y0 = round((_y0 - halfh)*factor + halfh);
! p->width = round(p->width * factor);
! p->height = round(p->height * factor);
! p->curx = round(float(cx) * factor) - halfw;
! p->cury = round(float(cy) * factor) - halfh;
p->Update();
Draw();
--- 420,431 ----
cy = p->cury + halfh;
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = Math::round((_x0 - halfw)*factor + halfw);
! _y0 = Math::round((_y0 - halfh)*factor + halfh);
! p->width = Math::round(p->width * factor);
! p->height = Math::round(p->height * factor);
! p->curx = Math::round(float(cx) * factor) - halfw;
! p->cury = Math::round(floa...
[truncated message content] |
|
From: <ivt...@li...> - 2001-06-19 18:35:33
|
Patch: ivtools-010619-johnston-037
For: ivtools-0.9.4
Author: joh...@us...
Subject: bug fixes and compile time improvements for libstdc++v3/gcc-3.0
Requires:
This is an intermediate patch to ivtools-0.9.4. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- fixes a problem with importing files introduced when migrating away
from the use of istream::gets. istream::gets would automatically skip
the newline delimeter. When using istream::get in libstdc++ v3 I
needed to manually skip the newline delimeter.
- globally change optimization from -O6 to -O2, which makes gcc-3.0
compile time much more reasonable.
- finalizes necessary libstdc++ v3 iostream rewrites for when building
with ACE. These are untested however, because the only version of ACE
I've been able to use for the past year is the Debian binary, and it
is not yet available in a gcc-3.0 version.
Index: ComTerp/comhandler.c
diff -c ComTerp/comhandler.c:1.1 ComTerp/comhandler.c:1.2
*** ComTerp/comhandler.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/comhandler.c Tue Jun 19 11:24:47 2001
***************
*** 112,118 ****
--- 112,122 ----
return -1;
} else {
if (!comterp_->stack_empty()) {
+ #if __GNUG__<3
filebuf obuf(1);
+ #else
+ filebuf obuf(stdout, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr << "timeexpr result: ";
comterp_->print_stack_top(ostr);
***************
*** 138,144 ****
--- 142,153 ----
#else
vector<char> inv;
char ch;
+ #if __GNUG__<3
filebuf ibuf(fd);
+ #else
+ FILE* ifptr = fdopen(fd, "r");
+ filebuf ibuf(ifptr, ios_base::in);
+ #endif
istream istr(&ibuf);
// problem handling new-lines embedded in character strings
***************
*** 148,161 ****
char* inbuf = &inv[0];
#endif
! if (!comterp_ || !istr.good())
! return -1;
else if (!inbuf || !*inbuf) {
filebuf obuf(fd ? fd : 1);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
return 0;
}
if (!ComterpHandler::logger_mode()) {
comterp_->load_string(inbuf);
--- 157,184 ----
char* inbuf = &inv[0];
#endif
! boolean istr_good = istr.good();
! #if __GNUG__>=3
! fclose(ifptr);
! #endif
! if (!comterp_ || !istr_good)
! return -1;
else if (!inbuf || !*inbuf) {
+ #if __GNUG__<3
filebuf obuf(fd ? fd : 1);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
return 0;
+ #else
+ FILE* ofptr = nil;
+ filebuf obuf(fd ? ofptr = fdopen(fd, "w") : stdout, ios_base::out);
+ ostream ostr(&obuf);
+ ostr << "\n";
+ ostr.flush();
+ if (ofptr) fclose(ofptr);
+ return 0;
+ #endif
}
if (!ComterpHandler::logger_mode()) {
comterp_->load_string(inbuf);
***************
*** 165,179 ****
comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs;
int status = comterp_->ComTerp::run(false /* !once */, false /* !nested */);
! return (istr.good() ? 0 : -1) && status;
} else {
if (inbuf[0]!='\004')
cout << inbuf << "\n";
filebuf obuf(fd ? fd : 1);
ostream ostr(&obuf);
ostr << "\n";
ostr.flush();
! return (istr.good() && inbuf[0]!='\004') ? 0 : -1;
}
}
--- 188,211 ----
comterp_->_outfunc = (outfuncptr)&ComTerpServ::fd_fputs;
int status = comterp_->ComTerp::run(false /* !once */, false /* !nested */);
! return (istr_good ? 0 : -1) && status;
} else {
if (inbuf[0]!='\004')
cout << inbuf << "\n";
+ #if __GNUG__<3
filebuf obuf(fd ? fd : 1);
ostream ostr(&obuf);
ostr << "\n";
+ ostr.flush();
+ #else
+ FILE* ofptr = nil;
+ filebuf obuf(fd ? fdopen(fd, "w") : stdout, ios_base::out);
+ ostream ostr(&obuf);
+ ostr << "\n";
ostr.flush();
! if (ofptr) fclose(ofptr);
! #endif
! return (istr_good && inbuf[0]!='\004') ? 0 : -1;
}
}
Index: ComTerp/comterpserv.c
diff -c ComTerp/comterpserv.c:1.2 ComTerp/comterpserv.c:1.3
*** ComTerp/comterpserv.c:1.2 Thu Jun 14 10:21:26 2001
--- src/ComTerp/comterpserv.c Tue Jun 19 11:24:47 2001
***************
*** 33,38 ****
--- 33,39 ----
#include <string.h>
#if __GNUG__>=3
#include <fstream.h>
+ static char newline;
#endif
#if BUFSIZ>1024
***************
*** 156,162 ****
FILE* ifptr = fdopen(fd, "r");
filebuf fbuf(ifptr, ios_base::in);
istream in (&fbuf);
! in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
#endif
server->_instat = in.good();
--- 157,164 ----
FILE* ifptr = fdopen(fd, "r");
filebuf fbuf(ifptr, ios_base::in);
istream in (&fbuf);
! in.get(instr, BUFSIZ); // needs to be generalized with <vector.h>
! in.get(newline);
#endif
server->_instat = in.good();
Index: ComTerp/ctrlfunc.c
diff -c ComTerp/ctrlfunc.c:1.1 ComTerp/ctrlfunc.c:1.2
*** ComTerp/ctrlfunc.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/ctrlfunc.c Tue Jun 19 11:24:47 2001
***************
*** 33,38 ****
--- 33,42 ----
#define TITLE "CtrlFunc"
+ #if __GNUG__>=3
+ static char newline;
+ #endif
+
/*****************************************************************************/
QuitFunc::QuitFunc(ComTerp* comterp) : ComFunc(comterp) {
***************
*** 136,154 ****
--- 140,176 ----
return;
}
+ #if __GNUG__<3
filebuf ofbuf;
ofbuf.attach(socket.get_handle());
+ #else
+ FILE* ofptr = fdopen(socket.get_handle(), "w");
+ filebuf ofbuf(ofptr, ios_base::out);
+ #endif
ostream out(&ofbuf);
const char* cmdstr = cmdstrv.string_ptr();
out << cmdstr;
if (cmdstr[strlen(cmdstr)-1] != '\n') out << "\n";
out.flush();
+ #if __GNUG__>=3
+ fclose(ofptr);
+ #endif
if (nowaitv.is_false()) {
+ #if __GNUG__<3
filebuf ifbuf;
ifbuf.attach(socket.get_handle());
istream in(&ifbuf);
char* buf;
in.gets(&buf);
+ #else
+ FILE* ifptr = fdopen(socket.get_handle(), "r");
+ filebuf ifbuf(ifptr, ios_base::in);
+ istream in(&ifbuf);
+ char buf[BUFSIZ];
+ in.get(buf, BUFSIZ);
+ in.get(newline);
+ fclose(ifptr);
+ #endif
ComValue& retval = comterpserv()->run(buf, true);
push_stack(retval);
}
Index: ComTerp/parser.c
diff -c ComTerp/parser.c:1.2 ComTerp/parser.c:1.3
*** ComTerp/parser.c:1.2 Thu Jun 14 10:21:26 2001
--- src/ComTerp/parser.c Tue Jun 19 11:24:47 2001
***************
*** 29,34 ****
--- 29,38 ----
#define TITLE "Parser"
+ #if __GNUG__>=3
+ static char newline;
+ #endif
+
/*****************************************************************************/
Parser::Parser() : ComTerpModule()
***************
*** 136,142 ****
in.gets(&instr);
#else
char instr[BUFSIZ];
! in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
#endif
if (in.good()) {
int i = 0;
--- 140,147 ----
in.gets(&instr);
#else
char instr[BUFSIZ];
! in.get(instr, BUFSIZ); // needs to be generalized with <vector.h>
! in.get(newline);
#endif
if (in.good()) {
int i = 0;
Index: comterp/main.c
diff -c comterp/main.c:1.1 comterp/main.c:1.2
*** comterp/main.c:1.1 Thu Jan 4 15:31:45 2001
--- src/comterp_/main.c Tue Jun 19 11:24:49 2001
***************
*** 53,58 ****
--- 53,62 ----
FPointObj fp(0.,0.);
#endif
+ #if __GNUG__>=3
+ static int newline;
+ #endif
+
int main(int argc, char *argv[]) {
boolean server_flag = argc>1 && strcmp(argv[1], "server") == 0;
***************
*** 122,133 ****
--- 126,148 ----
if (!telcat_flag) {
+ #if __GNUG__<3
filebuf obuf;
obuf.attach(server.get_handle());
+ #else
+ FILE* ofptr = nil;
+ filebuf obuf(ofptr = fdopen(server.get_handle(), "w"), ios_base::out);
+ #endif
ostream out(&obuf);
+ #if __GNUG__<3
filebuf ibuf;
ibuf.attach(server.get_handle());
+ #else
+ FILE* ifptr = nil;
+ filebuf ibuf(ifptr = fdopen(server.get_handle(), "r"), ios_base::in);
+ #endif
+
istream in(&ibuf);
for (;;) {
***************
*** 135,140 ****
--- 150,156 ----
if (feof(inptr)) break;
out << buffer;
out.flush();
+ #if __GNUG__<3
char* inbuf;
char ch;
ch = in.get();
***************
*** 146,161 ****
--- 162,207 ----
if (client_flag)
cout << inbuf << "\n";
}
+ #else
+ char inbuf[BUFSIZ];
+ char ch;
+ ch = in.get();
+ if (ch == '>')
+ ch = in.get(); // ' '
+ else {
+ in.unget();
+ in.get(inbuf, BUFSIZ);
+ in.get(newline);
+ if (client_flag)
+ cout << inbuf << "\n";
+ }
+ #endif
}
+
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ if (ifptr) fclose(ifptr);
+ #endif
} else if (inptr) {
+
+ #if __GNUG__<3
filebuf inbuf;
inbuf.attach(fileno(inptr));
+ #else
+ filebuf inbuf(inptr, ios_base::in);
+ #endif
istream in(&inbuf);
+
+ #if __GNUG__<3
filebuf obuf;
obuf.attach(server.get_handle());
+ #else
+ FILE* ofptr = nil;
+ filebuf obuf(fdopen(server.get_handle(), "w"), ios_base::out);
+ #endif
ostream out(&obuf);
char buffer[BUFSIZ*BUFSIZ];
***************
*** 165,170 ****
--- 211,219 ----
out.write(buffer, in.gcount());
}
out.flush();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
} else
cerr << "comterp: unable to open file: " << argv[4] << "\n";
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.9 OverlayUnidraw/ovimport.c:1.10
*** OverlayUnidraw/ovimport.c:1.9 Fri Jun 15 15:44:34 2001
--- src/OverlayUnidraw/ovimport.c Tue Jun 19 11:24:57 2001
***************
*** 114,120 ****
--- 114,124 ----
implementPtrList(StreamList,istream)
implementPtrList(HandlerList,ReadImageHandler)
+ #if __GNUG__>=3
+ static char newline;
+ #endif
+
/*****************************************************************************/
static int hexmap[] = {
***************
*** 465,470 ****
--- 469,475 ----
#else
char buffer[BUFSIZ];
in.get(buffer, BUFSIZ);
+ in.get(newline);
#endif
if (strncmp(buffer, "P6", 2)) {
***************
*** 478,483 ****
--- 483,489 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
} while (buffer[0] == '#');
sscanf(buffer, "%d %d", &width, &height);
***************
*** 486,491 ****
--- 492,498 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
int maxval;
sscanf(buffer, "%d", &maxval);
***************
*** 1892,1897 ****
--- 1899,1905 ----
#else
char buffer[BUFSIZ];
in.get(buffer, BUFSIZ);
+ in.get(newline);
#endif
do { // CREATOR and other comments
***************
*** 1899,1904 ****
--- 1907,1913 ----
in.gets(&buffer);
#else
in.get(buffer, BUFSIZ);
+ in.get(newline);
#endif
} while (buffer[0] == '#');
***************
*** 1908,1920 ****
in.gets(&buffer);
#else
in.get(buffer, BUFSIZ);
#endif
sscanf(buffer, "%d", &nrows);
}
#if __GNUG__<3
in.gets(&buffer);
#else
! in.get(buffer, BUFSIZ);
#endif
int maxval;
sscanf(buffer, "%d", &maxval);
--- 1917,1930 ----
in.gets(&buffer);
#else
in.get(buffer, BUFSIZ);
+ in.get(newline);
#endif
sscanf(buffer, "%d", &nrows);
}
#if __GNUG__<3
in.gets(&buffer);
#else
! in.get(buffer, BUFSIZ, '\n');
#endif
int maxval;
sscanf(buffer, "%d", &maxval);
***************
*** 2327,2332 ****
--- 2337,2343 ----
#else
char buffer[BUFSIZ];
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
do { // CREATOR and other comments
***************
*** 2334,2339 ****
--- 2345,2351 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
} while (buffer[0] == '#');
int nrows, ncols;
***************
*** 2342,2347 ****
--- 2354,2360 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
int maxval;
sscanf(buffer, "%d", &maxval);
***************
*** 2651,2656 ****
--- 2664,2670 ----
#else
char buffer[BUFSIZ];
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
boolean asciiflag = strncmp("P1", buffer, 2) == 0;
***************
*** 2660,2665 ****
--- 2674,2680 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
} while (buffer[0] == '#');
***************
*** 2669,2674 ****
--- 2684,2690 ----
in.gets(&buffer);
#else
in.get(buffer,BUFSIZ);
+ in.get(newline);
#endif
sscanf(buffer, "%d", &nrows);
}
Index: config_iv/iv-cygwin.cf
diff -c config_iv/iv-cygwin.cf:1.1 config_iv/iv-cygwin.cf:1.2
*** config_iv/iv-cygwin.cf:1.1 Thu Jan 4 15:34:07 2001
--- config/InterViews/iv-cygwin.cf Tue Jun 19 11:25:03 2001
***************
*** 3,9 ****
--- 3,13 ----
* Set up to use gcc in local.def
*/
+ #if LibStdCPlusPlusV3
+ #define OptimizeCCFlags -O2
+ #else
#define OptimizeCCFlags -O6
+ #endif
#define TIFFOptimizeCFlags -O
#include <InterViews/xparams.cf>
Index: config_iv/iv-freebsd.cf
diff -c config_iv/iv-freebsd.cf:1.1 config_iv/iv-freebsd.cf:1.2
*** config_iv/iv-freebsd.cf:1.1 Thu Jan 4 15:34:07 2001
--- config/InterViews/iv-freebsd.cf Tue Jun 19 11:25:03 2001
***************
*** 3,9 ****
--- 3,13 ----
* Set up to use gcc in local.def
*/
+ #if LibStdCPlusPlusV3
+ #define OptimizeCCFlags -O2
+ #else
#define OptimizeCCFlags -O6
+ #endif
#define TIFFOptimizeCFlags -O
#define TIFFStdCDefines -DHAVE_IEEEFP
Index: config_iv/iv-linux.cf
diff -c config_iv/iv-linux.cf:1.1 config_iv/iv-linux.cf:1.2
*** config_iv/iv-linux.cf:1.1 Thu Jan 4 15:34:07 2001
--- config/InterViews/iv-linux.cf Tue Jun 19 11:25:03 2001
***************
*** 3,9 ****
--- 3,13 ----
* Set up to use gcc in local.def
*/
+ #if LibStdCPlusPlusV3
+ #define OptimizeCCFlags -O2
+ #else
#define OptimizeCCFlags -O6
+ #endif
#define TIFFOptimizeCFlags -O
#if 0
Index: config_iv/iv-netbsd.cf
diff -c config_iv/iv-netbsd.cf:1.1 config_iv/iv-netbsd.cf:1.2
*** config_iv/iv-netbsd.cf:1.1 Thu Jan 4 15:34:07 2001
--- config/InterViews/iv-netbsd.cf Tue Jun 19 11:25:03 2001
***************
*** 3,9 ****
--- 3,13 ----
* Set up to use gcc in local.def
*/
+ #if LibStdCPlusPlusV3
+ #define OptimizeCCFlags -O2
+ #else
#define OptimizeCCFlags -O6
+ #endif
#define TIFFOptimizeCFlags -O
#ifndef ExtraCCLdFlags
*** /dev/null Tue Jun 19 11:25:07 PDT 2001
--- patches/ivtools-010619-johnston-037
*************** patches/ivtools-010619-johnston-037
*** 0 ****
--- 1 ----
+ ivtools-010619-johnston-037
|
|
From: <ivt...@li...> - 2001-06-15 23:28:02
|
Patch: ivtools-010615-johnston-036 For: ivtools-0.9.3 Author: joh...@us... Subject: finalize 0.9.4 Requires: This is an intermediate patch to ivtools-0.9.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - finalize 0.9.4 Index: top_ivtools/CHANGES diff -c top_ivtools/CHANGES:1.4 top_ivtools/CHANGES:1.5 *** top_ivtools/CHANGES:1.4 Fri May 18 11:50:50 2001 --- ./CHANGES Fri Jun 15 16:24:50 2001 *************** *** 1,3 **** --- 1,44 ---- + Jun 15th 2001 ivtools-0.9.4 + + - monstrous amount of changes required by forthcoming gcc-3.0. The + heavy lifting was mostly due to the absence of filebuf::attach in v3 + of libstdc++. + + Other issues to deal with: templated iostreams, change to meaning of + -U (undefine compiler option), can't have static const char + initializes in class definition, need class between "friend" and class + name, use of <iosfwd>, missing ostream::form, missing istream::gets, + round needs to be Math::round. + + Unfortunately, gdb can't debug C++ generated by gcc-3.0 yet, so + although things mostly work, I can't resolve problems with the wild + iostream hacking I did. My recommendation: stick to gcc-2.95.* for + now. + + - add an :eps and :idraw option to the comdraw export keyboard command. + Now you can generate these formats as well as the default drawtool + format. + + - fix export of EPS with color imagery, by correctly reading radio + button for output format on export dialog box. Before it only + generated the idraw format, which is EPS, but has only graylevel + rasters visible to any PostScript interpreter (the color information + is in comments). + + - change the declaration of an argument to getsockname() from unsigned + int to socklen_t (in Dispatch/rpcbuf.c). This fixes the problem with + portability caused by the fact signedness of a socklen_t is + unstandardized. + + - restore full support for XBM (X bitmap) images to drawtool and its + derivatives. idraw was always XBM capable, but drawtool lost support + for this a while back. + + From John Denker (jsd at research.att.com): + + >Here is a patch that will allow ivtools to correctly output text + >objects that contain backslashes. + May 18th 2001 ivtools-0.9.3 Keyboard Commands: Index: top_ivtools/INSTALL diff -c top_ivtools/INSTALL:1.5 top_ivtools/INSTALL:1.6 *** top_ivtools/INSTALL:1.5 Fri May 18 11:50:50 2001 --- ./INSTALL Fri Jun 15 16:24:50 2001 *************** *** 1,7 **** INSTALL for ivtools-0.9 ! Instructions for building ivtools-0.9.3 from source: 0. Compilation Environment --- 1,7 ---- INSTALL for ivtools-0.9 ! Instructions for building ivtools-0.9.4 from source: 0. Compilation Environment *************** *** 13,27 **** README.cygwin for details. 0.b. The gcc compiler. Recently we've been building and testing with ! egcs-1.0.3, gcc-2.8.1, and gcc-2.95.2. gcc-2.7.2 would still work, as ! probably would gcc-2.6.3. You will also need an equivalent copy of libstdc++. The libstdc++ version numbers stay roughly in synch with the gcc version numbers. If you have gcc-2.8.1 you'd want libstdc++-2.8.1, etc.. Versions more recent than gcc-2.95.? are not approved by the gcc ! steering committee at this date, so compilation support for them has ! not been integrated as of yet. Also be aware that sometimes the include files for libstdc++ are in /usr/local/include/g++-2, a place that cannot be auto-determined by --- 13,28 ---- README.cygwin for details. 0.b. The gcc compiler. Recently we've been building and testing with ! egcs-1.0.3, gcc-2.95.*, and gcc-3.0. gcc-2.8.1 would still work, as ! probably would gcc-2.7.2. You will also need an equivalent copy of libstdc++. The libstdc++ version numbers stay roughly in synch with the gcc version numbers. If you have gcc-2.8.1 you'd want libstdc++-2.8.1, etc.. Versions more recent than gcc-2.95.? are not approved by the gcc ! steering committee at this date. But attempts have been made to get ! everything compiled with the forthcoming gcc-3.0 if you want to try it ! out. Also be aware that sometimes the include files for libstdc++ are in /usr/local/include/g++-2, a place that cannot be auto-determined by Index: top_ivtools/MANIFEST diff -c top_ivtools/MANIFEST:1.5 top_ivtools/MANIFEST:1.6 *** top_ivtools/MANIFEST:1.5 Fri May 18 11:50:50 2001 --- ./MANIFEST Fri Jun 15 16:24:50 2001 *************** *** 1535,1540 **** --- 1535,1542 ---- ivtools-0.9/src/include/Unidraw/viewer.h ivtools-0.9/src/include/ivstd/Imakefile ivtools-0.9/src/include/ivstd/Makefile + ivtools-0.9/src/include/ivstd/fstream.h + ivtools-0.9/src/include/ivstd/iosfwd ivtools-0.9/src/include/ivstd/math.h ivtools-0.9/src/include/ivstd/nan.h ivtools-0.9/src/include/ivstd/osfcn.h Index: top_ivtools/MANIFEST.comterp diff -c top_ivtools/MANIFEST.comterp:1.1 top_ivtools/MANIFEST.comterp:1.2 *** top_ivtools/MANIFEST.comterp:1.1 Thu Jan 4 15:31:33 2001 --- ./MANIFEST.comterp Fri Jun 15 16:24:50 2001 *************** *** 246,251 **** --- 246,253 ---- src/include/Unidraw/leave-scope.h src/include/Unidraw/ulist.h src/include/ivstd/Imakefile + src/include/ivstd/fstream.h + src/include/ivstd/iosfwd src/include/ivstd/math.h src/include/ivstd/osfcn.h src/include/ivstd/signal.h Index: top_ivtools/README diff -c top_ivtools/README:1.4 top_ivtools/README:1.5 *** top_ivtools/README:1.4 Fri May 18 11:50:50 2001 --- ./README Fri Jun 15 16:24:50 2001 *************** *** 2,8 **** README for ivtools 0.9 ! This directory contains a release of ivtools 0.9.3. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. --- 2,8 ---- README for ivtools 0.9 ! This directory contains a release of ivtools 0.9.4. You should read the rest of this file for information on what ivtools is and the INSTALL file for instructions on how to build it. *************** *** 115,128 **** * More ivtools details ivtools is known to build with many versions of gcc (<= gcc-2.7.2, >= ! gcc-2.8.1, >= egcs-1.0.1) and on a variety of Unix'es: SunOS 4.1 ! (MIT's X11R5), Solaris 2.6 (X11R6), Irix 5.2 (SGI's X11R5), Linux 1.2 ! (Slackware 3.0, XFree86 3.1), Linux 2.* (RedHat 4.0 thru 6.0, Debian ! 2.*), NetBSD, and perhaps now FreeBSD. There are contributed configs ! that are out of date for HPUX and Dec Alpha. Recently it has been ! built on Windows NT 4.0 using Cygwin from Cygnus Solutions (see ! README.cygwin). You can pick up Linux-ELF binaries from the ivtools ! web page (http://www.ivtools.org). If you have a question about this software, desire to add code, found a bug, want to request a feature, or wonder how to get further --- 115,128 ---- * More ivtools details ivtools is known to build with many versions of gcc (<= gcc-2.7.2, >= ! gcc-2.8.1, >= egcs-1.0.1, even gcc-3.0) and on a variety of Unix'es: ! SunOS 4.1 (MIT's X11R5), Solaris 2.6 (X11R6), Irix 5.2 (SGI's X11R5), ! Linux 1.2 (Slackware 3.0, XFree86 3.1), Linux 2.* (RedHat 4.0 thru ! 6.0, Debian 2.*), NetBSD, and perhaps now FreeBSD. There are ! contributed configs that are out of date for HPUX and Dec ! Alpha. Recently it has been built on Windows NT 4.0 using Cygwin from ! Cygnus Solutions (see README.cygwin). You can pick up Linux-ELF ! binaries from the ivtools web page (http://www.ivtools.org). If you have a question about this software, desire to add code, found a bug, want to request a feature, or wonder how to get further Index: top_ivtools/VERSION diff -c top_ivtools/VERSION:1.4 top_ivtools/VERSION:1.5 *** top_ivtools/VERSION:1.4 Fri May 18 11:50:50 2001 --- ./VERSION Fri Jun 15 16:24:50 2001 *************** *** 1 **** ! Release 0.9.3 --- 1 ---- ! Release 0.9.4 Index: include_std/version.h diff -c include_std/version.h:1.4 include_std/version.h:1.5 *** include_std/version.h:1.4 Fri May 18 11:51:17 2001 --- src/include/ivstd/version.h Fri Jun 15 16:25:50 2001 *************** *** 1,3 **** ! #define IvtoolsVersion 0.9.3 ! #define VersionString "0.9.3" ! #define ReleaseString "ivtools-0.9.3" --- 1,3 ---- ! #define IvtoolsVersion 0.9.4 ! #define VersionString "0.9.4" ! #define ReleaseString "ivtools-0.9.4" Index: config_ivtools/params.def diff -c config_ivtools/params.def:1.5 config_ivtools/params.def:1.6 *** config_ivtools/params.def:1.5 Fri May 18 11:51:21 2001 --- config/params.def Fri Jun 15 16:26:01 2001 *************** *** 27,33 **** * Name of the software release */ #ifndef Release ! #define Release ivtools-0.9.3 #endif RELEASE = Release --- 27,33 ---- * Name of the software release */ #ifndef Release ! #define Release ivtools-0.9.4 #endif RELEASE = Release *************** *** 36,42 **** * VersionNumber */ #ifndef Version ! #define Version 0.9.3 #endif VERSION = Version --- 36,42 ---- * VersionNumber */ #ifndef Version ! #define Version 0.9.4 #endif VERSION = Version *** /dev/null Fri Jun 15 16:26:02 PDT 2001 --- patches/ivtools-010615-johnston-036 *************** patches/ivtools-010615-johnston-036 *** 0 **** --- 1 ---- + ivtools-010615-johnston-036 |
|
From: <ivt...@li...> - 2001-06-15 22:47:26
|
Patch: ivtools-010615-johnston-035
For: ivtools-0.9.3
Author: joh...@us...
Subject: more work to keep export(:eps|:idraw) on track
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- more work to polish the :eps and :idraw arguments to the new comdraw
export command.
- Also need to avoid a #include of fstream.h if not using gcc-3.0
Index: Unidraw/catalog.c
diff -c Unidraw/catalog.c:1.2 Unidraw/catalog.c:1.3
*** Unidraw/catalog.c:1.2 Thu Jun 14 10:21:58 2001
--- src/Unidraw/catalog.c Fri Jun 15 15:44:32 2001
***************
*** 69,75 ****
--- 69,77 ----
#include <unistd.h>
#endif
#include <sys/file.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
#ifdef __DECCXX
extern "C" {
Index: Unidraw/catcmds.c
diff -c Unidraw/catcmds.c:1.2 Unidraw/catcmds.c:1.3
*** Unidraw/catcmds.c:1.2 Thu Jun 14 10:21:58 2001
--- src/Unidraw/catcmds.c Fri Jun 15 15:44:32 2001
***************
*** 47,53 ****
--- 47,55 ----
#include <stdlib.h>
#include <stream.h>
#include <string.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
/*****************************************************************************/
Index: OverlayUnidraw/ovarrow.c
diff -c OverlayUnidraw/ovarrow.c:1.1 OverlayUnidraw/ovarrow.c:1.2
*** OverlayUnidraw/ovarrow.c:1.1 Thu Jan 4 15:33:05 2001
--- src/OverlayUnidraw/ovarrow.c Fri Jun 15 15:44:34 2001
***************
*** 620,626 ****
boolean ArrowMultiLinePS::Definition (ostream& out) {
Command* cmd = GetCommand();
! boolean idraw_format = false;
if (cmd) {
if (cmd->IsA(OVPRINT_CMD))
idraw_format = ((OvPrintCmd*)cmd)->idraw_format();
--- 620,626 ----
boolean ArrowMultiLinePS::Definition (ostream& out) {
Command* cmd = GetCommand();
! boolean idraw_format = OverlayPS::idraw_format;
if (cmd) {
if (cmd->IsA(OVPRINT_CMD))
idraw_format = ((OvPrintCmd*)cmd)->idraw_format();
Index: OverlayUnidraw/ovcatalog.c
diff -c OverlayUnidraw/ovcatalog.c:1.2 OverlayUnidraw/ovcatalog.c:1.3
*** OverlayUnidraw/ovcatalog.c:1.2 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovcatalog.c Fri Jun 15 15:44:34 2001
***************
*** 66,72 ****
--- 66,74 ----
#include <stdio.h>
#include <stream.h>
#include <string.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
/*****************************************************************************/
Index: OverlayUnidraw/ovexport.c
diff -c OverlayUnidraw/ovexport.c:1.3 OverlayUnidraw/ovexport.c:1.4
*** OverlayUnidraw/ovexport.c:1.3 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovexport.c Fri Jun 15 15:44:34 2001
***************
*** 59,65 ****
--- 59,67 ----
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
/*****************************************************************************/
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.8 OverlayUnidraw/ovimport.c:1.9
*** OverlayUnidraw/ovimport.c:1.8 Thu Jun 14 16:29:01 2001
--- src/OverlayUnidraw/ovimport.c Fri Jun 15 15:44:34 2001
***************
*** 82,88 ****
--- 82,92 ----
#include <OS/list.h>
#include <math.h>
+ #if __GNUG__<3
+ #include <pfstream.h>
+ #else
#include <fstream.h>
+ #endif
#include <stdio.h>
#include <stream.h>
#include <string.h>
Index: OverlayUnidraw/ovprint.c
diff -c OverlayUnidraw/ovprint.c:1.2 OverlayUnidraw/ovprint.c:1.3
*** OverlayUnidraw/ovprint.c:1.2 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovprint.c Fri Jun 15 15:44:34 2001
***************
*** 58,64 ****
--- 58,66 ----
#include <stdlib.h>
#include <stream.h>
#include <string.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
/*****************************************************************************/
Index: OverlayUnidraw/ovpsview.c
diff -c OverlayUnidraw/ovpsview.c:1.2 OverlayUnidraw/ovpsview.c:1.3
*** OverlayUnidraw/ovpsview.c:1.2 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovpsview.c Fri Jun 15 15:44:34 2001
***************
*** 101,106 ****
--- 101,108 ----
/*****************************************************************************/
+ boolean OverlayPS::idraw_format = true;
+
ClassId OverlayPS::GetClassId () { return OVERLAY_PS; }
boolean OverlayPS::IsA (ClassId id) {
***************
*** 111,116 ****
--- 113,122 ----
_command = nil;
}
+ void OverlayPS::Creator (ostream& out) {
+ out << "%%Creator: " << (idraw_format ? "idraw" : "unidraw") << "\n";
+ }
+
UList* OverlayPS::GetPSFonts () {
if (_fonts == nil) {
_fonts = new UList;
***************
*** 299,308 ****
boolean OverlayIdrawPS::IsA (ClassId id) {
return OVERLAY_IDRAW_PS == id || OverlaysPS::IsA(id);
- }
-
- void OverlayIdrawPS::Creator (ostream& out) {
- out << "%%Creator: idraw\n";
}
void OverlayIdrawPS::Prologue (ostream& out) {
--- 305,310 ----
Index: OverlayUnidraw/ovpsview.h
diff -c OverlayUnidraw/ovpsview.h:1.1 OverlayUnidraw/ovpsview.h:1.2
*** OverlayUnidraw/ovpsview.h:1.1 Thu Jan 4 15:33:06 2001
--- src/OverlayUnidraw/ovpsview.h Fri Jun 15 15:44:34 2001
***************
*** 59,64 ****
--- 59,69 ----
// of a tree of components or not.
OverlayComp* GetOverlayComp();
+
+ virtual void Creator(ostream&);
+ // output idraw as creator
+
+ static boolean idraw_format;
protected:
OverlayPS(OverlayComp* = nil);
***************
*** 112,118 ****
protected:
virtual void MiscProcs(ostream&);
- virtual void Creator(ostream&);
virtual void ArrowHeader(ostream&);
virtual void ConstProcs(ostream&);
virtual void GridSpacing(ostream&);
--- 117,122 ----
Index: OverlayUnidraw/ovraster.c
diff -c OverlayUnidraw/ovraster.c:1.5 OverlayUnidraw/ovraster.c:1.6
*** OverlayUnidraw/ovraster.c:1.5 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovraster.c Fri Jun 15 15:44:34 2001
***************
*** 361,370 ****
Coord w = raster->Width();
Coord h = raster->Height();
! boolean idraw_format = false;
! if (GetCommand()->IsA(OV_EXPORT_CMD))
idraw_format = ((OvExportCmd*)GetCommand())->idraw_format();
! else if (GetCommand()->IsA(OVPRINT_CMD))
idraw_format = ((OvPrintCmd*)GetCommand())->idraw_format();
if (idraw_format) {
--- 361,370 ----
Coord w = raster->Width();
Coord h = raster->Height();
! boolean idraw_format = OverlayPS::idraw_format;
! if (GetCommand() && GetCommand()->IsA(OV_EXPORT_CMD))
idraw_format = ((OvExportCmd*)GetCommand())->idraw_format();
! else if (GetCommand() && GetCommand()->IsA(OVPRINT_CMD))
idraw_format = ((OvPrintCmd*)GetCommand())->idraw_format();
if (idraw_format) {
Index: ComUnidraw/unifunc.c
diff -c ComUnidraw/unifunc.c:1.9 ComUnidraw/unifunc.c:1.10
*** ComUnidraw/unifunc.c:1.9 Fri Jun 15 14:57:11 2001
--- src/ComUnidraw/unifunc.c Fri Jun 15 15:44:37 2001
***************
*** 479,484 ****
--- 479,485 ----
compout(comp, out);
*out << ")\n";
} else {
+ OverlayPS::idraw_format = idraw_flag.is_true();
OverlayPS* psv = (OverlayPS*) comp->Create(POSTSCRIPT_VIEW);
comp->Attach(psv);
psv->Update();
Index: FrameUnidraw/framecatalog.c
diff -c FrameUnidraw/framecatalog.c:1.2 FrameUnidraw/framecatalog.c:1.3
*** FrameUnidraw/framecatalog.c:1.2 Thu Jun 14 10:22:10 2001
--- src/FrameUnidraw/framecatalog.c Fri Jun 15 15:44:38 2001
***************
*** 35,43 ****
#include <stdio.h>
#include <stream.h>
- #include <fstream.h>
#include <string.h>
#include <ctype.h>
/*****************************************************************************/
--- 35,45 ----
#include <stdio.h>
#include <stream.h>
#include <string.h>
#include <ctype.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: GraphUnidraw/graphcatalog.c
diff -c GraphUnidraw/graphcatalog.c:1.2 GraphUnidraw/graphcatalog.c:1.3
*** GraphUnidraw/graphcatalog.c:1.2 Thu Jun 14 10:22:12 2001
--- src/GraphUnidraw/graphcatalog.c Fri Jun 15 15:44:40 2001
***************
*** 48,57 ****
#include <InterViews/transformer.h>
- #include <fstream.h>
#include <stdio.h>
#include <stream.h>
#include <string.h>
/*****************************************************************************/
--- 48,59 ----
#include <InterViews/transformer.h>
#include <stdio.h>
#include <stream.h>
#include <string.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
Index: DrawServ/drawcatalog.c
diff -c DrawServ/drawcatalog.c:1.2 DrawServ/drawcatalog.c:1.3
*** DrawServ/drawcatalog.c:1.2 Thu Jun 14 10:22:14 2001
--- src/DrawServ/drawcatalog.c Fri Jun 15 15:44:41 2001
***************
*** 33,42 ****
#include <OverlayUnidraw/ovimport.h>
#include <TopoFace/topoedge.h>
#include <Attribute/paramlist.h>
- #include <fstream.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>
/*****************************************************************************/
--- 33,44 ----
#include <OverlayUnidraw/ovimport.h>
#include <TopoFace/topoedge.h>
#include <Attribute/paramlist.h>
#include <iostream.h>
#include <stdio.h>
#include <string.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
/*****************************************************************************/
*** /dev/null Fri Jun 15 15:44:47 PDT 2001
--- patches/ivtools-010615-johnston-035
*************** patches/ivtools-010615-johnston-035
*** 0 ****
--- 1 ----
+ ivtools-010615-johnston-035
|
|
From: <ivt...@li...> - 2001-06-15 22:01:34
|
Patch: ivtools-010615-johnston-034
For: ivtools-0.9.3
Author: joh...@us...
Subject: tweak to get EPS output from comdraw export command
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- tweak to get EPS output from comdraw export command working
Index: ComUnidraw/unifunc.c
diff -c ComUnidraw/unifunc.c:1.8 ComUnidraw/unifunc.c:1.9
*** ComUnidraw/unifunc.c:1.8 Fri Jun 15 10:57:15 2001
--- src/ComUnidraw/unifunc.c Fri Jun 15 14:57:11 2001
***************
*** 53,59 ****
--- 53,61 ----
#include <stdio.h>
#include <strstream.h>
#include <unistd.h>
+ #if __GNUG__>=3
#include <fstream.h>
+ #endif
#define TITLE "UnidrawFunc"
***************
*** 371,377 ****
#if __GNUG__<3
filebuf fbuf;
if (file.is_type(ComValue::StringType))
! fbuf.open(file.string_ptr(), input);
else if (sock.is_true()) {
#ifdef HAVE_ACE
--- 373,379 ----
#if __GNUG__<3
filebuf fbuf;
if (file.is_type(ComValue::StringType))
! fbuf.open(file.string_ptr(), "w");
else if (sock.is_true()) {
#ifdef HAVE_ACE
Index: ComUnidraw/unifunc.h
diff -c ComUnidraw/unifunc.h:1.6 ComUnidraw/unifunc.h:1.7
*** ComUnidraw/unifunc.h:1.6 Fri Jun 15 10:57:15 2001
--- src/ComUnidraw/unifunc.h Fri Jun 15 14:57:11 2001
***************
*** 136,142 ****
};
//: command to export a graphic file
! // export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- remote in drawtool (or other) format ";
class ExportFunc : public UnidrawFunc {
public:
ExportFunc(ComTerp* c, Editor* e, const char* appname=nil);
--- 136,142 ----
};
//: command to export a graphic file
! // export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- export in drawtool (or other) format ";
class ExportFunc : public UnidrawFunc {
public:
ExportFunc(ComTerp* c, Editor* e, const char* appname=nil);
*** /dev/null Fri Jun 15 14:57:22 PDT 2001
--- patches/ivtools-010615-johnston-034
*************** patches/ivtools-010615-johnston-034
*** 0 ****
--- 1 ----
+ ivtools-010615-johnston-034
|
|
From: <ivt...@li...> - 2001-06-15 18:01:05
|
Patch: ivtools-010615-johnston-033
For: ivtools-0.9.3
Author: joh...@us...
Subject: rough draft of adding EPS support to comdraw export command
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- rough draft of adding EPS support to the comdraw keyboard command
called export:
export(compview[,compview[,...compview]] [path]
:host host_str :port port_int :socket :string|:str
:eps :idraw) -- export in drawtool (or other) format
Index: ComUnidraw/unifunc.c
diff -c ComUnidraw/unifunc.c:1.7 ComUnidraw/unifunc.c:1.8
*** ComUnidraw/unifunc.c:1.7 Thu Jun 14 10:22:08 2001
--- src/ComUnidraw/unifunc.c Fri Jun 15 10:57:15 2001
***************
*** 30,35 ****
--- 30,36 ----
#include <OverlayUnidraw/ovcomps.h>
#include <OverlayUnidraw/ovimport.h>
#include <OverlayUnidraw/ovselection.h>
+ #include <OverlayUnidraw/ovpsview.h>
#include <OverlayUnidraw/ovviewer.h>
#include <OverlayUnidraw/ovviews.h>
#include <OverlayUnidraw/scriptview.h>
***************
*** 327,335 ****
const char* ExportFunc::docstring() {
const char* df =
#ifdef HAVE_ACE
! "%s(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str) -- export in %s format ";
#else
! "%s(compview[,compview[,...compview]] [path] :string|:str) -- export in %s format ";
#endif
if (!_docstring) {
_docstring = new char[strlen(df)+strlen(appname())+1];
--- 328,336 ----
const char* ExportFunc::docstring() {
const char* df =
#ifdef HAVE_ACE
! "%s(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- export in %s format ";
#else
! "%s(compview[,compview[,...compview]] [path] :string|:str :eps :idraw) -- export in %s format ";
#endif
if (!_docstring) {
_docstring = new char[strlen(df)+strlen(appname())+1];
***************
*** 344,349 ****
--- 345,352 ----
static int _sock_symid = symbol_add("socket");
static int _string_symid = symbol_add("string");
static int _str_symid = symbol_add("str");
+ static int _eps_symid = symbol_add("eps");
+ static int _idraw_symid = symbol_add("idraw");
ComValue compviewv(stack_arg(0));
ComValue file(stack_arg(1));
ComValue host(stack_key(_host_symid));
***************
*** 351,356 ****
--- 354,361 ----
ComValue sock(stack_key(_sock_symid));
ComValue string(stack_key(_string_symid));
ComValue str(stack_key(_str_symid));
+ ComValue eps_flag(stack_key(_eps_symid));
+ ComValue idraw_flag(stack_key(_idraw_symid));
reset_stack();
if (nargs()==0 || compviewv.null()
|| compviewv.type() == ComValue::BlankType) {
***************
*** 467,490 ****
ComponentView* view = (ComponentView*)compviewv.obj_val();
OverlayComp* comp = view ? (OverlayComp*)view->GetSubject() : nil;
if (!comp) return;
! *out << appname() << "(\n";
! compout(comp, out);
! *out << ")\n";
} else {
! *out << appname() << "(\n";
! AttributeValueList* avl = compviewv.array_val();
! Iterator i;
! for(avl->First(i);!avl->Done(i); ) {
! ComponentView* view = (ComponentView*)avl->GetAttrVal(i)->obj_val();
! OverlayComp* comp = view ? (OverlayComp*)view->GetSubject() : nil;
! if (!comp) break;
! compout(comp, out);
! avl->Next(i);
! if (!avl->Done(i)) *out << ",\n";
}
! *out << ")\n";
}
if (string.is_true()||str.is_true()) {
--- 472,522 ----
ComponentView* view = (ComponentView*)compviewv.obj_val();
OverlayComp* comp = view ? (OverlayComp*)view->GetSubject() : nil;
if (!comp) return;
! if (!eps_flag.is_true() && !idraw_flag.is_true()) {
! *out << appname() << "(\n";
! compout(comp, out);
! *out << ")\n";
! } else {
! OverlayPS* psv = (OverlayPS*) comp->Create(POSTSCRIPT_VIEW);
! comp->Attach(psv);
! psv->Update();
! psv->Emit(*out);
! comp->Detach(psv);
! delete psv;
! }
} else {
! if (!eps_flag.is_true() && !idraw_flag.is_true()) {
! *out << appname() << "(\n";
! AttributeValueList* avl = compviewv.array_val();
! Iterator i;
! for(avl->First(i);!avl->Done(i); ) {
! ComponentView* view = (ComponentView*)avl->GetAttrVal(i)->obj_val();
! OverlayComp* comp = view ? (OverlayComp*)view->GetSubject() : nil;
! if (!comp) break;
! compout(comp, out);
! avl->Next(i);
! if (!avl->Done(i)) *out << ",\n";
! }
! *out << ")\n";
! } else {
! AttributeValueList* avl = compviewv.array_val();
! Iterator i;
! for(avl->First(i);!avl->Done(i); ) {
! ComponentView* view = (ComponentView*)avl->GetAttrVal(i)->obj_val();
! OverlayComp* comp = view ? (OverlayComp*)view->GetSubject() : nil;
! if (!comp) break;
! OverlayPS* psv = (OverlayPS*) comp->Create(POSTSCRIPT_VIEW);
! comp->Attach(psv);
! psv->Update();
! psv->Emit(*out);
! comp->Detach(psv);
! delete psv;
! avl->Next(i);
! }
}
!
}
if (string.is_true()||str.is_true()) {
Index: ComUnidraw/unifunc.h
diff -c ComUnidraw/unifunc.h:1.5 ComUnidraw/unifunc.h:1.6
*** ComUnidraw/unifunc.h:1.5 Tue May 15 14:56:38 2001
--- src/ComUnidraw/unifunc.h Fri Jun 15 10:57:15 2001
***************
*** 136,142 ****
};
//: command to export a graphic file
! // export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str) -- remote in drawtool (or other) format ";
class ExportFunc : public UnidrawFunc {
public:
ExportFunc(ComTerp* c, Editor* e, const char* appname=nil);
--- 136,142 ----
};
//: command to export a graphic file
! // export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- remote in drawtool (or other) format ";
class ExportFunc : public UnidrawFunc {
public:
ExportFunc(ComTerp* c, Editor* e, const char* appname=nil);
Index: comdraw/README
diff -c comdraw/README:1.4 comdraw/README:1.5
*** comdraw/README:1.4 Tue May 15 15:05:09 2001
--- src/comdraw/README Fri Jun 15 10:57:16 2001
***************
*** 84,90 ****
error=save([pathstr]) -- command to save document (to pathname)
compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen
! export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str) -- remote in drawtool (or other) format
compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer
val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics
compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing.
--- 84,90 ----
error=save([pathstr]) -- command to save document (to pathname)
compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen
! export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- remote in drawtool (or other) format
compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer
val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics
compview=addtool(pathname) -- add button to toolbar based on zero-centered idraw drawing.
Index: man1_ivtools/comdraw.1
diff -c man1_ivtools/comdraw.1:1.4 man1_ivtools/comdraw.1:1.5
*** man1_ivtools/comdraw.1:1.4 Tue May 15 15:05:15 2001
--- src/man/man1/comdraw.1 Fri Jun 15 10:57:25 2001
***************
*** 92,98 ****
error=save([pathstr]) -- command to save document (to pathname)
compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen
! export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str) -- remote in drawtool (or other) format
compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer
val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics
--- 92,98 ----
error=save([pathstr]) -- command to save document (to pathname)
compview=import(pathstr :popen) -- import graphic file from pathname or URL, or from a command if :popen
! export(compview[,compview[,...compview]] [path] :host host_str :port port_int :socket :string|:str :eps :idraw) -- remote in drawtool (or other) format
compview=paste(compview [xscale yscale xoff yoff | a00,a01,a10,a11,a20,a21]) -- paste graphic into the viewer
val=pastemode([val] :get) -- toggle or set paste mode, default is 0, always paste new graphics
*** /dev/null Fri Jun 15 10:57:29 PDT 2001
--- patches/ivtools-010615-johnston-033
*************** patches/ivtools-010615-johnston-033
*** 0 ****
--- 1 ----
+ ivtools-010615-johnston-033
|
|
From: <ivt...@li...> - 2001-06-14 23:30:57
|
Patch: ivtools-010614-johnston-032
For: ivtools-0.9.3
Author: joh...@us...
Subject: this time fer sure
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- this time fer sure
Index: OverlayUnidraw/grayraster.c
diff -c OverlayUnidraw/grayraster.c:1.3 OverlayUnidraw/grayraster.c:1.4
*** OverlayUnidraw/grayraster.c:1.3 Thu Jun 14 16:09:47 2001
--- src/OverlayUnidraw/grayraster.c Thu Jun 14 16:29:01 2001
***************
*** 31,38 ****
#include <OS/math.h>
#include <math.h>
#include <nan.h>
- #undef max
- #undef min
#include <OverlayUnidraw/grayraster.h>
#include <OverlayUnidraw/ovcatalog.h>
--- 31,36 ----
***************
*** 41,46 ****
--- 39,47 ----
#include <OS/math.h>
#include <OS/memory.h>
#include <IV-X11/xdisplay.h>
+
+ #undef max
+ #undef min
/*****************************************************************************/
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.7 OverlayUnidraw/ovimport.c:1.8
*** OverlayUnidraw/ovimport.c:1.7 Thu Jun 14 10:22:04 2001
--- src/OverlayUnidraw/ovimport.c Thu Jun 14 16:29:01 2001
***************
*** 596,602 ****
--- 596,604 ----
istream* ifs = new istream(fbuf);
#endif
_helper.add_stream(ifs);
+ #if __GNUG__>=3
_helper.add_file(ifptr);
+ #endif
boolean empty;
int newfd;
Index: include_std/fstream.h
diff -c include_std/fstream.h:1.1 include_std/fstream.h:1.2
*** include_std/fstream.h:1.1 Thu Jun 14 10:22:34 2001
--- src/include/ivstd/fstream.h Thu Jun 14 16:29:05 2001
***************
*** 4,8 ****
--- 4,11 ----
#if __GNUG__>=3
#define input ios_base::in
#define output ios_base::out
+ #else
+ #define input "r"
+ #define output "w"
#endif
#endif
*** /dev/null Thu Jun 14 16:29:07 PDT 2001
--- patches/ivtools-010614-johnston-032
*************** patches/ivtools-010614-johnston-032
*** 0 ****
--- 1 ----
+ ivtools-010614-johnston-032
|
|
From: <ivt...@li...> - 2001-06-14 23:12:40
|
Patch: ivtools-010614-johnston-031 For: ivtools-0.9.3 Author: joh...@us... Subject: more tweaking Requires: This is an intermediate patch to ivtools-0.9.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: - more tweaking to get things compiling equally well with gcc-3.0 and gcc-2.95.* Index: OverlayUnidraw/grayraster.c diff -c OverlayUnidraw/grayraster.c:1.2 OverlayUnidraw/grayraster.c:1.3 *** OverlayUnidraw/grayraster.c:1.2 Thu Jun 14 10:22:04 2001 --- src/OverlayUnidraw/grayraster.c Thu Jun 14 16:09:47 2001 *************** *** 31,36 **** --- 31,38 ---- #include <OS/math.h> #include <math.h> #include <nan.h> + #undef max + #undef min #include <OverlayUnidraw/grayraster.h> #include <OverlayUnidraw/ovcatalog.h> *************** *** 455,460 **** --- 457,463 ---- newr = grayfract < 0.5 ? 0.0 : (grayfract-.5)*2; newg = grayfract < 0.5 ? grayfract*2 : 1.0 - (grayfract-.5)*2; newb = grayfract < 0.5 ? 1.0 - (grayfract-.5)*2 : 0.0; + newr = Math::max((float)0.0, newr); newg = Math::max((float)0.0, newg); newb = Math::max((float)0.0, newb); *** /dev/null Thu Jun 14 16:09:55 PDT 2001 --- patches/ivtools-010614-johnston-031 *************** patches/ivtools-010614-johnston-031 *** 0 **** --- 1 ---- + ivtools-010614-johnston-031 |
|
From: <ivt...@li...> - 2001-06-14 20:11:34
|
Patch: ivtools-010614-johnston-030
For: ivtools-0.9.3
Author: joh...@us...
Subject: even more touchups
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- even more touchups
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.4 ComTerp/comterp.c:1.5
*** ComTerp/comterp.c:1.4 Thu Jun 14 13:05:07 2001
--- src/ComTerp/comterp.c Thu Jun 14 13:09:34 2001
***************
*** 808,814 ****
#if __GNUG__<3
filebuf fbuf;
if (handler()) {
! int fd = max(1, handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
--- 808,814 ----
#if __GNUG__<3
filebuf fbuf;
if (handler()) {
! int fd = Math::max(1, handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
*** /dev/null Thu Jun 14 13:10:04 PDT 2001
--- patches/ivtools-010614-johnston-030
*************** patches/ivtools-010614-johnston-030
*** 0 ****
--- 1 ----
+ ivtools-010614-johnston-030
|
|
From: <ivt...@li...> - 2001-06-14 20:07:02
|
Patch: ivtools-010614-johnston-029
For: ivtools-0.9.3
Author: joh...@us...
Subject: more touchups
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- more touchups
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.3 ComTerp/comterp.c:1.4
*** ComTerp/comterp.c:1.3 Thu Jun 14 10:21:26 2001
--- src/ComTerp/comterp.c Thu Jun 14 13:05:07 2001
***************
*** 260,266 ****
if (stepflag()) {
#if __GNUG__<3
filebuf fbufout;
! fbufout.attach(handler() ? max(1, handler()->get_handle()) : fileno(stdout));
#else
FILE* ofptr = handler() ? fdopen(Math::max(1, handler()->get_handle()), "w") : stdout;
filebuf fbufout(ofptr, ios_base::out);
--- 260,266 ----
if (stepflag()) {
#if __GNUG__<3
filebuf fbufout;
! fbufout.attach(handler() ? Math::max(1, handler()->get_handle()) : fileno(stdout));
#else
FILE* ofptr = handler() ? fdopen(Math::max(1, handler()->get_handle()), "w") : stdout;
filebuf fbufout(ofptr, ios_base::out);
*** /dev/null Thu Jun 14 13:05:37 PDT 2001
--- patches/ivtools-010614-johnston-029
*************** patches/ivtools-010614-johnston-029
*** 0 ****
--- 1 ----
+ ivtools-010614-johnston-029
|
|
From: <ivt...@li...> - 2001-06-14 20:02:39
|
Patch: ivtools-010614-johnston-028
For: ivtools-0.9.3
Author: joh...@us...
Subject: more gcc-3.0 touchups
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- more gcc-3.0 touchups
Index: ComTerp/iofunc.c
diff -c ComTerp/iofunc.c:1.2 ComTerp/iofunc.c:1.3
*** ComTerp/iofunc.c:1.2 Thu Jun 14 10:21:26 2001
--- src/ComTerp/iofunc.c Thu Jun 14 13:01:04 2001
***************
*** 66,72 ****
filebuf * fbuf = new filebuf();
strmbuf = fbuf;
if (comterp()->handler()) {
! int fd = max(1, comterp()->handler()->get_handle());
fbuf->attach(fd);
} else
fbuf->attach(fileno(errflag.is_false() ? stdout : stderr));
--- 66,72 ----
filebuf * fbuf = new filebuf();
strmbuf = fbuf;
if (comterp()->handler()) {
! int fd = Math::max(1, comterp()->handler()->get_handle());
fbuf->attach(fd);
} else
fbuf->attach(fileno(errflag.is_false() ? stdout : stderr));
Index: ComTerp/postfunc.c
diff -c ComTerp/postfunc.c:1.2 ComTerp/postfunc.c:1.3
*** ComTerp/postfunc.c:1.2 Thu Jun 14 10:21:26 2001
--- src/ComTerp/postfunc.c Thu Jun 14 13:01:04 2001
***************
*** 45,51 ****
void PostFixFunc::execute() {
// print everything on the stack for this function
! #if __GNUG__>3
filebuf fbuf;
if (comterp()->handler()) {
int fd = Math::max(1, comterp()->handler()->get_handle());
--- 45,51 ----
void PostFixFunc::execute() {
// print everything on the stack for this function
! #if __GNUG__<3
filebuf fbuf;
if (comterp()->handler()) {
int fd = Math::max(1, comterp()->handler()->get_handle());
*** /dev/null Thu Jun 14 13:01:14 PDT 2001
--- patches/ivtools-010614-johnston-028
*************** patches/ivtools-010614-johnston-028
*** 0 ****
--- 1 ----
+ ivtools-010614-johnston-028
|
|
From: <ivt...@li...> - 2001-06-14 19:58:46
|
Patch: ivtools-010614-johnston-027
For: ivtools-0.9.3
Author: joh...@us...
Subject: added Math:: in front of max
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- added Math:: in front of max in helpfunc.c
Index: ComTerp/helpfunc.c
diff -c ComTerp/helpfunc.c:1.3 ComTerp/helpfunc.c:1.4
*** ComTerp/helpfunc.c:1.3 Thu Jun 14 10:21:26 2001
--- src/ComTerp/helpfunc.c Thu Jun 14 12:56:20 2001
***************
*** 124,130 ****
#if __GNUG__<3
filebuf fbuf;
if (comterp()->handler()) {
! int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
#else
--- 124,130 ----
#if __GNUG__<3
filebuf fbuf;
if (comterp()->handler()) {
! int fd = Math::max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
#else
*** /dev/null Thu Jun 14 12:56:42 PDT 2001
--- patches/ivtools-010614-johnston-027
*************** patches/ivtools-010614-johnston-027
*** 0 ****
--- 1 ----
+ ivtools-010614-johnston-027
|
|
From: <ivt...@li...> - 2001-06-14 17:35:40
|
Patch: ivtools-010614-johnston-026
For: ivtools-0.9.3
Author: joh...@us...
Subject: gcc-3.0 damage control
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- monstrous patch of changes required by forthcoming gcc-3.0. The
heavy lifting was mostly due to the absence of filebuf::attach in v3
of libstdc++.
Other issues to deal with: templated iostreams, change to meaning of
-U (undefine compiler option), can't have static const char
initializes in class definition, need class between "friend" and class
name, use of <iosfwd>, missing ostream::form, missing istream::gets,
round needs to be Math::round.
Unfortunately, gdb can't debug C++ generated by gcc-3.0 yet, so
although things mostly work, I can't resolve problems with the wild
iostream hacking I did. My recommendation: stick to gcc-2.95.* for
now.
Index: configure.in
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/configure.in,v
retrieving revision 1.4
retrieving revision 1.5
diff -c -r1.4 -r1.5
*** ./configure.in 2001/03/27 19:08:11 1.4
--- ./configure.in 2001/06/14 17:21:14 1.5
***************
*** 232,238 ****
# check for gettimeofday
#AC_TWO_ARG_TIMEOFDAY
# check for libstdc++
! AC_CHECK_LIB(stdc++,peek__7istream,LIBSTDCPLUSPLUS=1,LIBSTDCPLUSPLUS=0)
# check for bigendian
#AC_C_BIGENDIAN
--- 232,239 ----
# check for gettimeofday
#AC_TWO_ARG_TIMEOFDAY
# check for libstdc++
! AC_CHECK_LIB(stdc++,peek__7istream,LIBSTDCPLUSPLUS2=1,LIBSTDCPLUSPLUS2=0)
! AC_CHECK_LIB(stdc++,_ZNSi4peekEv,LIBSTDCPLUSPLUS3=1,LIBSTDCPLUSPLUS3=0)
# check for bigendian
#AC_C_BIGENDIAN
***************
*** 297,302 ****
--- 298,305 ----
#AC_SUBST(TCL)
#AC_SUBST(CXX_HDRDIR)
AC_SUBST(CXX_INCLUDE_DIR)
+ AC_SUBST(LIBSTDCPLUSPLUS2)
+ AC_SUBST(LIBSTDCPLUSPLUS3)
AC_SUBST(x_includes)
AC_SUBST(x_libraries)
#AC_SUBST(BUILD_TREE)
***************
*** 410,417 ****
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\"
! echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk
echo
echo "now do a \"make\""
echo
--- 413,422 ----
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
! echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
! echo LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3 >>config/config.mk
echo
echo "now do a \"make\""
echo
Index: configure
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/configure,v
retrieving revision 1.4
retrieving revision 1.5
diff -c -r1.4 -r1.5
*** ./configure 2001/03/27 19:08:11 1.4
--- ./configure 2001/06/14 17:21:14 1.5
***************
*** 1585,1591 ****
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
--- 1585,1591 ----
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-v3 /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
***************
*** 1641,1653 ****
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
! LIBSTDCPLUSPLUS=1
else
echo "$ac_t""no" 1>&6
! LIBSTDCPLUSPLUS=0
fi
# check for bigendian
#AC_C_BIGENDIAN
#if test $ac_cv_c_bigendian = yes; then
--- 1641,1694 ----
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
! LIBSTDCPLUSPLUS2=1
else
echo "$ac_t""no" 1>&6
! LIBSTDCPLUSPLUS2=0
fi
+ echo $ac_n "checking for _ZNSi4peekEv in -lstdc++""... $ac_c" 1>&6
+ echo "configure:1681: checking for _ZNSi4peekEv in -lstdc++" >&5
+ ac_lib_var=`echo stdc++'_'_ZNSi4peekEv | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+ else
+ ac_save_LIBS="$LIBS"
+ LIBS="-lstdc++ $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 1689 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error. */
+ /* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+ char _ZNSi4peekEv();
+
+ int main() {
+ _ZNSi4peekEv()
+ ; return 0; }
+ EOF
+ if { (eval echo configure:1700: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+ fi
+ rm -f conftest*
+ LIBS="$ac_save_LIBS"
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ LIBSTDCPLUSPLUS3=1
+ else
+ echo "$ac_t""no" 1>&6
+ LIBSTDCPLUSPLUS3=0
+ fi
+
+
# check for bigendian
#AC_C_BIGENDIAN
#if test $ac_cv_c_bigendian = yes; then
***************
*** 1732,1737 ****
--- 1773,1780 ----
#AC_SUBST(TCL)
#AC_SUBST(CXX_HDRDIR)
+
+
#AC_SUBST(BUILD_TREE)
***************
*** 1916,1921 ****
--- 1959,1966 ----
s%@RANLIB@%$RANLIB%g
s%@CPP@%$CPP%g
s%@CXX_INCLUDE_DIR@%$CXX_INCLUDE_DIR%g
+ s%@LIBSTDCPLUSPLUS2@%$LIBSTDCPLUSPLUS2%g
+ s%@LIBSTDCPLUSPLUS3@%$LIBSTDCPLUSPLUS3%g
s%@x_includes@%$x_includes%g
s%@x_libraries@%$x_libraries%g
s%@ACE@%$ACE%g
***************
*** 2128,2135 ****
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS\"
! echo LIBSTDCPLUSPLUS = $LIBSTDCPLUSPLUS >>config/config.mk
echo
echo "now do a \"make\""
echo
--- 2173,2182 ----
echo ABSTOP = `pwd` >>config/config.mk
echo writing \"CPU = `make CPU`\"
echo CPU = `make CPU` >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2\"
! echo LIBSTDCPLUSPLUS2 = $LIBSTDCPLUSPLUS2 >>config/config.mk
! echo writing \"LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3\"
! echo LIBSTDCPLUSPLUS3 = $LIBSTDCPLUSPLUS3 >>config/config.mk
echo
echo "now do a \"make\""
echo
Index: aclocal.m4
===================================================================
RCS file: /home/scott/src/ivtools-0.9/cm/top_ivtools/aclocal.m4,v
retrieving revision 1.2
retrieving revision 1.3
diff -c -r1.2 -r1.3
*** ./aclocal.m4 2001/03/06 17:43:03 1.2
--- ./aclocal.m4 2001/06/14 17:21:14 1.3
***************
*** 25,31 ****
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
--- 25,31 ----
ice_cv_cxx_include_dir="$prefix/include"
for pfx in "$prefix" "$exec_prefix"; do
for dir in "$pfx/lib/g++-include" "$pfx/include/CC" \
! "$pfx/include" /usr/include /usr/local/include/g++-v3 /usr/local/include/g++-3 /usr/local/include/g++-2 ; do
if test -d "$dir"; then
ice_cv_cxx_include_dir="$dir"
break
Index: Attribute/attribute.h
diff -c Attribute/attribute.h:1.1 Attribute/attribute.h:1.2
*** Attribute/attribute.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attribute.h Thu Jun 14 10:21:22 2001
***************
*** 62,68 ****
int symbolid;
AttributeValue* valueptr;
! friend AttributeList;
CLASS_SYMID("Attribute");
};
--- 62,68 ----
int symbolid;
AttributeValue* valueptr;
! friend class AttributeList;
CLASS_SYMID("Attribute");
};
Index: Attribute/attrlist.h
diff -c Attribute/attrlist.h:1.1 Attribute/attrlist.h:1.2
*** Attribute/attrlist.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attrlist.h Thu Jun 14 10:21:22 2001
***************
*** 39,46 ****
class ALIterator;
class AList;
! class istream;
! class ostream;
class Attribute;
class AttributeValue;
--- 39,45 ----
class ALIterator;
class AList;
! #include <iosfwd>
class Attribute;
class AttributeValue;
Index: Attribute/attrvalue.c
diff -c Attribute/attrvalue.c:1.2 Attribute/attrvalue.c:1.3
*** Attribute/attrvalue.c:1.2 Tue May 1 14:50:06 2001
--- src/Attribute/attrvalue.c Thu Jun 14 10:21:22 2001
***************
*** 760,770 ****
--- 760,788 ----
break;
case AttributeValue::FloatType:
+ #if __GNUG__<3
out.form("%.6f", svp->float_val());
+ #else
+ {
+ const int bufsiz=256;
+ char buffer[bufsiz];
+ snprintf(buffer, bufsiz, "%.6f", svp->float_val());
+ out << buffer;
+ }
+ #endif
break;
case AttributeValue::DoubleType:
+ #if __GNUG__<3
out.form("%.6f", svp->double_val());
+ #else
+ {
+ const int bufsiz=256;
+ char buffer[bufsiz];
+ snprintf(buffer, bufsiz, "%.6f", svp->double_val());
+ out << buffer;
+ }
+ #endif
break;
case AttributeValue::EofType:
Index: Attribute/attrvalue.h
diff -c Attribute/attrvalue.h:1.1 Attribute/attrvalue.h:1.2
*** Attribute/attrvalue.h:1.1 Thu Jan 4 15:31:38 2001
--- src/Attribute/attrvalue.h Thu Jun 14 10:21:22 2001
***************
*** 37,43 ****
}
class AttributeValueList;
! class ostream;
//: struct for symbol value, symid + global flag for symbol value
// used in attr_value.
--- 37,43 ----
}
class AttributeValueList;
! #include <iosfwd>
//: struct for symbol value, symid + global flag for symbol value
// used in attr_value.
Index: Attribute/paramlist.h
diff -c Attribute/paramlist.h:1.3 Attribute/paramlist.h:1.4
*** Attribute/paramlist.h:1.3 Thu Mar 22 16:27:32 2001
--- src/Attribute/paramlist.h Thu Jun 14 10:21:22 2001
***************
*** 35,42 ****
class ALIterator;
class LexScan;
class AList;
! class istream;
! class ostream;
//: signature of static methods for reading parameter data from an istream.
typedef int (*param_callback)(istream&, void*, void*, void*, void*);
--- 35,41 ----
class ALIterator;
class LexScan;
class AList;
! #include <iosfwd>
//: signature of static methods for reading parameter data from an istream.
typedef int (*param_callback)(istream&, void*, void*, void*, void*);
Index: TopoFace/fgeomobjs.h
diff -c TopoFace/fgeomobjs.h:1.1 TopoFace/fgeomobjs.h:1.2
*** TopoFace/fgeomobjs.h:1.1 Thu Jan 4 15:31:40 2001
--- src/TopoFace/fgeomobjs.h Thu Jun 14 10:21:24 2001
***************
*** 32,38 ****
#include <Unidraw/enter-scope.h>
class UList;
! class ostream;
class FPointObj {
public:
--- 32,38 ----
#include <Unidraw/enter-scope.h>
class UList;
! #include <iosfwd>
class FPointObj {
public:
Index: ComTerp/Imakefile
diff -c ComTerp/Imakefile:1.1 ComTerp/Imakefile:1.2
*** ComTerp/Imakefile:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/Imakefile Thu Jun 14 10:21:26 2001
***************
*** 46,52 ****
ObjA(comhandler)
#endif
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(comterp)
IncludeDependencies()
--- 46,52 ----
ObjA(comhandler)
#endif
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(comterp)
IncludeDependencies()
Index: ComTerp/comterp.c
diff -c ComTerp/comterp.c:1.2 ComTerp/comterp.c:1.3
*** ComTerp/comterp.c:1.2 Mon Apr 30 16:32:33 2001
--- src/ComTerp/comterp.c Thu Jun 14 10:21:26 2001
***************
*** 50,61 ****
--- 50,65 ----
#include <ComTerp/xformfunc.h>
#include <Attribute/attrlist.h>
#include <Attribute/attribute.h>
+ #include <OS/math.h>
#include <ctype.h>
#include <iostream.h>
#include <string.h>
#include <strstream.h>
#include <unistd.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "ComTerp"
***************
*** 254,261 ****
--- 258,270 ----
}
if (stepflag()) {
+ #if __GNUG__<3
filebuf fbufout;
fbufout.attach(handler() ? max(1, handler()->get_handle()) : fileno(stdout));
+ #else
+ FILE* ofptr = handler() ? fdopen(Math::max(1, handler()->get_handle()), "w") : stdout;
+ filebuf fbufout(ofptr, ios_base::out);
+ #endif
ostream out(&fbufout);
out << ">>> " << *func << "(" << *func->funcstate() << ")\n";
static int pause_symid = symbol_add("pause");
***************
*** 265,270 ****
--- 274,283 ----
stepfunc->execute();
stepfunc->pop_funcstate();
pop_stack();
+ #if __GNUG__>=3
+ if (handler())
+ fclose(ofptr);
+ #endif
}
func->execute();
***************
*** 791,802 ****
--- 804,824 ----
char errbuf_save[BUFSIZ];
errbuf_save[0] = '\0';
+
+ #if __GNUG__<3
filebuf fbuf;
if (handler()) {
int fd = max(1, handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
+ #else
+ FILE* ofptr = nil;
+ filebuf fbuf(handler()
+ ? (ofptr = fdopen(Math::max(1, handler()->get_handle()), "w"))
+ : stdout,
+ ios_base::out);
+ #endif
ostream out(&fbuf);
boolean eolflag = false;
***************
*** 839,844 ****
--- 861,869 ----
}
if (status==1 && _pfnum==0) status=2;
if (nested && status!=2) _stack_top--;
+ #if __GNUG__>3
+ if (ofptr) fclose(ofptr);
+ #endif
return status;
}
***************
*** 1002,1008 ****
--- 1027,1037 ----
if (read_expr()) {
if (eval_expr(true)) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(1);
+ #else
+ filebuf obuf(stdout, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr << "err\n";
ostr.flush();
Index: ComTerp/comterp.h
diff -c ComTerp/comterp.h:1.1 ComTerp/comterp.h:1.2
*** ComTerp/comterp.h:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/comterp.h Thu Jun 14 10:21:26 2001
***************
*** 41,47 ****
class ComFuncState;
class ComTerpState;
class ComValue;
! class ostream;
class ComterpHandler;
--- 41,47 ----
class ComFuncState;
class ComTerpState;
class ComValue;
! #include <iosfwd>
class ComterpHandler;
Index: ComTerp/comterpserv.c
diff -c ComTerp/comterpserv.c:1.1 ComTerp/comterpserv.c:1.2
*** ComTerp/comterpserv.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/comterpserv.c Thu Jun 14 10:21:26 2001
***************
*** 28,35 ****
--- 28,39 ----
#include <ComTerp/comterpserv.h>
#include <ComTerp/comvalue.h>
#include <ComTerp/ctrlfunc.h>
+ #include <OS/math.h>
#include <iostream.h>
#include <string.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#if BUFSIZ>1024
#undef BUFSIZ
***************
*** 140,151 ****
char* ComTerpServ::fd_fgets(char* s, int n, void* serv) {
ComTerpServ* server = (ComTerpServ*)serv;
char* instr;
- int fd = max(server->_fd, 1);
filebuf fbuf;
fbuf.attach(fd);
istream in (&fbuf);
in.gets(&instr);
server->_instat = in.good();
char* outstr = s;
--- 144,163 ----
char* ComTerpServ::fd_fgets(char* s, int n, void* serv) {
ComTerpServ* server = (ComTerpServ*)serv;
+ int fd = Math::max(server->_fd, 1);
+ #if __GNUG__<3
char* instr;
filebuf fbuf;
fbuf.attach(fd);
istream in (&fbuf);
in.gets(&instr);
+ #else
+ char instr[BUFSIZ];
+ FILE* ifptr = fdopen(fd, "r");
+ filebuf fbuf(ifptr, ios_base::in);
+ istream in (&fbuf);
+ in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
+ #endif
server->_instat = in.good();
char* outstr = s;
***************
*** 167,172 ****
--- 179,188 ----
/* append a null byte */
outstr[outpos] = '\0';
+ #if __GNUG__>=3
+ if (ifptr) fclose(ifptr);
+ #endif
+
return s;
}
***************
*** 177,189 ****
--- 193,213 ----
int& bufsize = server->_bufsiz;
int fd = (int)server->_fd;
+ #if __GNUG__<3
filebuf fbuf;
fbuf.attach(fd);
+ #else
+ FILE* ofptr = fdopen(fd, "w");
+ filebuf fbuf(ofptr, ios_base::out);
+ #endif
ostream out(&fbuf);
for (; outpos < bufsize-1 && s[outpos]; outpos++)
out.put(s[outpos]);
out.flush();
outpos = 0;
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
return 1;
}
***************
*** 262,269 ****
--- 286,297 ----
char inbuf[bufsiz];
char outbuf[bufsiz];
inbuf[0] = '\0';
+ #if __GNUG__<3
filebuf ibuf;
ibuf.open(filename, "r");
+ #else
+ filebuf ibuf(fopen(filename, "r"), ios_base::in);
+ #endif
istream istr(&ibuf);
ComValue* retval = nil;
int status = 0;
***************
*** 282,290 ****
--- 310,326 ----
if (*inbuf && read_expr()) {
if (eval_expr(true)) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
+ #else
+ FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
+ filebuf obuf(ofptr, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr.flush();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
status = -1;
} else if (quitflag()) {
status = 1;
***************
*** 295,303 ****
--- 331,347 ----
}
} else if (*inbuf) {
err_print( stderr, "comterp" );
+ #if __GNUG__<3
filebuf obuf(handler() ? handler()->get_handle() : 1);
+ #else
+ FILE* ofptr = fdopen(handler() ? handler()->get_handle() : 1, "w");
+ filebuf obuf(ofptr, ios_base::out);
+ #endif
ostream ostr(&obuf);
ostr.flush();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
status = -1;
}
}
Index: ComTerp/debugfunc.c
diff -c ComTerp/debugfunc.c:1.2 ComTerp/debugfunc.c:1.3
*** ComTerp/debugfunc.c:1.2 Tue Mar 27 09:32:28 2001
--- src/ComTerp/debugfunc.c Thu Jun 14 10:21:26 2001
***************
*** 26,31 ****
--- 26,34 ----
#include <ComTerp/comterpserv.h>
#include <strstream.h>
#include <vector.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "DebugFunc"
***************
*** 80,98 ****
--- 83,119 ----
cerr << sbuf2_s.str();
comterp()->push_servstate();
+ #if __GNUG__<3
filebuf fbufin;
if (comterp()->handler()) {
int fd = max(0, comterp()->handler()->get_handle());
fbufin.attach(fd);
} else
fbufin.attach(fileno(stdin));
+ #else
+ FILE* ifptr;
+ if (comterp()->handler())
+ ifptr = fdopen(max(0, comterp()->handler()->get_handle()), "r");
+ else
+ ifptr = stdin;
+ filebuf fbufin(ifptr, ios_base::in);
+ #endif
istream in(&fbufin);
+ #if __GNUG__<3
filebuf fbufout;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbufout.attach(fd);
} else
fbufout.attach(fileno(stdout));
+ #else
+ FILE* ofptr;
+ if (comterp()->handler())
+ ofptr = fdopen(max(1, comterp()->handler()->get_handle()), "w");
+ else
+ ofptr = stdout;
+ filebuf fbufout(ofptr, ios_base::out);
+ #endif
ostream out(&fbufout);
vector<char> cvect;
ComValue retval;
***************
*** 119,124 ****
--- 140,151 ----
sbuf_e.put('\0');
cerr << sbuf_e.str();
push_stack(retval);
+ #if __GNUG__>=3
+ if (comterp()->handler()) {
+ fclose(ifptr);
+ fclose(ofptr);
+ }
+ #endif
}
void ComterpPauseFunc::execute() {
Index: ComTerp/helpfunc.c
diff -c ComTerp/helpfunc.c:1.2 ComTerp/helpfunc.c:1.3
*** ComTerp/helpfunc.c:1.2 Mon Apr 30 16:32:33 2001
--- src/ComTerp/helpfunc.c Thu Jun 14 10:21:26 2001
***************
*** 29,36 ****
--- 29,41 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ #include <OS/math.h>
+
#include <iostream.h>
#include <strstream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "HelpFunc"
***************
*** 115,131 ****
reset_stack();
- filebuf fbuf;
strstreambuf sbuf;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
! #if 0
! else
! fbuf.attach(fileno(stdout));
#endif
! ostream out(comterp()->handler() ? &fbuf : &sbuf);
if (noargs) {
--- 120,138 ----
reset_stack();
strstreambuf sbuf;
+ #if __GNUG__<3
+ filebuf fbuf;
if (comterp()->handler()) {
int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
}
! #else
! FILE* ofptr;
! ofptr = fdopen(Math::max(1, comterp()->handler() ? comterp()->handler()->get_handle() : 0), "w");
! filebuf fbuf(ofptr, ios_base::out);
#endif
! ostream out(comterp()->handler() ? (streambuf*)&fbuf : (streambuf*)&sbuf);
if (noargs) {
***************
*** 145,152 ****
first = false;
else
out.put('\n');
! ;
out.form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
printed = true;
}
}
--- 152,167 ----
first = false;
else
out.put('\n');
! #if __GNUG__<3
out.form(comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ,
+ comfuncs[i]->docstring(), symbol_pntr(command_ids[i]));
+ out << buffer;
+ }
+ #endif
printed = true;
}
}
***************
*** 166,174 ****
--- 181,206 ----
first = false;
else
out.put('\n');
+ #if __GNUG__<3
out.form(comfunc->docstring(), symbol_pntr(value->command_symid()));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ,
+ comfunc->docstring(), symbol_pntr(value->command_symid()));
+ out << buffer;
+ }
+ #endif
} else
+ #if __GNUG__<3
out.form("unknown operator: %s\n", symbol_pntr(command_ids[i]));
+ #else
+ {
+ char buffer[BUFSIZ];
+ snprintf(buffer, BUFSIZ, "unknown operator: %s\n", symbol_pntr(command_ids[i]));
+ out << buffer;
+ }
+ #endif
}
}
***************
*** 198,202 ****
--- 230,237 ----
delete comfuncs;
delete str_flags;
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
}
Index: ComTerp/iofunc.c
diff -c ComTerp/iofunc.c:1.1 ComTerp/iofunc.c:1.2
*** ComTerp/iofunc.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/iofunc.c Thu Jun 14 10:21:26 2001
***************
*** 28,35 ****
--- 28,39 ----
#include <ComTerp/comterp.h>
#include <Attribute/aliterator.h>
#include <Attribute/attrlist.h>
+ #include <OS/math.h>
#include <iostream.h>
#include <strstream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "IoFunc"
***************
*** 55,60 ****
--- 59,65 ----
const char* fstr = formatstr.is_string() ? formatstr.string_ptr() : "nil";
+ #if __GNUG__<3
streambuf* strmbuf = nil;
if (stringflag.is_false() && strflag.is_false() &&
symbolflag.is_false() && symflag.is_false()) {
***************
*** 68,73 ****
--- 73,93 ----
} else {
strmbuf = new strstreambuf();
}
+ #else
+ streambuf* strmbuf = nil;
+ FILE* ofptr = nil;
+ if (stringflag.is_false() && strflag.is_false() &&
+ symbolflag.is_false() && symflag.is_false()) {
+ filebuf * fbuf = nil;
+ if (comterp()->handler()) {
+ int fd = Math::max(1, comterp()->handler()->get_handle());
+ fbuf = new filebuf(ofptr = fdopen(fd, "w"), ios_base::out);
+ } else
+ fbuf = new filebuf(errflag.is_false() ? stdout : stderr, ios_base::out);
+ strmbuf = fbuf;
+ } else
+ strmbuf = new strstreambuf();
+ #endif
ostream out(strmbuf);
if (nargs()==1) {
***************
*** 82,124 ****
{
case ComValue::SymbolType:
case ComValue::StringType:
! out.form(fstr, symbol_pntr( printval.symbol_ref()));
break;
case ComValue::BooleanType:
! out.form(fstr, printval.boolean_ref());
break;
case ComValue::CharType:
! out.form(fstr, printval.char_ref());
break;
case ComValue::UCharType:
! out.form(fstr, printval.uchar_ref());
break;
case ComValue::IntType:
! out.form(fstr, printval.int_ref());
break;
case ComValue::UIntType:
! out.form(fstr, printval.uint_ref());
break;
case ComValue::LongType:
! out.form(fstr, printval.long_ref());
break;
case ComValue::ULongType:
! out.form(fstr, printval.ulong_ref());
break;
case ComValue::FloatType:
! out.form(fstr, printval.float_ref());
break;
case ComValue::DoubleType:
! out.form(fstr, printval.double_ref());
break;
case ComValue::ArrayType:
--- 102,144 ----
{
case ComValue::SymbolType:
case ComValue::StringType:
! out_form(out, fstr, symbol_pntr( printval.symbol_ref()));
break;
case ComValue::BooleanType:
! out_form(out, fstr, printval.boolean_ref());
break;
case ComValue::CharType:
! out_form(out, fstr, printval.char_ref());
break;
case ComValue::UCharType:
! out_form(out, fstr, printval.uchar_ref());
break;
case ComValue::IntType:
! out_form(out, fstr, printval.int_ref());
break;
case ComValue::UIntType:
! out_form(out, fstr, printval.uint_ref());
break;
case ComValue::LongType:
! out_form(out, fstr, printval.long_ref());
break;
case ComValue::ULongType:
! out_form(out, fstr, printval.ulong_ref());
break;
case ComValue::FloatType:
! out_form(out, fstr, printval.float_ref());
break;
case ComValue::DoubleType:
! out_form(out, fstr, printval.double_ref());
break;
case ComValue::ArrayType:
***************
*** 146,152 ****
break;
case ComValue::UnknownType:
! out.form(fstr);
break;
default:
--- 166,172 ----
break;
case ComValue::UnknownType:
! out_form(out, fstr, nil);
break;
default:
***************
*** 166,171 ****
push_stack(retval);
}
delete strmbuf;
!
}
--- 186,193 ----
push_stack(retval);
}
delete strmbuf;
! #if __GNUG__>=3
! if (ofptr) fclose(ofptr);
! #endif
}
Index: ComTerp/parser.c
diff -c ComTerp/parser.c:1.1 ComTerp/parser.c:1.2
*** ComTerp/parser.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/parser.c Thu Jun 14 10:21:26 2001
***************
*** 131,138 ****
--- 131,143 ----
char* Parser::istream_fgets(char* s, int n, void* instreamp) {
istream& in = *(istream*)instreamp;
+ #if __GNUG__<3
char *instr;
in.gets(&instr);
+ #else
+ char instr[BUFSIZ];
+ in.get(instr, BUFSIZ, '\n'); // needs to be generalized with <vector.h>
+ #endif
if (in.good()) {
int i = 0;
for (; i<n-2; i++) {
Index: ComTerp/parser.h
diff -c ComTerp/parser.h:1.1 ComTerp/parser.h:1.2
*** ComTerp/parser.h:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/parser.h Thu Jun 14 10:21:26 2001
***************
*** 31,37 ****
#include <ComTerp/commodule.h>
#include <ComTerp/_comterp.h>
! class istream;
//: C++ wrapper for ComUtil parser capability.
class Parser : public ComTerpModule {
--- 31,37 ----
#include <ComTerp/commodule.h>
#include <ComTerp/_comterp.h>
! #include <iosfwd>
//: C++ wrapper for ComUtil parser capability.
class Parser : public ComTerpModule {
Index: ComTerp/postfunc.c
diff -c ComTerp/postfunc.c:1.1 ComTerp/postfunc.c:1.2
*** ComTerp/postfunc.c:1.1 Thu Jan 4 15:31:42 2001
--- src/ComTerp/postfunc.c Thu Jun 14 10:21:26 2001
***************
*** 29,35 ****
--- 29,40 ----
#include <Attribute/attrlist.h>
#include <Attribute/attrvalue.h>
+ #include <OS/math.h>
+
#include <iostream.h>
+ #if __GNUG__>=3
+ #include <fstream.h>
+ #endif
#define TITLE "PostFunc"
***************
*** 40,51 ****
void PostFixFunc::execute() {
// print everything on the stack for this function
filebuf fbuf;
if (comterp()->handler()) {
! int fd = max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
ostream out(&fbuf);
boolean oldbrief = comterp()->brief();
--- 45,64 ----
void PostFixFunc::execute() {
// print everything on the stack for this function
+ #if __GNUG__>3
filebuf fbuf;
if (comterp()->handler()) {
! int fd = Math::max(1, comterp()->handler()->get_handle());
fbuf.attach(fd);
} else
fbuf.attach(fileno(stdout));
+ #else
+ FILE* ofptr = nil;
+ filebuf fbuf(comterp()->handler()
+ ? (ofptr=fdopen(Math::max(1, comterp()->handler()->get_handle()), "w"))
+ : stdout,
+ ios_base::out);
+ #endif
ostream out(&fbuf);
boolean oldbrief = comterp()->brief();
***************
*** 72,77 ****
--- 85,93 ----
}
comterp()->brief(oldbrief);
reset_stack();
+ #if __GNUG__>=3
+ if (ofptr) fclose(ofptr);
+ #endif
}
/*****************************************************************************/
Index: src_interviews/field.c
diff -c src_interviews/field.c:1.1 src_interviews/field.c:1.2
*** src_interviews/field.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/field.c Thu Jun 14 10:21:29 2001
***************
*** 61,66 ****
--- 61,67 ----
#include <OS/math.h>
#include <OS/string.h>
#include <stdio.h>
+ #include <string.h>
class FieldStringEditor : public StringEditor {
public:
Index: src_interviews/ol_kit.c
diff -c src_interviews/ol_kit.c:1.1 src_interviews/ol_kit.c:1.2
*** src_interviews/ol_kit.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/ol_kit.c Thu Jun 14 10:21:29 2001
***************
*** 1051,1057 ****
class OLKitImpl {
private:
! friend OLKit;
OLKitImpl(OLKit*);
~OLKitImpl();
--- 1051,1057 ----
class OLKitImpl {
private:
! friend class OLKit;
OLKitImpl(OLKit*);
~OLKitImpl();
Index: src_interviews/printer.c
diff -c src_interviews/printer.c:1.1 src_interviews/printer.c:1.2
*** src_interviews/printer.c:1.1 Thu Jan 4 15:31:49 2001
--- src/InterViews/printer.c Thu Jun 14 10:21:29 2001
***************
*** 372,378 ****
out << "\\" << char(c);
} else if (c > 127) {
#ifdef __GNUC__
! out.form("\\%03o", c);
#else
out << "\\";
int old_width = out.width(3);
--- 372,378 ----
out << "\\" << char(c);
} else if (c > 127) {
#ifdef __GNUC__
! out_form(out, "\\%03o", c);
#else
out << "\\";
int old_width = out.width(3);
***************
*** 443,449 ****
}
}
#ifdef __GNUC__
! out.form("%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
--- 443,449 ----
}
}
#ifdef __GNUC__
! out_form(out, "%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
***************
*** 484,490 ****
raster->peek(ix, iy, r, g, b, alpha);
int byte = int(0xff * (r + g + b) / 3);
#ifdef __GNUC__
! out.form("%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
--- 484,490 ----
raster->peek(ix, iy, r, g, b, alpha);
int byte = int(0xff * (r + g + b) / 3);
#ifdef __GNUC__
! out_form(out, "%02x", byte);
#else
out << ((byte>>4) & 0x0f) << (byte & 0x0f);
#endif
Index: src_iv-2_6/xpainter.c
diff -c src_iv-2_6/xpainter.c:1.1 src_iv-2_6/xpainter.c:1.2
*** src_iv-2_6/xpainter.c:1.1 Thu Jan 4 15:31:51 2001
--- src/IV-2_6/xpainter.c Thu Jun 14 10:21:31 2001
***************
*** 64,70 ****
dashgc = XCreateGC(d->display_, d->root_, 0, nil);
fillbg = true;
overwrite = false;
! xor = false;
clipped = false;
}
--- 64,70 ----
dashgc = XCreateGC(d->display_, d->root_, 0, nil);
fillbg = true;
overwrite = false;
! x_or = false;
clipped = false;
}
***************
*** 133,142 ****
rep->fillbg = copy->rep->fillbg;
rep->overwrite = copy->rep->overwrite;
Copy(copy);
! if (copy->rep->xor) {
Begin_xor();
}
! rep->xor = copy->rep->xor;
if (rep->overwrite) {
XSetSubwindowMode(dpy, rep->fillgc, IncludeInferiors);
XSetSubwindowMode(dpy, rep->dashgc, IncludeInferiors);
--- 133,142 ----
rep->fillbg = copy->rep->fillbg;
rep->overwrite = copy->rep->overwrite;
Copy(copy);
! if (copy->rep->x_or) {
Begin_xor();
}
! rep->x_or = copy->rep->x_or;
if (rep->overwrite) {
XSetSubwindowMode(dpy, rep->fillgc, IncludeInferiors);
XSetSubwindowMode(dpy, rep->dashgc, IncludeInferiors);
***************
*** 155,161 ****
void Painter::FillBg(boolean b) {
if (rep->fillbg != b) {
! if (rep->xor) {
End_xor();
}
rep->fillbg = b;
--- 155,161 ----
void Painter::FillBg(boolean b) {
if (rep->fillbg != b) {
! if (rep->x_or) {
End_xor();
}
rep->fillbg = b;
***************
*** 171,177 ****
boolean Painter::BgFilled() const { return rep->fillbg; }
void Painter::SetColors(const Color* f, const Color* b) {
! if (rep->xor) {
End_xor();
}
--- 171,177 ----
boolean Painter::BgFilled() const { return rep->fillbg; }
void Painter::SetColors(const Color* f, const Color* b) {
! if (rep->x_or) {
End_xor();
}
***************
*** 205,211 ****
}
void Painter::SetPattern(const Pattern* pat) {
! if (rep->xor) {
End_xor();
}
if (pattern != pat) {
--- 205,211 ----
}
void Painter::SetPattern(const Pattern* pat) {
! if (rep->x_or) {
End_xor();
}
if (pattern != pat) {
***************
*** 219,225 ****
}
void Painter::SetBrush(const Brush* b) {
! if (rep->xor) {
End_xor();
}
if (br != b) {
--- 219,225 ----
}
void Painter::SetBrush(const Brush* b) {
! if (rep->x_or) {
End_xor();
}
if (br != b) {
***************
*** 363,370 ****
}
void Painter::Begin_xor() {
! if (!rep->xor) {
! rep->xor = true;
DisplayRep& d = *rep->display->rep();
XDisplay* dpy = d.display_;
unsigned long xor_pixel = d.default_visual_->x_or(*d.style_);
--- 363,370 ----
}
void Painter::Begin_xor() {
! if (!rep->x_or) {
! rep->x_or = true;
DisplayRep& d = *rep->display->rep();
XDisplay* dpy = d.display_;
unsigned long xor_pixel = d.default_visual_->x_or(*d.style_);
***************
*** 378,385 ****
}
void Painter::End_xor() {
! if (rep->xor) {
! rep->xor = false;
XDisplay* dpy = rep->display->rep()->display_;
XSetFunction(dpy, rep->fillgc, GXcopy);
unsigned long pixel = foreground->PixelValue();
--- 378,385 ----
}
void Painter::End_xor() {
! if (rep->x_or) {
! rep->x_or = false;
XDisplay* dpy = rep->display->rep()->display_;
XSetFunction(dpy, rep->fillgc, GXcopy);
unsigned long pixel = foreground->PixelValue();
***************
*** 664,670 ****
if (xid == CanvasRep::unbound) {
return;
}
! if (rep->xor) {
End_xor();
}
int tx = TxKey(matrix, bitmap->pwidth(), bitmap->pheight());
--- 664,670 ----
if (xid == CanvasRep::unbound) {
return;
}
! if (rep->x_or) {
End_xor();
}
int tx = TxKey(matrix, bitmap->pwidth(), bitmap->pheight());
Index: src_x11/xdrag.c
diff -c src_x11/xdrag.c:1.1 src_x11/xdrag.c:1.2
*** src_x11/xdrag.c:1.1 Thu Jan 4 15:31:53 2001
--- src/IV-X11/xdrag.c Thu Jun 14 10:21:33 2001
***************
*** 130,136 ****
char buffer[256];
ostrstream name(buffer, 256);
name << dragName << "_" << Host::name() << "_" << getpid() << "_" <<
! dropUid++ << ends;
property = XInternAtom(display, name.str(), False);
XChangeProperty(
--- 130,136 ----
char buffer[256];
ostrstream name(buffer, 256);
name << dragName << "_" << Host::name() << "_" << getpid() << "_" <<
! dropUid++ << '\0';
property = XInternAtom(display, name.str(), False);
XChangeProperty(
Index: src_x11/xwindow.c
diff -c src_x11/xwindow.c:1.1 src_x11/xwindow.c:1.2
*** src_x11/xwindow.c:1.1 Thu Jan 4 15:31:53 2001
--- src/IV-X11/xwindow.c Thu Jun 14 10:21:33 2001
***************
*** 1624,1630 ****
return (i ^ (i>>1)) & i;
}
! unsigned long WindowVisual::xor(const Style& s) const {
return x_or(s);
}
--- 1624,1630 ----
return (i ^ (i>>1)) & i;
}
! unsigned long WindowVisual::x_or_(const Style& s) const {
return x_or(s);
}
Index: src_os/string.c
diff -c src_os/string.c:1.1 src_os/string.c:1.2
*** src_os/string.c:1.1 Thu Jan 4 15:31:55 2001
--- src/OS/string.c Thu Jun 14 10:21:34 2001
***************
*** 328,334 ****
};
ostream& operator<< (ostream& out, const String& str) {
! #if defined(sun) && !defined(solaris)
out.write(str.string(), str.length());
#else
out.write(str.string(), (streamsize)str.length());
--- 328,334 ----
};
ostream& operator<< (ostream& out, const String& str) {
! #if defined(sun) && !defined(solaris) || __GNUG__>=3
out.write(str.string(), str.length());
#else
out.write(str.string(), (streamsize)str.length());
Index: src_dispatch/dispatcher.c
diff -c src_dispatch/dispatcher.c:1.1 src_dispatch/dispatcher.c:1.2
*** src_dispatch/dispatcher.c:1.1 Thu Jan 4 15:31:58 2001
--- src/Dispatch/dispatcher.c Thu Jun 14 10:21:36 2001
***************
*** 60,66 ****
#endif
}
! #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2)
#define fds_bits __fds_bits
#endif
--- 60,66 ----
#endif
}
! #if defined(__GLIBC__) && (__GLIBC__==2 && __GLIBC_MINOR__>0 || __GLIBC__>2) && __GNUG__<3
#define fds_bits __fds_bits
#endif
***************
*** 653,659 ****
sv.sa_flags = SV_INTERRUPT;
sigaction(SIGCLD, &sv, &osv);
#else
! sv.sv_handler = fxSIGVECHANDLER(&Dispatcher::sigCLD);
sv.sv_flags = SV_INTERRUPT;
sigvec(SIGCLD, &sv, &osv);
#endif
--- 653,659 ----
sv.sa_flags = SV_INTERRUPT;
sigaction(SIGCLD, &sv, &osv);
#else
! sv.sv_handler = (void (*)(int)) fxSIGVECHANDLER(&Dispatcher::sigCLD);
sv.sv_flags = SV_INTERRUPT;
sigvec(SIGCLD, &sv, &osv);
#endif
Index: iclass/dialogs.c
diff -c iclass/dialogs.c:1.1 iclass/dialogs.c:1.2
*** iclass/dialogs.c:1.1 Thu Jan 4 15:32:02 2001
--- src/iclass/dialogs.c Thu Jun 14 10:21:38 2001
***************
*** 37,42 ****
--- 37,43 ----
#include <InterViews/scrollbar.h>
#include <InterViews/sensor.h>
#include <InterViews/streditor.h>
+ #include <OS/math.h>
#include <OS/types.h>
#include <stdlib.h>
***************
*** 108,114 ****
/*****************************************************************************/
AcknowledgeDialog::AcknowledgeDialog (const char* msg, const char* btnLbl) {
! int space = round(fspace*ivcm);
Insert(
new MarginFrame(
--- 109,115 ----
/*****************************************************************************/
AcknowledgeDialog::AcknowledgeDialog (const char* msg, const char* btnLbl) {
! int space = Math::round(fspace*ivcm);
Insert(
new MarginFrame(
***************
*** 177,183 ****
}
Interactor* ConfirmDialog::Interior (const char* msg) {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 178,184 ----
}
Interactor* ConfirmDialog::Interior (const char* msg) {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 219,225 ****
void StringDialog::Select (int left, int right) { _sedit->Select(left, right);}
void StringDialog::Init (const char* msg, const char* confirmLbl, int width) {
! int space = round(fspace*ivcm);
_sedit = new StringEditor(state, "");
HBox* framedSedit = new HBox;
--- 220,226 ----
void StringDialog::Select (int left, int right) { _sedit->Select(left, right);}
void StringDialog::Init (const char* msg, const char* confirmLbl, int width) {
! int space = Math::round(fspace*ivcm);
_sedit = new StringEditor(state, "");
HBox* framedSedit = new HBox;
***************
*** 287,293 ****
FileDialog::FileDialog (
const char* msg, const char* dir, const char* confirmLbl
) {
! int space = round(fspace*ivcm);
_browser = new FileBrowser(state, dir, 20, 35, false, Reversed,"\000\007");
_dirs = new FileBrowser(
"dirBrowser", state, dir, 20, 24, true, Reversed,"d\007"
--- 288,294 ----
FileDialog::FileDialog (
const char* msg, const char* dir, const char* confirmLbl
) {
! int space = Math::round(fspace*ivcm);
_browser = new FileBrowser(state, dir, 20, 35, false, Reversed,"\000\007");
_dirs = new FileBrowser(
"dirBrowser", state, dir, 20, 24, true, Reversed,"d\007"
Index: iclass/iclass.c
diff -c iclass/iclass.c:1.1 iclass/iclass.c:1.2
*** iclass/iclass.c:1.1 Thu Jan 4 15:32:02 2001
--- src/iclass/iclass.c Thu Jun 14 10:21:38 2001
***************
*** 50,55 ****
--- 50,56 ----
#include <InterViews/streditor.h>
#include <InterViews/textbuffer.h>
#include <InterViews/world.h>
+ #include <OS/math.h>
#include <OS/types.h>
#include <stdio.h>
***************
*** 195,201 ****
if (f != nil) {
struct stat filestats;
stat(filename, &filestats);
! _bufsize = max(round(filestats.st_size * 1.2), MINTEXTSIZE);
_buf = new char[_bufsize];
char* b = _buf;
int remaining = _bufsize;
--- 196,202 ----
if (f != nil) {
struct stat filestats;
stat(filename, &filestats);
! _bufsize = max(Math::round(filestats.st_size * 1.2), MINTEXTSIZE);
_buf = new char[_bufsize];
char* b = _buf;
int remaining = _bufsize;
***************
*** 448,454 ****
}
Interactor* IClass::Interior () {
! int space = round(fspace*ivcm);
const char* showButton = GetAttribute("showButton");
Interactor* selector = SelectedClass();
--- 449,455 ----
}
Interactor* IClass::Interior () {
! int space = Math::round(fspace*ivcm);
const char* showButton = GetAttribute("showButton");
Interactor* selector = SelectedClass();
***************
*** 501,507 ****
const char* name, MenuInfo* item, IClass* ic
) {
PulldownMenu* menu = new PulldownMenu(
! new Message(name, Left, round(.1*ivcm))
);
for (MenuInfo* i = item; i->_lbl != nil; i++) {
--- 502,508 ----
const char* name, MenuInfo* item, IClass* ic
) {
PulldownMenu* menu = new PulldownMenu(
! new Message(name, Left, Math::round(.1*ivcm))
);
for (MenuInfo* i = item; i->_lbl != nil; i++) {
***************
*** 653,659 ****
void IClass::ForwardSearchCmd () {
if (_fwdSearch == nil) {
! _fwdSearch = new StringDialog("Search forward for: ", round(3*ivinches));
}
InsertDialog(_fwdSearch);
--- 654,660 ----
void IClass::ForwardSearchCmd () {
if (_fwdSearch == nil) {
! _fwdSearch = new StringDialog("Search forward for: ", Math::round(3*ivinches));
}
InsertDialog(_fwdSearch);
***************
*** 670,676 ****
void IClass::BackwardSearchCmd () {
if (_bwdSearch == nil) {
! _bwdSearch = new StringDialog("Search backward for:", round(3*ivinches));
}
InsertDialog(_bwdSearch);
--- 671,677 ----
void IClass::BackwardSearchCmd () {
if (_bwdSearch == nil) {
! _bwdSearch = new StringDialog("Search backward for:", Math::round(3*ivinches));
}
InsertDialog(_bwdSearch);
Index: IVGlyph/bdvalue.c
diff -c IVGlyph/bdvalue.c:1.1 IVGlyph/bdvalue.c:1.2
*** IVGlyph/bdvalue.c:1.1 Thu Jan 4 15:32:07 2001
--- src/IVGlyph/bdvalue.c Thu Jun 14 10:21:41 2001
***************
*** 48,53 ****
--- 48,54 ----
#include <IVGlyph/bdvalue.h>
#include <stdio.h>
+ #include <string.h>
/* class BoundedValue */
Index: AttrGlyph/Imakefile
diff -c AttrGlyph/Imakefile:1.1 AttrGlyph/Imakefile:1.2
*** AttrGlyph/Imakefile:1.1 Thu Jan 4 15:32:53 2001
--- src/AttrGlyph/Imakefile Thu Jun 14 10:21:54 2001
***************
*** 14,20 ****
#define Obj(file,flags) MakeObjectFromSrcFlags(file,flags)
! Obj(attredit,-DLibStdCPlusPlus=$(LIBSTDCPLUSPLUS))
IncludeDependencies()
--- 14,20 ----
#define Obj(file,flags) MakeObjectFromSrcFlags(file,flags)
! Obj(attredit,-DLibStdCPlusPlus2=$(LIBSTDCPLUSPLUS2) -DLibStdCPlusPlus3=$(LIBSTDCPLUSPLUS3))
IncludeDependencies()
Index: AttrGlyph/attredit.c
diff -c AttrGlyph/attredit.c:1.2 AttrGlyph/attredit.c:1.3
*** AttrGlyph/attredit.c:1.2 Thu Apr 5 09:39:41 2001
--- src/AttrGlyph/attredit.c Thu Jun 14 10:21:54 2001
***************
*** 43,49 ****
#include <strstream.h>
#include <string.h>
! #if LibStdCPlusPlus
#define STL_VECTOR
#include <vector.h>
#endif
--- 43,49 ----
#include <strstream.h>
#include <string.h>
! #if defined(LibStdCPlusPlus2) || defined(LibStdCPlusPlus3)
#define STL_VECTOR
#include <vector.h>
#endif
Index: ComGlyph/Imakefile
diff -c ComGlyph/Imakefile:1.1 ComGlyph/Imakefile:1.2
*** ComGlyph/Imakefile:1.1 Thu Jan 4 15:32:54 2001
--- src/ComGlyph/Imakefile Thu Jun 14 10:21:56 2001
***************
*** 13,19 ****
MakeLibrary($(LIB),$(VERSION))
#define Obj26(file) MakeObjectFromSrcFlags(file,)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Uiv2_6_compatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(attrdialog)
Obj31(comtextedit)
--- 13,19 ----
MakeLibrary($(LIB),$(VERSION))
#define Obj26(file) MakeObjectFromSrcFlags(file,)
! #define Obj31(file) MakeObjectFromSrcFlags(file, -Div2_6_incompatible -I$(TOP)/src/include $(TOP_CCINCLUDES))
Obj31(attrdialog)
Obj31(comtextedit)
Index: Unidraw/align.c
diff -c Unidraw/align.c:1.1 Unidraw/align.c:1.2
*** Unidraw/align.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/align.c Thu Jun 14 10:21:58 2001
***************
*** 44,49 ****
--- 44,51 ----
#include <InterViews/transformer.h>
+ #include <OS/math.h>
+
#include <stream.h>
#include <IV-2_6/_enter.h>
***************
*** 173,180 ****
g->Parent()->TotalTransformation(t);
t.Invert();
! Coord cx = round(refx);
! Coord cy = round(refy);
grid->Constrain(cx, cy);
--- 175,182 ----
g->Parent()->TotalTransformation(t);
t.Invert();
! Coord cx = Math::round(refx);
! Coord cy = Math::round(refy);
grid->Constrain(cx, cy);
Index: Unidraw/catalog.c
diff -c Unidraw/catalog.c:1.1 Unidraw/catalog.c:1.2
*** Unidraw/catalog.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/catalog.c Thu Jun 14 10:21:58 2001
***************
*** 52,57 ****
--- 52,58 ----
#include <InterViews/transformer.h>
#include <IV-2_6/InterViews/world.h>
+ #include <OS/math.h>
#include <OS/memory.h>
#include <IV-2_6/_enter.h>
***************
*** 68,73 ****
--- 69,75 ----
#include <unistd.h>
#endif
#include <sys/file.h>
+ #include <fstream.h>
#ifdef __DECCXX
extern "C" {
***************
*** 104,112 ****
static const char* HexEncode (
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
! unsigned int r = round(ir * color_base);
! unsigned int g = round(ig * color_base);
! unsigned int b = round(ib * color_base);
static char enc[hex_encode+1];
enc[hex_encode] = '\0';
--- 106,114 ----
static const char* HexEncode (
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
! unsigned int r = Math::round(ir * color_base);
! unsigned int g = Math::round(ig * color_base);
! unsigned int b = Math::round(ib * color_base);
static char enc[hex_encode+1];
enc[hex_encode] = '\0';
***************
*** 143,149 ****
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
ColorIntensity igray = 0.30 * ir + 0.59 * ig + 0.11 * ib;
! unsigned int gray = round(igray * color_base);
static char enc[hex_gray_encode+1];
enc[hex_gray_encode] = '\0';
--- 145,151 ----
ColorIntensity ir, ColorIntensity ig, ColorIntensity ib
) {
ColorIntensity igray = 0.30 * ir + 0.59 * ig + 0.11 * ib;
! unsigned int gray = Math::round(igray * color_base);
static char enc[hex_gray_encode+1];
enc[hex_gray_encode] = '\0';
***************
*** 438,444 ****
if (edInfo == nil) {
filebuf fbuf;
ok = fbuf.open((char*) name, input) != 0;
-
if (ok) {
istream in(&fbuf);
edInfo = ReadEditorInfo(in);
--- 440,445 ----
***************
*** 655,661 ****
for (int i = 0; !in.eof() && !FoundDelim(delim, *extra_data); ++i) {
char c;
in.get(c);
! extra_data->Insert((void*) c, i);
}
}
--- 656,662 ----
for (int i = 0; !in.eof() && !FoundDelim(delim, *extra_data); ++i) {
char c;
in.get(c);
! extra_data->Insert((void*)(unsigned int)c, i);
}
}
***************
*** 1217,1225 ****
}
if (defined && in.good()) {
! int ir = round(r * float(0xffff));
! int ig = round(g * float(0xffff));
! int ib = round(b * float(0xffff));
color = FindColor(name, ir, ig, ib);
}
--- 1218,1226 ----
}
if (defined && in.good()) {
! int ir = Math::round(r * float(0xffff));
! int ig = Math::round(g * float(0xffff));
! int ib = Math::round(b * float(0xffff));
color = FindColor(name, ir, ig, ib);
}
***************
*** 1417,1423 ****
0x0505, 0x0405, 0x0401, 0x0001,
0x0000
};
! return shades[round(graylevel * (SHADES - 1))];
}
static const int* ExpandToFullSize (const int* orig_data, int size) {
--- 1418,1424 ----
0x0505, 0x0405, 0x0401, 0x0001,
0x0000
};
! return shades[Math::round(graylevel * (SHADES - 1))];
}
static const int* ExpandToFullSize (const int* orig_data, int size) {
Index: Unidraw/catcmds.c
diff -c Unidraw/catcmds.c:1.1 Unidraw/catcmds.c:1.2
*** Unidraw/catcmds.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/catcmds.c Thu Jun 14 10:21:58 2001
***************
*** 47,52 ****
--- 47,53 ----
#include <stdlib.h>
#include <stream.h>
#include <string.h>
+ #include <fstream.h>
/*****************************************************************************/
Index: Unidraw/dialogs.c
diff -c Unidraw/dialogs.c:1.1 Unidraw/dialogs.c:1.2
*** Unidraw/dialogs.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/dialogs.c Thu Jun 14 10:21:58 2001
***************
*** 44,49 ****
--- 44,51 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
***************
*** 139,145 ****
}
Interactor* AcknowledgeDialog::Interior () {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 141,147 ----
}
Interactor* AcknowledgeDialog::Interior () {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 188,194 ****
}
Interactor* ConfirmDialog::Interior () {
! const int space = round(.5*ivcm);
return new MarginFrame(
new VBox(
--- 190,196 ----
}
Interactor* ConfirmDialog::Interior () {
! const int space = Math::round(.5*ivcm);
return new MarginFrame(
new VBox(
***************
*** 284,290 ****
}
Interactor* UChooser::Interior (const char* acptlbl) {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
new HBox(_subtitle, new HGlue)
--- 286,292 ----
}
Interactor* UChooser::Interior (const char* acptlbl) {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
new HBox(_subtitle, new HGlue)
***************
*** 403,409 ****
}
Interactor* PrintDialog::Interior () {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(title, new HGlue),
new HBox(subtitle, new HGlue)
--- 405,411 ----
}
Interactor* PrintDialog::Interior () {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(title, new HGlue),
new HBox(subtitle, new HGlue)
***************
*** 485,491 ****
}
Interactor* GridDialog::Interior () {
! const int space = round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
--- 487,493 ----
}
Interactor* GridDialog::Interior () {
! const int space = Math::round(.5*ivcm);
VBox* titleblock = new VBox(
new HBox(_title, new HGlue),
Index: Unidraw/editorinfo.c
diff -c Unidraw/editorinfo.c:1.1 Unidraw/editorinfo.c:1.2
*** Unidraw/editorinfo.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/editorinfo.c Thu Jun 14 10:21:58 2001
***************
*** 43,49 ****
virtual void* id();
virtual void* tag();
private:
! void* _idstring;
char* _tagstring;
};
--- 43,49 ----
virtual void* id();
virtual void* tag();
private:
! char* _idstring;
char* _tagstring;
};
Index: Unidraw/ellipses.c
diff -c Unidraw/ellipses.c:1.1 Unidraw/ellipses.c:1.2
*** Unidraw/ellipses.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/ellipses.c Thu Jun 14 10:21:59 2001
***************
*** 34,39 ****
--- 34,41 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
/*****************************************************************************/
Coord Ellipse::_x[8];
***************
*** 156,163 ****
if (t == nil) {
Coord px1, py1, px2, py2;
! px1 = round(float(_r1)*axis); py1 = round(float(_r2)*axis);
! px2 = round(float(_r1)*seen); py2 = round(float(_r2)*seen);
_x[0] = _x0 + px1; _y[0] = _y0 + py2;
_x[1] = _x0 - px1; _y[1] = _y[0];
--- 158,165 ----
if (t == nil) {
Coord px1, py1, px2, py2;
! px1 = Math::round(float(_r1)*axis); py1 = Math::round(float(_r2)*axis);
! px2 = Math::round(float(_r1)*seen); py2 = Math::round(float(_r2)*seen);
_x[0] = _x0 + px1; _y[0] = _y0 + py2;
_x[1] = _x0 - px1; _y[1] = _y[0];
***************
*** 185,192 ****
for (int i = 0; i < 8; ++i) {
t->Transform(tx[i], ty[i], tmpx, tmpy);
! _x[i] = round(tmpx);
! _y[i] = round(tmpy);
}
}
}
--- 187,194 ----
for (int i = 0; i < 8; ++i) {
t->Transform(tx[i], ty[i], tmpx, tmpy);
! _x[i] = Math::round(tmpx);
! _y[i] = Math::round(tmpy);
}
}
}
***************
*** 235,241 ****
void S_Ellipse::draw (Canvas *c, Graphic* gs) {
if (!gs->GetBrush()->None()) {
update(gs);
! #if __GNUC__>=2 && __GNUC_MINOR__>=5
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
--- 237,243 ----
void S_Ellipse::draw (Canvas *c, Graphic* gs) {
if (!gs->GetBrush()->None()) {
update(gs);
! #if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
***************
*** 352,358 ****
_p->FillEllipse(c, _x0, _y0, _r1, _r2);
}
if (!gs->GetBrush()->None()) {
! #if __GNUC__>=2 && __GNUC_MINOR__>=5
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
--- 354,360 ----
_p->FillEllipse(c, _x0, _y0, _r1, _r2);
}
if (!gs->GetBrush()->None()) {
! #if __GNUC__>=2 && __GNUC_MINOR__>=5 || __GNUC__>=3
#undef Ellipse
_p->Ellipse(c, _x0, _y0, _r1, _r2);
#define Ellipse _lib_iv(Ellipse)
Index: Unidraw/geomobjs.c
diff -c Unidraw/geomobjs.c:1.1 Unidraw/geomobjs.c:1.2
*** Unidraw/geomobjs.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/geomobjs.c Thu Jun 14 10:21:59 2001
***************
*** 29,34 ****
--- 29,35 ----
#include <Unidraw/Graphic/util.h>
#include <Unidraw/ulist.h>
+ #include <OS/math.h>
#include <OS/memory.h>
#include <IV-2_6/_enter.h>
***************
*** 241,252 ****
GrowBuf();
}
if (mlcount == 0) {
! mlx[mlcount] = round(x0);
! mly[mlcount] = round(y0);
++mlcount;
}
! mlx[mlcount] = round(x1);
! mly[mlcount] = round(y1);
++mlcount;
}
--- 242,253 ----
GrowBuf();
}
if (mlcount == 0) {
! mlx[mlcount] = Math::round(x0);
! mly[mlcount] = Math::round(y0);
++mlcount;
}
! mlx[mlcount] = Math::round(x1);
! mly[mlcount] = Math::round(y1);
++mlcount;
}
Index: Unidraw/grblock.c
diff -c Unidraw/grblock.c:1.1 Unidraw/grblock.c:1.2
*** Unidraw/grblock.c:1.1 Thu Jan 4 15:32:58 2001
--- src/Unidraw/grblock.c Thu Jun 14 10:21:59 2001
***************
*** 39,44 ****
--- 39,46 ----
#include <IV-2_6/_enter.h>
+ #include <OS/math.h>
+
#include <math.h>
#include <stdlib.h>
***************
*** 263,281 ****
if (p->width != np.width) {
hfactor = float(p->width) / float(np.width);
! np.x0 = round(hfactor * float(np.x0));
np.width = p->width;
! np.curx = round(hfactor * float(np.curx));
! np.curwidth = round(hfactor * float(np.curwidth));
! np.sx = round(hfactor * float(np.sx));
}
if (p->height != np.height) {
vfactor = float(p->height) / float(np.height);
! np.y0 = round(vfactor * float(np.y0));
np.height = p->height;
! np.cury = round(vfactor * float(np.cury));
! np.curheight = round(vfactor * float(np.curheight));
! np.sy = round(vfactor * float(np.sy));
}
}
--- 265,283 ----
if (p->width != np.width) {
hfactor = float(p->width) / float(np.width);
! np.x0 = Math::round(hfactor * float(np.x0));
np.width = p->width;
! np.curx = Math::round(hfactor * float(np.curx));
! np.curwidth = Math::round(hfactor * float(np.curwidth));
! np.sx = Math::round(hfactor * float(np.sx));
}
if (p->height != np.height) {
vfactor = float(p->height) / float(np.height);
! np.y0 = Math::round(vfactor * float(np.y0));
np.height = p->height;
! np.cury = Math::round(vfactor * float(np.cury));
! np.curheight = Math::round(vfactor * float(np.curheight));
! np.sy = Math::round(vfactor * float(np.sy));
}
}
***************
*** 328,339 ****
_graphic->Translate(dx, dy);
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = round((_x0 + dx - halfw)*factor + halfw);
! _y0 = round((_y0 + dy - halfh)*factor + halfh);
! p->width = round(p->width * factor);
! p->height = round(p->height * factor);
! p->curx = round(float(cx) * factor) - halfw;
! p->cury = round(float(cy) * factor) - halfh;
}
_mag *= factor;
}
--- 330,341 ----
_graphic->Translate(dx, dy);
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = Math::round((_x0 + dx - halfw)*factor + halfw);
! _y0 = Math::round((_y0 + dy - halfh)*factor + halfh);
! p->width = Math::round(p->width * factor);
! p->height = Math::round(p->height * factor);
! p->curx = Math::round(float(cx) * factor) - halfw;
! p->cury = Math::round(float(cy) * factor) - halfh;
}
_mag *= factor;
}
***************
*** 418,429 ****
cy = p->cury + halfh;
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = round((_x0 - halfw)*factor + halfw);
! _y0 = round((_y0 - halfh)*factor + halfh);
! p->width = round(p->width * factor);
! p->height = round(p->height * factor);
! p->curx = round(float(cx) * factor) - halfw;
! p->cury = round(float(cy) * factor) - halfh;
p->Update();
Draw();
--- 420,431 ----
cy = p->cury + halfh;
_graphic->Scale(factor, factor, float(halfw), float(halfh));
! _x0 = Math::round((_x0 - halfw)*factor + halfw);
! _y0 = Math::round((_y0 - halfh)*factor + halfh);
! p->width = Math::round(p->width * factor);
! p->height = Math::round(p->height * factor);
! p->curx = Math::round(float(cx) * factor) - halfw;
! p->cury = Math::round(floa...
[truncated message content] |
|
From: <ivt...@li...> - 2001-05-31 22:30:44
|
Patch: ivtools-010530-johnston-025 For: ivtools-0.9.3 Author: joh...@us... Subject: correctly output text objects that contain backslashes Requires: This is an intermediate patch to ivtools-0.9.3. To apply, cd to the top-level directory of the ivtools source tree (the directory with src and config subdirs), and apply like this: patch -p0 <ThisFile Summary of Changes: From John Denker (jsd at research.att.com): >Here is a patch that will allow ivtools to correctly output text >objects that contain backslashes. Index: Attribute/paramlist.c diff -c Attribute/paramlist.c:1.3 Attribute/paramlist.c:1.4 *** Attribute/paramlist.c:1.3 Thu Mar 22 16:27:32 2001 --- src/Attribute/paramlist.c Wed May 30 01:08:11 2001 *************** *** 946,961 **** dot += text.Insert(dot, buf, sizeof(buf) - 1); } else { ! switch (c) { ! case '\\': ! dot += text.Insert(dot, "\\", 1); ! // fall through ! case '"': ! dot += text.Insert(dot, "\\", 1); ! // fall through ! default: ! dot += text.Insert(dot, string, 1); ! } } } text.Insert(dot, "", 1); --- 946,954 ---- dot += text.Insert(dot, buf, sizeof(buf) - 1); } else { ! if (c == '\\' || c == '"') ! dot += text.Insert(dot, "\\", 1); ! dot += text.Insert(dot, string, 1); } } text.Insert(dot, "", 1); *** /dev/null Wed May 30 01:08:32 PDT 2001 --- patches/ivtools-010530-johnston-025 *************** patches/ivtools-010530-johnston-025 *** 0 **** --- 1 ---- + ivtools-010530-johnston-025 |
|
From: <ivt...@li...> - 2001-05-25 00:26:45
|
Patch: ivtools-010524-johnston-024
For: ivtools-0.9.3
Author: joh...@us...
Subject: restore full support for XBM (X bitmap) images
Requires:
This is an intermediate patch to ivtools-0.9.3. To apply, cd to the
top-level directory of the ivtools source tree (the directory with src
and config subdirs), and apply like this:
patch -p0 <ThisFile
Summary of Changes:
- restore full support for XBM (X bitmap) images to drawtool and its
derivatives. idraw was always XBM capable, but drawtool lost support
for this a while back.
Index: OverlayUnidraw/ovimport.c
diff -c OverlayUnidraw/ovimport.c:1.5 OverlayUnidraw/ovimport.c:1.6
*** OverlayUnidraw/ovimport.c:1.5 Thu Apr 5 09:39:45 2001
--- src/OverlayUnidraw/ovimport.c Thu May 24 17:16:11 2001
***************
*** 1525,1530 ****
--- 1525,1540 ----
cerr << "tiftopnm not found\n";
}
+ } else if (strncmp(creator, "X11", 3)==0) {
+ if (pathname && !return_fd && strcmp(pathname,"-")!=0 && !compressed)
+ comp = XBitmap_Image(pathname);
+ else {
+ if (OverlayKit::bincheck("xbmtopbm"))
+ comp = PNM_Image_Filter(*in, return_fd, pnmfd, "xbmtopbm");
+ else
+ cerr << "xbmtopbm not found\n";
+ }
+
} else if (strncmp(creator, "JPEG", 4)==0) {
if (OverlayKit::bincheck("stdcmapppm") &&
OverlayKit::bincheck("djpeg")) {
*** /dev/null Thu May 24 17:16:24 PDT 2001
--- patches/ivtools-010524-johnston-024
*************** patches/ivtools-010524-johnston-024
*** 0 ****
--- 1 ----
+ ivtools-010524-johnston-024
|