grunwald@foobar.colorado.edu (Dirk Grunwald) (11/01/89)
The following patches speed up the display speed (eliminating a floating point computation) and allow version 2.10 of texx2 to run on with the Sun X11R3 installation. This last bug is caused by not explicitly setting the the list resource in the List widget. I've bumped the version number and installed another tar on expo. Diffs w.r.t. version 2.10 rcsdiff -c -q -rtexx2- texx2.c widgets.c file.c dialog.c dvi-simple.c page.c x11fonts.c mark.c DviPage.c DviPage2.c mftobdf.c DviPage.h dvi-simple.h mio.h texx2.h x11fonts.h DviPageP.h mark.h page.h widgets.h texx2.man Texx2.ad Imakefile Makefile ChangeLog mftobdf.man *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:45 1989 --- texx2.c Mon Oct 30 11:11:23 1989 *************** *** 149,153 **** --- 149,154 ---- } XtMainLoop(); + exit(0); } *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:45 1989 --- widgets.c Mon Oct 30 15:18:20 1989 *************** *** 67,74 **** tableWidgetClass, topLevel, argList, args); #endif ! BuildFileLevel(topPane); ! BuildErrorBox(topPane); args = 0; XtSetArg(argList[args], XtNtop, XtChainTop); args++; --- 67,74 ---- tableWidgetClass, topLevel, argList, args); #endif ! BuildFileLevel(); ! BuildErrorBox(); args = 0; XtSetArg(argList[args], XtNtop, XtChainTop); args++; *************** *** 179,184 **** --- 179,186 ---- { extern void TeXMarkMenuSelect(); XtCallbackRec menuCallBacks [2]; + char ** foo[2]; + foo[0] = foo[1] = 0; menuCallBacks[0].callback = TeXMarkMenuSelect; menuCallBacks[0].closure = NULL; *************** *** 188,193 **** --- 190,196 ---- args = 0; XtSetArg(argList[args], XtNresize, True); args++; XtSetArg(argList[args], XtNcallback, (caddr_t) menuCallBacks); args++; + XtSetArg(argList[args], XtNlist, foo); args++; markMenuList = XtCreateManagedWidget("markMenuList", listWidgetClass, markMenuViewPort, argList, args); *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:46 1989 --- file.c Mon Oct 30 11:13:43 1989 *************** *** 147,153 **** strcpy(TeXInputFileNameString, "File: "); TeXInputFileName = &TeXInputFileNameString[strlen(TeXInputFileNameString)]; ! strcpy(TeXInputFileName, DviFileName, MAXPATHLEN); if ( fileLabel != NULL) { Arg argList[20]; --- 147,153 ---- strcpy(TeXInputFileNameString, "File: "); TeXInputFileName = &TeXInputFileNameString[strlen(TeXInputFileNameString)]; ! strncpy(TeXInputFileName, DviFileName, MAXPATHLEN); if ( fileLabel != NULL) { Arg argList[20]; *************** *** 236,242 **** if ( *num_params < 1 ) { lastOpenKind = 1; /* default to copy */ } ! else if ( strncmp(params[0],"close") == 0 ) { DviFini(); TeXFontNewFile(); TeXMarkNewFile(); --- 236,242 ---- if ( *num_params < 1 ) { lastOpenKind = 1; /* default to copy */ } ! else if ( strncmp(params[0],"close", 5) == 0 ) { DviFini(); TeXFontNewFile(); TeXMarkNewFile(); *************** *** 247,262 **** else { int doCd = 0; ! if ( strncmp(params[0],"open") == 0 ) { lastOpenKind = 0; /* default to copy */ } ! else if ( strncmp(params[0],"copy") == 0 ) { lastOpenKind = 1; /* default to copy */ } ! else if ( strncmp(params[0],"cd") == 0 ) { doCd = 1; } ! else if ( strncmp(params[0],"reopen") == 0 ) { /* use old value */ } else { --- 247,262 ---- else { int doCd = 0; ! if ( strncmp(params[0],"open", 4) == 0 ) { lastOpenKind = 0; /* default to copy */ } ! else if ( strncmp(params[0],"copy", 4) == 0 ) { lastOpenKind = 1; /* default to copy */ } ! else if ( strncmp(params[0],"cd", 2) == 0 ) { doCd = 1; } ! else if ( strncmp(params[0],"reopen", 6) == 0 ) { /* use old value */ } else { *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:46 1989 --- dialog.c Mon Oct 30 11:11:51 1989 *************** *** 35,46 **** #define ERROR_BUFFER_SIZE 2048 static char errorMessageBuffer[ ERROR_BUFFER_SIZE ]; - static int errorMessageBufferLength=0; - - static void dumpBuffer(m,b) - { - fprintf(stderr,"%s\n+%s+\n", m,b); - } void DialogMessage(str, addNewLine) --- 35,40 ---- *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:48 1989 --- mark.c Mon Oct 30 11:06:57 1989 *************** *** 78,84 **** --- 78,88 ---- #endif if ( item != 0 ) { + #ifndef X11R4 + int page = item -> index; + #else int page = item -> list_index; + #endif TeXMark( markToggle, page); } } *************** *** 105,115 **** TheMarkMenu.stringLast = TheMarkMenu.stringSize; TheMarkMenu.listStorage = XtMalloc( TheMarkMenu.stringSize ); ! mallocSize = ( sizeof(String) * DviTotalPages + 2 ); TheMarkMenu.listItems = (String *) XtMalloc( mallocSize ); bzero(TheMarkMenu.listItems, mallocSize); ! mallocSize = ( sizeof(int) * DviTotalPages + 2 ); TheMarkMenu.listOffset = (int *) XtMalloc( mallocSize ); bzero(TheMarkMenu.listItems, mallocSize); --- 109,119 ---- TheMarkMenu.stringLast = TheMarkMenu.stringSize; TheMarkMenu.listStorage = XtMalloc( TheMarkMenu.stringSize ); ! mallocSize = ( sizeof(String) * (DviTotalPages + 2) ); TheMarkMenu.listItems = (String *) XtMalloc( mallocSize ); bzero(TheMarkMenu.listItems, mallocSize); ! mallocSize = ( sizeof(int) * (DviTotalPages + 2) ); TheMarkMenu.listOffset = (int *) XtMalloc( mallocSize ); bzero(TheMarkMenu.listItems, mallocSize); *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:48 1989 --- DviPage.c Mon Oct 30 11:12:11 1989 *************** *** 105,112 **** extern double atof(); #endif - static void DviPageAction(/* Widget, XEvent*, String*, Cardinal* */); - DviPageClassRec dviPageClassRec = { { /* core fields */ /* superclass */ --- 105,110 ---- *************** *** 171,180 **** * ****************************************************************/ - static void DviPageAction(/* Widget, XEvent*, String*, Cardinal* */) - { - } - static void SetPageSize(w, wd, ht) DviPageWidget w; --- 169,174 ---- *************** *** 460,467 **** typedef struct { int spDrift; ! double spDriftTmp; ! double spPerDot; DviPagePart *page; DviFontInfo *dviCurrentFont; int dviCurrentFontIndex; --- 454,460 ---- typedef struct { int spDrift; ! long spPerDot; DviPagePart *page; DviFontInfo *dviCurrentFont; int dviCurrentFontIndex; *************** *** 537,542 **** --- 530,536 ---- int advance; int wuz; DviDisplayInfo info; + double spDriftTmp; struct PostAmbleInfo *pai; char *thisPage; *************** *** 558,566 **** /* compute info.spDrift -- the max. *points* we'll drift from the true location */ ! info.spDriftTmp = atof( widget -> dviPage.maxDriftString ); ! info.spDriftTmp /= POINTS_PER_INCH; /* now in inches */ ! info.spDrift = INCH_TO_SP( info.spDriftTmp ); /* compute spPerDot -- the number of Sp per actual *dot* on the display */ --- 552,560 ---- /* compute info.spDrift -- the max. *points* we'll drift from the true location */ ! spDriftTmp = atof( widget -> dviPage.maxDriftString ); ! spDriftTmp /= POINTS_PER_INCH; /* now in inches */ ! info.spDrift = INCH_TO_SP( spDriftTmp ); /* compute spPerDot -- the number of Sp per actual *dot* on the display */ *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:53 1989 --- Imakefile Mon Oct 30 13:51:03 1989 *************** *** 47,53 **** /* You shouldn't have to change anything below this line */ /***************************************************************************/ ! VERSION =2.10# SRCS = texx2.c widgets.c \ file.c dialog.c dvi-simple.c \ --- 47,54 ---- /* You shouldn't have to change anything below this line */ /***************************************************************************/ ! VERSION =2.11# ! RCS_VERSION=2p11# SRCS = texx2.c widgets.c \ file.c dialog.c dvi-simple.c \ *************** *** 71,77 **** mftobdf.man ! INCLUDES = $(TABLE_INCLUDES) -I$(INCROOT) SYS_LIBRARIES = $(TABLE_LIBS) -L$(USRLIBDIR) -lXaw -lXt -lXmu -lX11 DEFINES = -DDEFAULT_TFM_PATH=\"$(TEXFONTS)\" $(TABLE_DEFINES) $(CLEAR_DEFINES) $(XVERSION_DEFINES) --- 72,78 ---- mftobdf.man ! INCLUDES = $(TABLE_INCLUDES) -I../h -I$(INCROOT) SYS_LIBRARIES = $(TABLE_LIBS) -L$(USRLIBDIR) -lXaw -lXt -lXmu -lX11 DEFINES = -DDEFAULT_TFM_PATH=\"$(TEXFONTS)\" $(TABLE_DEFINES) $(CLEAR_DEFINES) $(XVERSION_DEFINES) *************** *** 78,84 **** goal: texx2 @echo Done ! SingleProgramTarget(texx2,$(OBJS),,-lm) InstallProgram(texx2, $(BINDIR)) InstallManPage(texx2, $(MANDIR)) InstallAppDefaults(Texx2) --- 79,85 ---- goal: texx2 @echo Done ! SingleProgramTarget(texx2,$(OBJS),../lib/lib.a,-lm) InstallProgram(texx2, $(BINDIR)) InstallManPage(texx2, $(MANDIR)) InstallAppDefaults(Texx2) *************** *** 89,98 **** InstallProgram(buildfonts, $(BINDIR)) tar: ! (tar crhf Texx2-$(VERSION).tar $(FILES)) ci: ! ci -l -f -m"Texx2 $(VERSION)" -ntexx2-$(VESION) $(FILES) DependTarget() CleanTarget() --- 90,110 ---- InstallProgram(buildfonts, $(BINDIR)) tar: ! tar crhf Texx2-$(VERSION).tar $(FILES) + diffs: + @echo "Diffs w.r.t. version $(VERSION)" + rcsdiff -c -q -rtexx2- $(FILES) + # rcsdiff -c -rtexx$(RCSVERSION) $(FILES) + + lint: + lint $(CFLAGS) $(SRCS) + + lint-mftobdf: + lint (CFLAGS) $(SRCS2) + ci: ! ci -l -f -m"Texx2 $(VERSION)" -ntexx$(RCSVESION) $(FILES) DependTarget() CleanTarget() *** /tmp/,RCSt1a01129 Tue Oct 31 09:44:54 1989 --- ChangeLog Mon Oct 30 11:06:56 1989 *************** *** 1,3 **** --- 1,14 ---- + Mon Oct 30 11:25:31 1989 Dana A. Chee (dana at dino) + + * (mark.c) add parens around summation so that amount of space + malloced is correct. + + * (file.c) add amounts to strncpys + + Fri Oct 27 20:38:53 1989 Dirk Grunwald (grunwald at foobar) + + * Change DviPage::spPerDot to long from double. + Thu Oct 26 11:24:41 1989 Dirk Grunwald (grunwald at foobar) * Released as 2.10