Patch #1 for faces v1.5.0; please apply it.

Rich Burridge (richb@stard)
Fri, 19 Apr 1991 16:20:00 +1000

[I solved the missing Faces.ad problem; the compressed tar file on iuvax
didn't have it included, but the shar files did]

-------

This is patch #1 for faces v1.5.0. It's mainly a fixup patch for faces
v1.5.0, which was posted to this list at the beginning of the week.

This patch is also available via the automatic mail archive server. So is
a complete (fully patched) version of faces v1.5.1. Retrieve in the normal
way.

I've also placed a copy of faces v1.5.1 in pub/faces/incoming on
iuvax.cs.indiana.edu. Steve could you move that to the parent directory,
and announce to the list, when you've done this please?

Couple of points:

1/ The faces.sendmail script has changed again. It should be a lot more
portable now (albeit slightly slower).

2/ There is a problem when a mail folder has multiple messages with X-Face:
lines in it. Run it. You'll see what I mean. I've run this through Saber
C, and it doesn't complain, so it's probably not an array out-of-bounds
problem. This code is not the easiest to understand, so I've just added
an entry in the TODO file for now. I expect this will get fixed by one
of the three people on this planet who understands it, and a patch will
be sent out to the list. It'll be while I'm away, but it'll have my
blessing. :-)

When that X-Face: problem has been resolved, I'm going to announce the
availability of this new version of faces to the following newsgroups:

comp.mail.multi-media, comp.sources.d, comp.mail.misc, alt.sys.sun,
comp.windows.x, aus.sources.

On to the patch...

Changes made:

- From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
Part15 contains a duplicate of addr.h. It's identical to the
addr.h extracted by part4.

- From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
Added a NOUTIME definition to the Makefile.dist, for those systems
that don't have a utime() call. Adjusted mon.c and faces.h
accordingly.

- From Mike Khaw <khaw@parcplace.com>
There were 2 uses of do_audio in xview.c that weren't wrapped in
#ifdef AUDIO_SUPPORT which caused 'make xview' to abort on my Sun3.

- From Glenn Satchell <glenn@sybil.Aus.Sun.COM>
Modified the faces.sendmail script to use two invocations of sed,
which is much more portable than the echo -n version.

- Between v1.4.14 and v1.5.0, certain character declarations that were
previously defined as:

char variable[MAXLINE] ;

were changed to

char *variable ;

Fixed up two occurances where the declaraction and an extern for the
declaration didn't match.

- From Steve Kinzler <kinzler@iuvax.cs.indiana.edu>
From Mark Shand <shand@prl.dec.com>
In get_options, char *next is not initialized prior to calling
read_str(&next, ...

- From Victor A. Riley <var@iris.brown.edu>
From Michael Urban <urban%hercules@rand.org>
From John Mackin <john@syd.dit.csiro.au>
The uncompface() routine can scribble all over RAM in certain
circumstances(). This is at about line 72 in compface/gen.c:
Illegal array index 2304 into variable F. Maximum array index is 2303.

[Problem fixed by James Ashton:
The array indices incorrectly range from 1 to WIDTH instead of
from 0 to WIDTH-1 and the same for HEIGHT].

- From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
Faces crashes when using the -e option with a wrong parameter
(nonexistent script etc.)

[I've put a bandaid on this for now, checking for EOF and a reply of
zero, on the first record returned from the popen() pipe. This needs
to be improved when I have more time - Rich].

How to apply this patch:

This patch consists of just the one part. You should use Larry Wall's patch
program to apply these changes. Assuming you've saved this article in a file
called patch1, then you should do the following:

**NOTE** Don't forget the -p0 command line option to patch below.

cd faces_src # directory where your faces source files are.
patch -p0 <patch1
make x11 # Or sunview, xview or news.
make install # You might have to be super-user.

------CUT HERE------patch #1------CUT HERE------

------- patchlevel.h -------
*** /tmp/da22705 Fri Apr 19 16:07:49 1991
--- patchlevel.h Mon Apr 15 20:58:20 1991
***************
*** 14,17 ****
* reported to me then an attempt will be made to fix them.
*/

! #define PATCHLEVEL 0
--- 14,17 ----
* reported to me then an attempt will be made to fix them.
*/

! #define PATCHLEVEL 1

------- get.c -------
*** /tmp/da22717 Fri Apr 19 16:08:41 1991
--- get.c Thu Apr 18 10:37:54 1991
***************
*** 145,151 ****
char *argv[] ;
{
char *faceenv ;
! char *next ; /* The next command line parameter. */
char *pptr ;
int i ;

--- 145,151 ----
char *argv[] ;
{
char *faceenv ;
! char *next = NULL ; /* The next command line parameter. */
char *pptr ;
int i ;

------- main.c -------
*** /tmp/da22720 Fri Apr 19 16:08:42 1991
--- main.c Wed Apr 17 20:30:49 1991
***************
*** 104,110 ****
char face_host[MAXLINE] ; /* Pointer to host name from the "From" line. */
char face_ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */
char face_user[MAXLINE] ; /* Pointer to user name from the "From" line. */
! char facedirs[MAXLINE] ; /* Colon separated list of face directories. */
char *facepath[MAXPATHS+1] ; /* Array of face image directories. */
char *fgcolor = NULL ; /* X11 foreground color. */
char fname[MAXTYPES][MAXLINE] ; /* Array of various face name types. */
--- 104,110 ----
char face_host[MAXLINE] ; /* Pointer to host name from the "From" line. */
char face_ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */
char face_user[MAXLINE] ; /* Pointer to user name from the "From" line. */
! char *facedirs ; /* Colon separated list of face directories. */
char *facepath[MAXPATHS+1] ; /* Array of face image directories. */
char *fgcolor = NULL ; /* X11 foreground color. */
char fname[MAXTYPES][MAXLINE] ; /* Array of various face name types. */

------- mon.c -------
*** /tmp/da22723 Fri Apr 19 16:08:43 1991
--- mon.c Fri Apr 19 15:52:47 1991
***************
*** 32,38 ****
--- 32,41 ----
#endif
#endif
#include <sys/file.h>
+ #ifndef NOUTIME
#include <utime.h>
+ #endif /*!NOUTIME*/
+
#include "faces.h"
#include "extern.h"

***************
*** 594,599 ****
--- 597,603 ----
int cols = maxcols ; /* Maximum number of columns for display. */
int isicon = 0 ; /* Set if there is an initial icon record. */
int rows = 1 ; /* Maximum number of rows for display. */
+ int reply ;

if (userprog == NULL ||
(fp = popen(userprog, "r")) == NULL) /* Connect to user program. */
***************
*** 600,608 ****
{
FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
progname, userprog) ;
! return ;
}
! FGETS(nextline, MAXLINE, fp) ;
if (!EQUAL(nextline, "Cols="))
{
isicon = 1 ;
--- 604,617 ----
{
FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
progname, userprog) ;
! exit(1) ;
}
! if ((reply = fgets(nextline, MAXLINE, fp)) == EOF || !reply)
! {
! FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
! progname, userprog) ;
! exit(1) ;
! }
if (!EQUAL(nextline, "Cols="))
{
isicon = 1 ;
***************
*** 973,975 ****
--- 982,1002 ----
}
fromc_found = froms_found = x_face = 0 ; /* Reset for the next message. */
}
+
+
+ #ifdef NOUTIME
+ int
+ utime(file, ubufp)
+ char *file ;
+ struct utimbuf *ubufp ;
+ {
+ struct timeval tvp[2] ;
+
+ tvp[0].tv_sec = ubufp->actime ;
+ tvp[0].tv_usec = 0 ;
+ tvp[1].tv_sec = ubufp->modtime ;
+ tvp[1].tv_usec = 0 ;
+
+ return utimes(file, tvp) ;
+ }
+ #endif /*NOUTIME*/

------- faces.h -------
*** /tmp/da22726 Fri Apr 19 16:08:45 1991
--- faces.h Tue Apr 16 11:23:52 1991
***************
*** 151,156 ****
--- 151,163 ----
#define rindex strrchr
#endif /*NOINDEX*/

+ #ifdef NOUTIME
+ struct utimbuf { /* Make a utime() definition for systems without it. */
+ time_t actime ;
+ time_t modtime ;
+ } ;
+ #endif /*NOUTIME*/
+
char *getenv(), *malloc(), *realloc() ;
char *index(), *rindex(), *strcpy(), *strlower() ;

***************
*** 244,249 ****
--- 251,260 ----
int get_icon(), get_news_icon(), get_str_resource() ;
int get_sun_icon(), get_x11_icon(), init_ws_type() ;
int parsefrom(), soft_match() ;
+
+ #ifdef NOUTIME
+ int utime() ;
+ #endif /*NOUTIME*/

#ifdef AUDIO_SUPPORT
void check_audio(), play_sound() ;

------- address.y -------
*** /tmp/da22729 Fri Apr 19 16:08:45 1991
--- address.y Wed Apr 17 20:37:05 1991
***************
*** 776,782 ****
{
register char *p;
static char buf[ADDRSIZE];
! extern char hostname[];

if (!is822header(line, "From"))
panic("bad argument to parse822from");
--- 776,782 ----
{
register char *p;
static char buf[ADDRSIZE];
! extern char *hostname;

if (!is822header(line, "From"))
panic("bad argument to parse822from");

------- README -------
*** /tmp/da22732 Fri Apr 19 16:08:46 1991
--- README Fri Apr 19 15:21:19 1991
***************
*** 156,161 ****
--- 156,162 ----
NODOMAINS - uncomment if you don't want full host domain names.
NOINDEX - uncomment if you don't have the index() function.
NOSELECT - uncomment if your machine doesn't have the select() call.
+ NOUTIME - uncomment if your system doesn't have a utime() library call.
PERIOD - alternate period in seconds before recheck.
PLP - uncomment if you are running PLP and monitoring printers.
RAND - uncomment if you are using the RAND mailer.
***************
*** 404,411 ****
Greg Rose, Mike Khaw, Ian Darwin, Ken Wood, Lindsay F. Marshall, Bruno
Pillard, Johan Vromans, Chris Mackerell, Howard Pelling, Alan Skea, Philip
Gladstone, Steve Kinzler, John B. Melby, Philip Colmer, Peter Gray, Mark
! Shand, Michael Urban, Ignatios Souvatzis and Philippe-Andre Prindeville for
! various bug reports, fixes and suggestions for improvement.


----------------------------------------------------------------------------
--- 405,412 ----
Greg Rose, Mike Khaw, Ian Darwin, Ken Wood, Lindsay F. Marshall, Bruno
Pillard, Johan Vromans, Chris Mackerell, Howard Pelling, Alan Skea, Philip
Gladstone, Steve Kinzler, John B. Melby, Philip Colmer, Peter Gray, Mark
! Shand, Michael Urban, Ignatios Souvatzis, Philippe-Andre Prindeville and
! Glenn Satchell for various bug reports, fixes and suggestions for improvement.


----------------------------------------------------------------------------

------- TODO -------
*** /tmp/da22735 Fri Apr 19 16:08:47 1991
--- TODO Fri Apr 19 15:51:07 1991
***************
*** 349,352 ****
--- 349,378 ----

I like #1.

+ * The XView version of faces doesn't save it's faces specific command line
+ options when the user does a "Save Workspace" under OpenWindows.
+
+ * Need to fit up the faces.sendmail script so that it can automatically
+ detect if it's in a BSD on a System V enviroment and adjust the echo
+ accordingly. Can probably steal some code from Larry Walls' Configure
+ program.
+
+ * From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
+ On a Convex Unix V8.1 system, the ansi mode of the compiler
+ complains about zillion things, and the pcc version of the compiler
+ links a library w/o memset. I propose to put a conditional USEBZERO
+ into address.y (3 lines) and mon.c (1 line) to use
+ bzero(string,length) instead of memset(string,'\0',length).
+ Another change was the line '#include <ctype.h>' at the end of
+ faces.h -- else isupper and islower would be searched by the linker.
+
+ * From Victor A. Riley <var@iris.brown.edu>
+ For X11, you copy faces to xfaces yet do nothing after that. You should
+ at least have an install.x11 (and install.xview, install.news, ...)
+ What about the man page for xfaces? I know it is the same as the faces
+ man page, but you should probably link the two man pages together.
+
+ * There is a corruption problem when a mail folder containing multiple
+ messages with X-Face: lines.
+
* Optimise.

------- xview.c -------
*** /tmp/da22738 Fri Apr 19 16:08:48 1991
--- xview.c Tue Apr 16 10:53:20 1991
***************
*** 62,69 ****
static Panel_item props_ctoggle, props_mtoggle, props_ptoggle, props_utoggle ;
static Panel_item props_cmd, props_file, props_host, props_mail, props_name ;
static Panel_item props_apply, props_defs, props_reset ;
! static Panel_item props_audio, props_no, props_period ;
static Panel_item props_tstamp, props_uname ;

static enum mon_type prop_mtype ; /* Current active monitor type. */

--- 62,72 ----
static Panel_item props_ctoggle, props_mtoggle, props_ptoggle, props_utoggle ;
static Panel_item props_cmd, props_file, props_host, props_mail, props_name ;
static Panel_item props_apply, props_defs, props_reset ;
! static Panel_item props_no, props_period ;
static Panel_item props_tstamp, props_uname ;
+ #ifdef AUDIO_SUPPORT
+ static Panel_item props_audio ;
+ #endif /*AUDIO_SUPPORT*/

static enum mon_type prop_mtype ; /* Current active monitor type. */

***************
*** 687,692 ****
--- 690,696 ----
XV_Y, xv_row(props_panel, 4),
PANEL_LABEL_STRING, "seconds",
0) ;
+ #ifdef AUDIO_SUPPORT
props_audio = xv_create(props_panel, PANEL_CHECK_BOX,
PANEL_VALUE_X, xv_col(props_panel, 8),
XV_Y, xv_row(props_panel, 5),
***************
*** 694,699 ****
--- 698,704 ----
"Audio support",
0,
0) ;
+ #endif /*AUDIO_SUPPORT*/
props_no = xv_create(props_panel, PANEL_CHECK_BOX,
PANEL_VALUE_X, xv_col(props_panel, 8),
XV_Y, xv_row(props_panel, 6),
***************
*** 778,784 ****
--- 783,791 ----
{
mtype = prop_mtype ;
period = (int) xv_get(props_period, PANEL_VALUE) ;
+ #ifdef AUDIO_SUPPORT
do_audio = (int) xv_get(props_audio, PANEL_VALUE) ;
+ #endif /*AUDIO_SUPPORT*/
dontshowno = !((int) xv_get(props_no, PANEL_VALUE)) ;
dontshowtime = !((int) xv_get(props_tstamp, PANEL_VALUE)) ;
dontshowuser = !((int) xv_get(props_uname, PANEL_VALUE)) ;
***************
*** 914,920 ****
--- 921,929 ----
if (mtype == MONNEW || mtype == MONALL)
XV_SET(props_mail, PANEL_VALUE, mtype, 0) ;

+ #ifdef AUDIO_SUPPORT
XV_SET(props_audio, PANEL_VALUE, do_audio, 0) ;
+ #endif /*AUDIO_SUPPORT*/
XV_SET(props_period, PANEL_VALUE, period, 0) ;
XV_SET(props_no, PANEL_VALUE, !dontshowno, 0) ;
XV_SET(props_tstamp, PANEL_VALUE, !dontshowtime, 0) ;

------- faces.sendmail -------
*** /tmp/da22741 Fri Apr 19 16:08:49 1991
--- faces.sendmail Fri Apr 19 15:17:44 1991
***************
*** 11,18 ****
# to your ~/.mailrc file. See the faces manual pages for more details, and
# how to setup yout ~/.face file.
#
! # Copyright (c) John Mackin - All rights reserved.
#
# Permission is given to distribute these sources, as long as the
# copyright messages are not removed, and no monies are exchanged.
#
--- 11,21 ----
# to your ~/.mailrc file. See the faces manual pages for more details, and
# how to setup yout ~/.face file.
#
! # Original version: Copyright 1990 John J. Mackin. All rights reserved.
#
+ # This derived version: Copyright 1991 - Philippe-Andre Prindeville
+ # Glenn Statchell
+ #
# Permission is given to distribute these sources, as long as the
# copyright messages are not removed, and no monies are exchanged.
#
***************
*** 21,27 ****
# reported to me then an attempt will be made to fix them.
#
TMP=/tmp/face$$ export TMP
! ( echo -n "X-Face:" ; cat $HOME/.face ; echo "") > $TMP
sed -n -e '/^$/!{p;d;}' \
-e "r "$TMP \
-e n \
--- 24,30 ----
# reported to me then an attempt will be made to fix them.
#
TMP=/tmp/face$$ export TMP
! sed '1s/^/X-Face:/' $HOME/.face >> $TMP
sed -n -e '/^$/!{p;d;}' \
-e "r "$TMP \
-e n \

------- Makefile.dist -------
*** /tmp/da22744 Fri Apr 19 16:08:50 1991
--- Makefile.dist Tue Apr 16 11:17:13 1991
***************
*** 137,142 ****
--- 137,147 ----
# need to uncomment the following definition.
#NOSELECT = -DNOSELECT
#--------------------------------------------------------------------------
+ # If your system lacks the utime() library call and definition, then
+ # uncomment the following definition.
+ #
+ #NOUTIME = -DNOUTIME
+ #--------------------------------------------------------------------------
# By default, faces rechecks for new mail or print jobs every sixty
# seconds. If you would like to specify an alternate period, then uncomment
# the following line and set appropriately.
***************
*** 245,251 ****
$(BACKGROUND) $(DNSLOOKUP) $(DONTSHOWNO) $(DONTSHOWTIME) \
$(DONTSHOWUSER) $(CFACEDIR) $(FMONTYPE) $(INVERT) \
$(NAMEUNKNOWN) $(NEWSINCDIR) $(NISLOOKUP) $(NODOMAINS) \
! $(NOINDEX) $(NOSELECT) $(PERIOD) $(PLP) $(RAND) \
$(REVORDER) $(SELTYPE) $(SPOOLDIR) $(SPOOLFILE) $(SYSV) \
$(TTEXT) $(UPDATE) $(X11R3) $(X11INCDIR) $(XVIEWINCDIR) \
$(DEBUG)
--- 250,256 ----
$(BACKGROUND) $(DNSLOOKUP) $(DONTSHOWNO) $(DONTSHOWTIME) \
$(DONTSHOWUSER) $(CFACEDIR) $(FMONTYPE) $(INVERT) \
$(NAMEUNKNOWN) $(NEWSINCDIR) $(NISLOOKUP) $(NODOMAINS) \
! $(NOINDEX) $(NOSELECT) $(NOUTIME) $(PERIOD) $(PLP) $(RAND) \
$(REVORDER) $(SELTYPE) $(SPOOLDIR) $(SPOOLFILE) $(SYSV) \
$(TTEXT) $(UPDATE) $(X11R3) $(X11INCDIR) $(XVIEWINCDIR) \
$(DEBUG)
***************
*** 289,295 ****
SFILES12 = $(COMPFACE)
SFILES13 = $(FILTERS)
SFILES14 = $(SCRIPTS)
! SFILES15 = addr.h address.y

NEWSLIBS = $(NEWSLIBDIR) -lcps
SVIEWLIBS = -lsuntool -lsunwindow -lpixrect
--- 294,300 ----
SFILES12 = $(COMPFACE)
SFILES13 = $(FILTERS)
SFILES14 = $(SCRIPTS)
! SFILES15 = address.y

NEWSLIBS = $(NEWSLIBDIR) -lcps
SVIEWLIBS = -lsuntool -lsunwindow -lpixrect

------- CHANGES -------
*** /tmp/da22747 Fri Apr 19 16:08:50 1991
--- CHANGES Fri Apr 19 15:50:58 1991
***************
*** 15,20 ****
--- 15,75 ----
Faces change history.
=====================

+ v1.5 - patchlevel 1 - 18th April 1991.
+
+ - From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
+ Part15 contains a duplicate of addr.h. It's identical to the
+ addr.h extracted by part4.
+
+ - From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
+ Added a NOUTIME definition to the Makefile.dist, for those systems
+ that don't have a utime() call. Adjusted mon.c and faces.h
+ accordingly.
+
+ - From Mike Khaw <khaw@parcplace.com>
+ There were 2 uses of do_audio in xview.c that weren't wrapped in
+ #ifdef AUDIO_SUPPORT which caused 'make xview' to abort on my Sun3.
+
+ - From Glenn Satchell <glenn@sybil.Aus.Sun.COM>
+ Modified the faces.sendmail script to use two invocations of sed,
+ which is much more portable than the echo -n version.
+
+ - Between v1.4.14 and v1.5.0, certain character declarations that were
+ previously defined as:
+
+ char variable[MAXLINE] ;
+
+ were changed to
+
+ char *variable ;
+
+ Fixed up two occurances where the declaraction and an extern for the
+ declaration didn't match.
+
+ - From Steve Kinzler <kinzler@iuvax.cs.indiana.edu>
+ From Mark Shand <shand@prl.dec.com>
+ In get_options, char *next is not initialized prior to calling
+ read_str(&next, ...
+
+ - From Victor A. Riley <var@iris.brown.edu>
+ From Michael Urban <urban%hercules@rand.org>
+ From John Mackin <john@syd.dit.csiro.au>
+ The uncompface() routine can scribble all over RAM in certain
+ circumstances(). This is at about line 72 in compface/gen.c:
+ Illegal array index 2304 into variable F. Maximum array index is 2303.
+
+ [Problem fixed by James Ashton:
+ The array indices incorrectly range from 1 to WIDTH instead of
+ from 0 to WIDTH-1 and the same for HEIGHT].
+
+ - From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
+ Faces crashes when using the -e option with a wrong parameter
+ (nonexistent script etc.)
+
+ [I've put a bandaid on this for now, checking for EOF and a reply of
+ zero, on the first record returned from the popen() pipe. This needs
+ to be improved when I have more time - Rich].
+
v1.5 - patchlevel 0 - 15th April 1991.

- From David Purdue <davidp@kau1.kodak.com>

------- compface/gen.c -------
*** /tmp/da22791 Fri Apr 19 16:10:11 1991
--- compface/gen.c Thu Apr 18 12:10:14 1991
***************
*** 22,34 ****
{
register int m, l, k, j, i, h;

! j = 0;
! while (j++ < HEIGHT)
{
! i = 0;
! while (i++ < WIDTH)
{
- h = i + j * WIDTH;
k = 0;
for (l = i - 2; l <= i + 2; l++)
for (m = j - 2; m <= j; m++)
--- 22,32 ----
{
register int m, l, k, j, i, h;

! for (j = 0; j < HEIGHT; j++)
{
! h = j * WIDTH;
! for (i = 0; i < WIDTH; i++, h++)
{
k = 0;
for (l = i - 2; l <= i + 2; l++)
for (m = j - 2; m <= j; m++)
***************
*** 35,74 ****
{
if ((l >= i) && (m == j))
continue;
! if ((l > 0) && (l <= WIDTH) && (m > 0))
k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
}
switch (i)
{
! case 1 :
switch (j)
{
! case 1 : GEN(g_22);
! case 2 : GEN(g_21);
default : GEN(g_20);
}
break;
! case 2 :
switch (j)
{
! case 1 : GEN(g_12);
! case 2 : GEN(g_11);
default : GEN(g_10);
}
break;
! case WIDTH - 1 :
switch (j)
{
! case 1 : GEN(g_42);
! case 2 : GEN(g_41);
default : GEN(g_40);
}
break;
! case WIDTH :
switch (j)
{
! case 1 : GEN(g_32);
! case 2 : GEN(g_31);
default : GEN(g_30);
}
break;
--- 33,72 ----
{
if ((l >= i) && (m == j))
continue;
! if ((l >= 0) && (l < WIDTH) && (m >= 0))
k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
}
switch (i)
{
! case 0 :
switch (j)
{
! case 0 : GEN(g_22);
! case 1 : GEN(g_21);
default : GEN(g_20);
}
break;
! case 1 :
switch (j)
{
! case 0 : GEN(g_12);
! case 1 : GEN(g_11);
default : GEN(g_10);
}
break;
! case WIDTH - 2 :
switch (j)
{
! case 0 : GEN(g_42);
! case 1 : GEN(g_41);
default : GEN(g_40);
}
break;
! case WIDTH - 1 :
switch (j)
{
! case 0 : GEN(g_32);
! case 1 : GEN(g_31);
default : GEN(g_30);
}
break;
***************
*** 75,82 ****
default :
switch (j)
{
! case 1 : GEN(g_02);
! case 2 : GEN(g_01);
default : GEN(g_00);
}
break;
--- 73,80 ----
default :
switch (j)
{
! case 0 : GEN(g_02);
! case 1 : GEN(g_01);
default : GEN(g_00);
}
break;

>From richb Fri Apr 19 16:18:22 1991
From: richb
To: faces
Subject: Patch #1 for faces v1.5.0; please apply it.
Date: Fri, 19 Apr 1991 16:18:22 +1000

[I solved the missing Faces.ad problem; the compressed tar file on iuvax
didn't have it included, but the shar files did]

-------

This is patch #1 for faces v1.5.0. It's mainly a fixup patch for faces
v1.5.0, which was posted to this list at the beginning of the week.

This patch is also available via the automatic mail archive server. So is
a complete (fully patched) version of faces v1.5.1. Retrieve in the normal
way.

I've also placed a copy of faces v1.5.1 in pub/faces/incoming on
iuvax.cs.indiana.edu. Steve could you move that to the parent directory,
and announce to the list, when you've done this please?

Couple of points:

1/ The faces.sendmail script has changed again. It should be a lot more
portable now (albeit slightly slower).

2/ There is a problem when a mail folder has multiple messages with X-Face:
lines in it. Run it. You'll see what I mean. I've run this through Saber
C, and it doesn't complain, so it's probably not an array out-of-bounds
problem. This code is not the easiest to understand, so I've just added
an entry in the TODO file for now. I expect this will get fixed by one
of the three people on this planet who understands it, and a patch will
be sent out to the list. It'll be while I'm away, but it'll have my
blessing. :-)

When that X-Face: problem has been resolved, I'm going to announce the
availability of this new version of faces to the following newsgroups:

comp.mail.multi-media, comp.sources.d, comp.mail.misc, alt.sys.sun,
comp.windows.x, aus.sources.

On to the patch...

Changes made:

- From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
Part15 contains a duplicate of addr.h. It's identical to the
addr.h extracted by part4.

- From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
Added a NOUTIME definition to the Makefile.dist, for those systems
that don't have a utime() call. Adjusted mon.c and faces.h
accordingly.

- From Mike Khaw <khaw@parcplace.com>
There were 2 uses of do_audio in xview.c that weren't wrapped in
#ifdef AUDIO_SUPPORT which caused 'make xview' to abort on my Sun3.

- From Glenn Satchell <glenn@sybil.Aus.Sun.COM>
Modified the faces.sendmail script to use two invocations of sed,
which is much more portable than the echo -n version.

- Between v1.4.14 and v1.5.0, certain character declarations that were
previously defined as:

char variable[MAXLINE] ;

were changed to

char *variable ;

Fixed up two occurances where the declaraction and an extern for the
declaration didn't match.

- From Steve Kinzler <kinzler@iuvax.cs.indiana.edu>
From Mark Shand <shand@prl.dec.com>
In get_options, char *next is not initialized prior to calling
read_str(&next, ...

- From Victor A. Riley <var@iris.brown.edu>
From Michael Urban <urban%hercules@rand.org>
From John Mackin <john@syd.dit.csiro.au>
The uncompface() routine can scribble all over RAM in certain
circumstances(). This is at about line 72 in compface/gen.c:
Illegal array index 2304 into variable F. Maximum array index is 2303.

[Problem fixed by James Ashton:
The array indices incorrectly range from 1 to WIDTH instead of
from 0 to WIDTH-1 and the same for HEIGHT].

- From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
Faces crashes when using the -e option with a wrong parameter
(nonexistent script etc.)

[I've put a bandaid on this for now, checking for EOF and a reply of
zero, on the first record returned from the popen() pipe. This needs
to be improved when I have more time - Rich].

How to apply this patch:

This patch consists of just the one part. You should use Larry Wall's patch
program to apply these changes. Assuming you've saved this article in a file
called patch1, then you should do the following:

**NOTE** Don't forget the -p0 command line option to patch below.

cd faces_src # directory where your faces source files are.
patch -p0 <patch1
make x11 # Or sunview, xview or news.
make install # You might have to be super-user.

------CUT HERE------patch #1------CUT HERE------

------- patchlevel.h -------
*** /tmp/da22705 Fri Apr 19 16:07:49 1991
--- patchlevel.h Mon Apr 15 20:58:20 1991
***************
*** 14,17 ****
* reported to me then an attempt will be made to fix them.
*/

! #define PATCHLEVEL 0
--- 14,17 ----
* reported to me then an attempt will be made to fix them.
*/

! #define PATCHLEVEL 1

------- get.c -------
*** /tmp/da22717 Fri Apr 19 16:08:41 1991
--- get.c Thu Apr 18 10:37:54 1991
***************
*** 145,151 ****
char *argv[] ;
{
char *faceenv ;
! char *next ; /* The next command line parameter. */
char *pptr ;
int i ;

--- 145,151 ----
char *argv[] ;
{
char *faceenv ;
! char *next = NULL ; /* The next command line parameter. */
char *pptr ;
int i ;

------- main.c -------
*** /tmp/da22720 Fri Apr 19 16:08:42 1991
--- main.c Wed Apr 17 20:30:49 1991
***************
*** 104,110 ****
char face_host[MAXLINE] ; /* Pointer to host name from the "From" line. */
char face_ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */
char face_user[MAXLINE] ; /* Pointer to user name from the "From" line. */
! char facedirs[MAXLINE] ; /* Colon separated list of face directories. */
char *facepath[MAXPATHS+1] ; /* Array of face image directories. */
char *fgcolor = NULL ; /* X11 foreground color. */
char fname[MAXTYPES][MAXLINE] ; /* Array of various face name types. */
--- 104,110 ----
char face_host[MAXLINE] ; /* Pointer to host name from the "From" line. */
char face_ts[MAXLINE] ; /* Pointer to time stamp from the "From" line. */
char face_user[MAXLINE] ; /* Pointer to user name from the "From" line. */
! char *facedirs ; /* Colon separated list of face directories. */
char *facepath[MAXPATHS+1] ; /* Array of face image directories. */
char *fgcolor = NULL ; /* X11 foreground color. */
char fname[MAXTYPES][MAXLINE] ; /* Array of various face name types. */

------- mon.c -------
*** /tmp/da22723 Fri Apr 19 16:08:43 1991
--- mon.c Fri Apr 19 15:52:47 1991
***************
*** 32,38 ****
--- 32,41 ----
#endif
#endif
#include <sys/file.h>
+ #ifndef NOUTIME
#include <utime.h>
+ #endif /*!NOUTIME*/
+
#include "faces.h"
#include "extern.h"

***************
*** 594,599 ****
--- 597,603 ----
int cols = maxcols ; /* Maximum number of columns for display. */
int isicon = 0 ; /* Set if there is an initial icon record. */
int rows = 1 ; /* Maximum number of rows for display. */
+ int reply ;

if (userprog == NULL ||
(fp = popen(userprog, "r")) == NULL) /* Connect to user program. */
***************
*** 600,608 ****
{
FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
progname, userprog) ;
! return ;
}
! FGETS(nextline, MAXLINE, fp) ;
if (!EQUAL(nextline, "Cols="))
{
isicon = 1 ;
--- 604,617 ----
{
FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
progname, userprog) ;
! exit(1) ;
}
! if ((reply = fgets(nextline, MAXLINE, fp)) == EOF || !reply)
! {
! FPRINTF(stderr,"%s: couldn't get program (%s) information.\n",
! progname, userprog) ;
! exit(1) ;
! }
if (!EQUAL(nextline, "Cols="))
{
isicon = 1 ;
***************
*** 973,975 ****
--- 982,1002 ----
}
fromc_found = froms_found = x_face = 0 ; /* Reset for the next message. */
}
+
+
+ #ifdef NOUTIME
+ int
+ utime(file, ubufp)
+ char *file ;
+ struct utimbuf *ubufp ;
+ {
+ struct timeval tvp[2] ;
+
+ tvp[0].tv_sec = ubufp->actime ;
+ tvp[0].tv_usec = 0 ;
+ tvp[1].tv_sec = ubufp->modtime ;
+ tvp[1].tv_usec = 0 ;
+
+ return utimes(file, tvp) ;
+ }
+ #endif /*NOUTIME*/

------- faces.h -------
*** /tmp/da22726 Fri Apr 19 16:08:45 1991
--- faces.h Tue Apr 16 11:23:52 1991
***************
*** 151,156 ****
--- 151,163 ----
#define rindex strrchr
#endif /*NOINDEX*/

+ #ifdef NOUTIME
+ struct utimbuf { /* Make a utime() definition for systems without it. */
+ time_t actime ;
+ time_t modtime ;
+ } ;
+ #endif /*NOUTIME*/
+
char *getenv(), *malloc(), *realloc() ;
char *index(), *rindex(), *strcpy(), *strlower() ;

***************
*** 244,249 ****
--- 251,260 ----
int get_icon(), get_news_icon(), get_str_resource() ;
int get_sun_icon(), get_x11_icon(), init_ws_type() ;
int parsefrom(), soft_match() ;
+
+ #ifdef NOUTIME
+ int utime() ;
+ #endif /*NOUTIME*/

#ifdef AUDIO_SUPPORT
void check_audio(), play_sound() ;

------- address.y -------
*** /tmp/da22729 Fri Apr 19 16:08:45 1991
--- address.y Wed Apr 17 20:37:05 1991
***************
*** 776,782 ****
{
register char *p;
static char buf[ADDRSIZE];
! extern char hostname[];

if (!is822header(line, "From"))
panic("bad argument to parse822from");
--- 776,782 ----
{
register char *p;
static char buf[ADDRSIZE];
! extern char *hostname;

if (!is822header(line, "From"))
panic("bad argument to parse822from");

------- README -------
*** /tmp/da22732 Fri Apr 19 16:08:46 1991
--- README Fri Apr 19 15:21:19 1991
***************
*** 156,161 ****
--- 156,162 ----
NODOMAINS - uncomment if you don't want full host domain names.
NOINDEX - uncomment if you don't have the index() function.
NOSELECT - uncomment if your machine doesn't have the select() call.
+ NOUTIME - uncomment if your system doesn't have a utime() library call.
PERIOD - alternate period in seconds before recheck.
PLP - uncomment if you are running PLP and monitoring printers.
RAND - uncomment if you are using the RAND mailer.
***************
*** 404,411 ****
Greg Rose, Mike Khaw, Ian Darwin, Ken Wood, Lindsay F. Marshall, Bruno
Pillard, Johan Vromans, Chris Mackerell, Howard Pelling, Alan Skea, Philip
Gladstone, Steve Kinzler, John B. Melby, Philip Colmer, Peter Gray, Mark
! Shand, Michael Urban, Ignatios Souvatzis and Philippe-Andre Prindeville for
! various bug reports, fixes and suggestions for improvement.


----------------------------------------------------------------------------
--- 405,412 ----
Greg Rose, Mike Khaw, Ian Darwin, Ken Wood, Lindsay F. Marshall, Bruno
Pillard, Johan Vromans, Chris Mackerell, Howard Pelling, Alan Skea, Philip
Gladstone, Steve Kinzler, John B. Melby, Philip Colmer, Peter Gray, Mark
! Shand, Michael Urban, Ignatios Souvatzis, Philippe-Andre Prindeville and
! Glenn Satchell for various bug reports, fixes and suggestions for improvement.


----------------------------------------------------------------------------

------- TODO -------
*** /tmp/da22735 Fri Apr 19 16:08:47 1991
--- TODO Fri Apr 19 15:51:07 1991
***************
*** 349,352 ****
--- 349,378 ----

I like #1.

+ * The XView version of faces doesn't save it's faces specific command line
+ options when the user does a "Save Workspace" under OpenWindows.
+
+ * Need to fit up the faces.sendmail script so that it can automatically
+ detect if it's in a BSD on a System V enviroment and adjust the echo
+ accordingly. Can probably steal some code from Larry Walls' Configure
+ program.
+
+ * From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
+ On a Convex Unix V8.1 system, the ansi mode of the compiler
+ complains about zillion things, and the pcc version of the compiler
+ links a library w/o memset. I propose to put a conditional USEBZERO
+ into address.y (3 lines) and mon.c (1 line) to use
+ bzero(string,length) instead of memset(string,'\0',length).
+ Another change was the line '#include <ctype.h>' at the end of
+ faces.h -- else isupper and islower would be searched by the linker.
+
+ * From Victor A. Riley <var@iris.brown.edu>
+ For X11, you copy faces to xfaces yet do nothing after that. You should
+ at least have an install.x11 (and install.xview, install.news, ...)
+ What about the man page for xfaces? I know it is the same as the faces
+ man page, but you should probably link the two man pages together.
+
+ * There is a corruption problem when a mail folder containing multiple
+ messages with X-Face: lines.
+
* Optimise.

------- xview.c -------
*** /tmp/da22738 Fri Apr 19 16:08:48 1991
--- xview.c Tue Apr 16 10:53:20 1991
***************
*** 62,69 ****
static Panel_item props_ctoggle, props_mtoggle, props_ptoggle, props_utoggle ;
static Panel_item props_cmd, props_file, props_host, props_mail, props_name ;
static Panel_item props_apply, props_defs, props_reset ;
! static Panel_item props_audio, props_no, props_period ;
static Panel_item props_tstamp, props_uname ;

static enum mon_type prop_mtype ; /* Current active monitor type. */

--- 62,72 ----
static Panel_item props_ctoggle, props_mtoggle, props_ptoggle, props_utoggle ;
static Panel_item props_cmd, props_file, props_host, props_mail, props_name ;
static Panel_item props_apply, props_defs, props_reset ;
! static Panel_item props_no, props_period ;
static Panel_item props_tstamp, props_uname ;
+ #ifdef AUDIO_SUPPORT
+ static Panel_item props_audio ;
+ #endif /*AUDIO_SUPPORT*/

static enum mon_type prop_mtype ; /* Current active monitor type. */

***************
*** 687,692 ****
--- 690,696 ----
XV_Y, xv_row(props_panel, 4),
PANEL_LABEL_STRING, "seconds",
0) ;
+ #ifdef AUDIO_SUPPORT
props_audio = xv_create(props_panel, PANEL_CHECK_BOX,
PANEL_VALUE_X, xv_col(props_panel, 8),
XV_Y, xv_row(props_panel, 5),
***************
*** 694,699 ****
--- 698,704 ----
"Audio support",
0,
0) ;
+ #endif /*AUDIO_SUPPORT*/
props_no = xv_create(props_panel, PANEL_CHECK_BOX,
PANEL_VALUE_X, xv_col(props_panel, 8),
XV_Y, xv_row(props_panel, 6),
***************
*** 778,784 ****
--- 783,791 ----
{
mtype = prop_mtype ;
period = (int) xv_get(props_period, PANEL_VALUE) ;
+ #ifdef AUDIO_SUPPORT
do_audio = (int) xv_get(props_audio, PANEL_VALUE) ;
+ #endif /*AUDIO_SUPPORT*/
dontshowno = !((int) xv_get(props_no, PANEL_VALUE)) ;
dontshowtime = !((int) xv_get(props_tstamp, PANEL_VALUE)) ;
dontshowuser = !((int) xv_get(props_uname, PANEL_VALUE)) ;
***************
*** 914,920 ****
--- 921,929 ----
if (mtype == MONNEW || mtype == MONALL)
XV_SET(props_mail, PANEL_VALUE, mtype, 0) ;

+ #ifdef AUDIO_SUPPORT
XV_SET(props_audio, PANEL_VALUE, do_audio, 0) ;
+ #endif /*AUDIO_SUPPORT*/
XV_SET(props_period, PANEL_VALUE, period, 0) ;
XV_SET(props_no, PANEL_VALUE, !dontshowno, 0) ;
XV_SET(props_tstamp, PANEL_VALUE, !dontshowtime, 0) ;

------- faces.sendmail -------
*** /tmp/da22741 Fri Apr 19 16:08:49 1991
--- faces.sendmail Fri Apr 19 15:17:44 1991
***************
*** 11,18 ****
# to your ~/.mailrc file. See the faces manual pages for more details, and
# how to setup yout ~/.face file.
#
! # Copyright (c) John Mackin - All rights reserved.
#
# Permission is given to distribute these sources, as long as the
# copyright messages are not removed, and no monies are exchanged.
#
--- 11,21 ----
# to your ~/.mailrc file. See the faces manual pages for more details, and
# how to setup yout ~/.face file.
#
! # Original version: Copyright 1990 John J. Mackin. All rights reserved.
#
+ # This derived version: Copyright 1991 - Philippe-Andre Prindeville
+ # Glenn Statchell
+ #
# Permission is given to distribute these sources, as long as the
# copyright messages are not removed, and no monies are exchanged.
#
***************
*** 21,27 ****
# reported to me then an attempt will be made to fix them.
#
TMP=/tmp/face$$ export TMP
! ( echo -n "X-Face:" ; cat $HOME/.face ; echo "") > $TMP
sed -n -e '/^$/!{p;d;}' \
-e "r "$TMP \
-e n \
--- 24,30 ----
# reported to me then an attempt will be made to fix them.
#
TMP=/tmp/face$$ export TMP
! sed '1s/^/X-Face:/' $HOME/.face >> $TMP
sed -n -e '/^$/!{p;d;}' \
-e "r "$TMP \
-e n \

------- Makefile.dist -------
*** /tmp/da22744 Fri Apr 19 16:08:50 1991
--- Makefile.dist Tue Apr 16 11:17:13 1991
***************
*** 137,142 ****
--- 137,147 ----
# need to uncomment the following definition.
#NOSELECT = -DNOSELECT
#--------------------------------------------------------------------------
+ # If your system lacks the utime() library call and definition, then
+ # uncomment the following definition.
+ #
+ #NOUTIME = -DNOUTIME
+ #--------------------------------------------------------------------------
# By default, faces rechecks for new mail or print jobs every sixty
# seconds. If you would like to specify an alternate period, then uncomment
# the following line and set appropriately.
***************
*** 245,251 ****
$(BACKGROUND) $(DNSLOOKUP) $(DONTSHOWNO) $(DONTSHOWTIME) \
$(DONTSHOWUSER) $(CFACEDIR) $(FMONTYPE) $(INVERT) \
$(NAMEUNKNOWN) $(NEWSINCDIR) $(NISLOOKUP) $(NODOMAINS) \
! $(NOINDEX) $(NOSELECT) $(PERIOD) $(PLP) $(RAND) \
$(REVORDER) $(SELTYPE) $(SPOOLDIR) $(SPOOLFILE) $(SYSV) \
$(TTEXT) $(UPDATE) $(X11R3) $(X11INCDIR) $(XVIEWINCDIR) \
$(DEBUG)
--- 250,256 ----
$(BACKGROUND) $(DNSLOOKUP) $(DONTSHOWNO) $(DONTSHOWTIME) \
$(DONTSHOWUSER) $(CFACEDIR) $(FMONTYPE) $(INVERT) \
$(NAMEUNKNOWN) $(NEWSINCDIR) $(NISLOOKUP) $(NODOMAINS) \
! $(NOINDEX) $(NOSELECT) $(NOUTIME) $(PERIOD) $(PLP) $(RAND) \
$(REVORDER) $(SELTYPE) $(SPOOLDIR) $(SPOOLFILE) $(SYSV) \
$(TTEXT) $(UPDATE) $(X11R3) $(X11INCDIR) $(XVIEWINCDIR) \
$(DEBUG)
***************
*** 289,295 ****
SFILES12 = $(COMPFACE)
SFILES13 = $(FILTERS)
SFILES14 = $(SCRIPTS)
! SFILES15 = addr.h address.y

NEWSLIBS = $(NEWSLIBDIR) -lcps
SVIEWLIBS = -lsuntool -lsunwindow -lpixrect
--- 294,300 ----
SFILES12 = $(COMPFACE)
SFILES13 = $(FILTERS)
SFILES14 = $(SCRIPTS)
! SFILES15 = address.y

NEWSLIBS = $(NEWSLIBDIR) -lcps
SVIEWLIBS = -lsuntool -lsunwindow -lpixrect

------- CHANGES -------
*** /tmp/da22747 Fri Apr 19 16:08:50 1991
--- CHANGES Fri Apr 19 15:50:58 1991
***************
*** 15,20 ****
--- 15,75 ----
Faces change history.
=====================

+ v1.5 - patchlevel 1 - 18th April 1991.
+
+ - From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
+ Part15 contains a duplicate of addr.h. It's identical to the
+ addr.h extracted by part4.
+
+ - From Cameron Simpson <cameron@spectrum.cs.unsw.oz.au>
+ Added a NOUTIME definition to the Makefile.dist, for those systems
+ that don't have a utime() call. Adjusted mon.c and faces.h
+ accordingly.
+
+ - From Mike Khaw <khaw@parcplace.com>
+ There were 2 uses of do_audio in xview.c that weren't wrapped in
+ #ifdef AUDIO_SUPPORT which caused 'make xview' to abort on my Sun3.
+
+ - From Glenn Satchell <glenn@sybil.Aus.Sun.COM>
+ Modified the faces.sendmail script to use two invocations of sed,
+ which is much more portable than the echo -n version.
+
+ - Between v1.4.14 and v1.5.0, certain character declarations that were
+ previously defined as:
+
+ char variable[MAXLINE] ;
+
+ were changed to
+
+ char *variable ;
+
+ Fixed up two occurances where the declaraction and an extern for the
+ declaration didn't match.
+
+ - From Steve Kinzler <kinzler@iuvax.cs.indiana.edu>
+ From Mark Shand <shand@prl.dec.com>
+ In get_options, char *next is not initialized prior to calling
+ read_str(&next, ...
+
+ - From Victor A. Riley <var@iris.brown.edu>
+ From Michael Urban <urban%hercules@rand.org>
+ From John Mackin <john@syd.dit.csiro.au>
+ The uncompface() routine can scribble all over RAM in certain
+ circumstances(). This is at about line 72 in compface/gen.c:
+ Illegal array index 2304 into variable F. Maximum array index is 2303.
+
+ [Problem fixed by James Ashton:
+ The array indices incorrectly range from 1 to WIDTH instead of
+ from 0 to WIDTH-1 and the same for HEIGHT].
+
+ - From Ignatios Souvatzis <u502sou@mpirbn.mpifr-bonn.mpg.de>
+ Faces crashes when using the -e option with a wrong parameter
+ (nonexistent script etc.)
+
+ [I've put a bandaid on this for now, checking for EOF and a reply of
+ zero, on the first record returned from the popen() pipe. This needs
+ to be improved when I have more time - Rich].
+
v1.5 - patchlevel 0 - 15th April 1991.

- From David Purdue <davidp@kau1.kodak.com>

------- compface/gen.c -------
*** /tmp/da22791 Fri Apr 19 16:10:11 1991
--- compface/gen.c Thu Apr 18 12:10:14 1991
***************
*** 22,34 ****
{
register int m, l, k, j, i, h;

! j = 0;
! while (j++ < HEIGHT)
{
! i = 0;
! while (i++ < WIDTH)
{
- h = i + j * WIDTH;
k = 0;
for (l = i - 2; l <= i + 2; l++)
for (m = j - 2; m <= j; m++)
--- 22,32 ----
{
register int m, l, k, j, i, h;

! for (j = 0; j < HEIGHT; j++)
{
! h = j * WIDTH;
! for (i = 0; i < WIDTH; i++, h++)
{
k = 0;
for (l = i - 2; l <= i + 2; l++)
for (m = j - 2; m <= j; m++)
***************
*** 35,74 ****
{
if ((l >= i) && (m == j))
continue;
! if ((l > 0) && (l <= WIDTH) && (m > 0))
k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
}
switch (i)
{
! case 1 :
switch (j)
{
! case 1 : GEN(g_22);
! case 2 : GEN(g_21);
default : GEN(g_20);
}
break;
! case 2 :
switch (j)
{
! case 1 : GEN(g_12);
! case 2 : GEN(g_11);
default : GEN(g_10);
}
break;
! case WIDTH - 1 :
switch (j)
{
! case 1 : GEN(g_42);
! case 2 : GEN(g_41);
default : GEN(g_40);
}
break;
! case WIDTH :
switch (j)
{
! case 1 : GEN(g_32);
! case 2 : GEN(g_31);
default : GEN(g_30);
}
break;
--- 33,72 ----
{
if ((l >= i) && (m == j))
continue;
! if ((l >= 0) && (l < WIDTH) && (m >= 0))
k = *(f + l + m * WIDTH) ? k * 2 + 1 : k * 2;
}
switch (i)
{
! case 0 :
switch (j)
{
! case 0 : GEN(g_22);
! case 1 : GEN(g_21);
default : GEN(g_20);
}
break;
! case 1 :
switch (j)
{
! case 0 : GEN(g_12);
! case 1 : GEN(g_11);
default : GEN(g_10);
}
break;
! case WIDTH - 2 :
switch (j)
{
! case 0 : GEN(g_42);
! case 1 : GEN(g_41);
default : GEN(g_40);
}
break;
! case WIDTH - 1 :
switch (j)
{
! case 0 : GEN(g_32);
! case 1 : GEN(g_31);
default : GEN(g_30);
}
break;
***************
*** 75,82 ****
default :
switch (j)
{
! case 1 : GEN(g_02);
! case 2 : GEN(g_01);
default : GEN(g_00);
}
break;
--- 73,80 ----
default :
switch (j)
{
! case 0 : GEN(g_02);
! case 1 : GEN(g_01);
default : GEN(g_00);
}
break;