summaryrefslogtreecommitdiff
path: root/Build/source/texk/dviljk
diff options
context:
space:
mode:
authorPeter Breitenlohner <peb@mppmu.mpg.de>2012-09-18 17:31:41 +0000
committerPeter Breitenlohner <peb@mppmu.mpg.de>2012-09-18 17:31:41 +0000
commit2ad6229bbca0c6599e33345b6359e4a5c6160bd4 (patch)
tree976081b6586843c14e9437aacd1c3bfa1249b121 /Build/source/texk/dviljk
parent90bcdca89c3f6c3cda6f78374bd2881d6221136f (diff)
dviljk: Adapt to W32TeX + some cleanup
git-svn-id: svn://tug.org/texlive/trunk@27700 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dviljk')
-rw-r--r--Build/source/texk/dviljk/ChangeLog9
-rw-r--r--Build/source/texk/dviljk/dvi2xx.c18
-rw-r--r--Build/source/texk/dviljk/dvi2xx.h2
3 files changed, 19 insertions, 10 deletions
diff --git a/Build/source/texk/dviljk/ChangeLog b/Build/source/texk/dviljk/ChangeLog
index cf9b9d8ccce..feaa1f8cbdd 100644
--- a/Build/source/texk/dviljk/ChangeLog
+++ b/Build/source/texk/dviljk/ChangeLog
@@ -1,3 +1,12 @@
+2012-09-07 Peter Breitenlohner <peb@mppmu.mpg.de>
+
+ * dvi2xx.c: The macro max(x,y) is not the usual function, so
+ rename it -> set_max(x,y) to avoid confusion.
+ * dvi2xx.h: Drop useless definition of max(x,y).
+
+ * dvi2xx.c: With KPATHSEA set G_progname to kpse_program_name
+ instead of argv[0] (from W32TeX).
+
2012-08-02 Peter Breitenlohner <peb@mppmu.mpg.de>
* dvi2xx.[ch]: Rename CopyFile -> my_CopyFile, ResetPrinter ->
diff --git a/Build/source/texk/dviljk/dvi2xx.c b/Build/source/texk/dviljk/dvi2xx.c
index 03c473fa8de..91206b7dbe5 100644
--- a/Build/source/texk/dviljk/dvi2xx.c
+++ b/Build/source/texk/dviljk/dvi2xx.c
@@ -167,10 +167,12 @@ main(int argc, char *argv[])
y_origin = YDEFAULTOFF; /* y-origin in dots */
setbuf(ERR_STREAM, NULL);
- G_progname = argv[0];
#ifdef KPATHSEA
kpse_set_program_name(argv[0], "dvilj");
kpse_set_program_enabled (kpse_pk_format, MAKE_TEX_PK_BY_DEFAULT, kpse_src_compile);
+ G_progname = kpse_program_name;
+#else
+ G_progname = argv[0];
#endif
DecodeArgs(argc, argv);
@@ -3622,7 +3624,7 @@ ParseNumbers(char *str, int *result, int number, char **end)
/* Diagram commands are parsed separately since the format varies from the one
-+ used by the other special commands */
+ used by the other special commands. */
bool ParseDiagram(char *str)
{
diagtrafo dt;
@@ -3710,6 +3712,7 @@ static char * mkdtemp ( char * template )
return NULL;
}
#ifdef WIN32
+#undef mkdir
#define mkdir(path, mode) mkdir(path)
#endif
if ( mkdir(template, 0700) == -1 ) {
@@ -5044,11 +5047,10 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %ld\n",
else
tcharptr->charsize = SMALL_SIZE;
#ifdef LJ
-#undef max
-# define max(x,y) if ((y)>(x)) x = y
+# define set_max(x,y) if ((y)>(x)) x = y
- max(tfontptr->max_width,tcharptr->width);
- max(tfontptr->max_height,tcharptr->height);
+ set_max(tfontptr->max_width,tcharptr->width);
+ set_max(tfontptr->max_height,tcharptr->height);
if (tcharptr->yOffset > 0 && (int)tfontptr->max_yoff < (int)tcharptr->yOffset)
tfontptr->max_yoff = tcharptr->yOffset;
if ((depth = tcharptr->height - tcharptr->yOffset)>max_depth)
@@ -5190,8 +5192,8 @@ printf("[%ld]=%lf * %lf * %lf + 0.5 = %ld\n",
tcharptr->height,tfontptr->max_height,
tcharptr->yOffset,tfontptr->max_yoff);
*/
- max(tfontptr->max_width, tcharptr->width);
- max(tfontptr->max_height,tcharptr->height);
+ set_max(tfontptr->max_width, tcharptr->width);
+ set_max(tfontptr->max_height,tcharptr->height);
if (tcharptr->yOffset > 0 && (int)tfontptr->max_yoff < (int)tcharptr->yOffset)
tfontptr->max_yoff = tcharptr->yOffset;
diff --git a/Build/source/texk/dviljk/dvi2xx.h b/Build/source/texk/dviljk/dvi2xx.h
index 3e1c45228f0..f19606a6cc0 100644
--- a/Build/source/texk/dviljk/dvi2xx.h
+++ b/Build/source/texk/dviljk/dvi2xx.h
@@ -267,8 +267,6 @@ const char *MFMODE = MFMODE600;
# define XDEFAULTOFF RESOLUTION /*x default offset on page 1in (LJ2)*/
# define YDEFAULTOFF RESOLUTION /* y default offset on page 1inch */
#endif
-# undef max
-# define max(x,y) if ((y)>(x)) x = y
# ifndef vms
# define INT_ASCII(b,i) \
if (i == 0) b[0] = '\0'; else sprintf((char *)b,"%hd",i)