summaryrefslogtreecommitdiff
path: root/gs/psi
diff options
context:
space:
mode:
authorChris Liddell <chris.liddell@artifex.com>2015-06-04 16:30:03 +0100
committerChris Liddell <chris.liddell@artifex.com>2015-06-07 16:10:56 +0100
commit640801c0fd5527c7f183549df4fd2da365e427d4 (patch)
tree08dfe0fb941b73a686a347edb11ba0afb3a260b1 /gs/psi
parenta6d05fcee5521bc410068b16925c36476f207eab (diff)
downloadghostpdl-640801c0fd5527c7f183549df4fd2da365e427d4.tar.gz
Consolidate almost all error codes into the graphics library
Do away with the separate/duplicate error code definitions in the Postscript interpreter and in the graphics library. Also, where possible, do the same for PCL. The exception is the PXL code which has errors codes entirely of its own - as unpleasant as that is, it would require rather more invasive changes to have PXL use the common error codes. Possibly something to consider for a future commit. No cluster differences.
Diffstat (limited to 'gs/psi')
-rw-r--r--gs/psi/apitest.c4
-rw-r--r--gs/psi/dmmain.c6
-rw-r--r--gs/psi/dpmain.c36
-rw-r--r--gs/psi/dwmain.c12
-rw-r--r--gs/psi/dwmainc.c10
-rw-r--r--gs/psi/dxmain.c14
-rw-r--r--gs/psi/dxmainc.c10
-rw-r--r--gs/psi/estack.h2
-rw-r--r--gs/psi/gs.c8
-rw-r--r--gs/psi/gsdll.c4
-rw-r--r--gs/psi/gserver.c4
-rw-r--r--gs/psi/ialloc.c8
-rw-r--r--gs/psi/iapi.c48
-rw-r--r--gs/psi/iapi.h6
-rw-r--r--gs/psi/ibnum.c16
-rw-r--r--gs/psi/icontext.c8
-rw-r--r--gs/psi/idict.c36
-rw-r--r--gs/psi/idict.h30
-rw-r--r--gs/psi/idparam.c66
-rw-r--r--gs/psi/ierrors.h94
-rw-r--r--gs/psi/igstate.h2
-rw-r--r--gs/psi/iinit.c14
-rw-r--r--gs/psi/imain.c32
-rw-r--r--gs/psi/imain.h14
-rw-r--r--gs/psi/imainarg.c84
-rw-r--r--gs/psi/iname.c10
-rw-r--r--gs/psi/inobtokn.c2
-rw-r--r--gs/psi/int.mak2
-rw-r--r--gs/psi/interp.c126
-rw-r--r--gs/psi/iparam.c54
-rw-r--r--gs/psi/iparam.h2
-rw-r--r--gs/psi/iplugin.c2
-rw-r--r--gs/psi/ireclaim.c2
-rw-r--r--gs/psi/isave.c4
-rw-r--r--gs/psi/iscan.c64
-rw-r--r--gs/psi/iscanbin.c58
-rw-r--r--gs/psi/iscanbin.h2
-rw-r--r--gs/psi/iscannum.c30
-rw-r--r--gs/psi/istack.c20
-rw-r--r--gs/psi/istack.h10
-rw-r--r--gs/psi/iutil.c70
-rw-r--r--gs/psi/iutil.h18
-rw-r--r--gs/psi/iutil2.c16
-rw-r--r--gs/psi/ivmspace.h2
-rw-r--r--gs/psi/opcheck.h16
-rw-r--r--gs/psi/oper.h8
-rw-r--r--gs/psi/ostack.h6
-rw-r--r--gs/psi/zalg.c8
-rw-r--r--gs/psi/zarith.c10
-rw-r--r--gs/psi/zarray.c8
-rw-r--r--gs/psi/zbfont.c30
-rw-r--r--gs/psi/zbseq.c8
-rw-r--r--gs/psi/zcfont.c2
-rw-r--r--gs/psi/zchar.c36
-rw-r--r--gs/psi/zchar1.c38
-rw-r--r--gs/psi/zchar32.c18
-rw-r--r--gs/psi/zchar42.c4
-rw-r--r--gs/psi/zcharout.c8
-rw-r--r--gs/psi/zcharx.c4
-rw-r--r--gs/psi/zcid.c12
-rw-r--r--gs/psi/zcidtest.c6
-rw-r--r--gs/psi/zcie.c24
-rw-r--r--gs/psi/zcolor.c504
-rw-r--r--gs/psi/zcontext.c38
-rw-r--r--gs/psi/zcontrol.c20
-rw-r--r--gs/psi/zcrd.c14
-rw-r--r--gs/psi/zdevice.c34
-rw-r--r--gs/psi/zdevice2.c6
-rw-r--r--gs/psi/zdict.c42
-rw-r--r--gs/psi/zdouble.c32
-rw-r--r--gs/psi/zdpnext.c2
-rw-r--r--gs/psi/zdps.c10
-rw-r--r--gs/psi/zdps1.c12
-rw-r--r--gs/psi/zdscpars.c4
-rw-r--r--gs/psi/zfaes.c4
-rw-r--r--gs/psi/zfapi.c56
-rw-r--r--gs/psi/zfarc4.c8
-rw-r--r--gs/psi/zfcid.c4
-rw-r--r--gs/psi/zfcid0.c46
-rw-r--r--gs/psi/zfcid1.c38
-rw-r--r--gs/psi/zfcmap.c52
-rw-r--r--gs/psi/zfdctd.c2
-rw-r--r--gs/psi/zfdcte.c4
-rw-r--r--gs/psi/zfdecode.c6
-rw-r--r--gs/psi/zfile.c72
-rw-r--r--gs/psi/zfile1.c4
-rw-r--r--gs/psi/zfileio.c48
-rw-r--r--gs/psi/zfilter.c10
-rw-r--r--gs/psi/zfilter2.c2
-rw-r--r--gs/psi/zfilterx.c10
-rw-r--r--gs/psi/zfimscale.c4
-rw-r--r--gs/psi/zfjbig2.c4
-rw-r--r--gs/psi/zfont.c14
-rw-r--r--gs/psi/zfont0.c16
-rw-r--r--gs/psi/zfont1.c10
-rw-r--r--gs/psi/zfont2.c100
-rw-r--r--gs/psi/zfont42.c10
-rw-r--r--gs/psi/zfontenum.c6
-rw-r--r--gs/psi/zform.c8
-rw-r--r--gs/psi/zfproc.c8
-rw-r--r--gs/psi/zfrsd.c34
-rw-r--r--gs/psi/zfsample.c30
-rw-r--r--gs/psi/zfunc.c38
-rw-r--r--gs/psi/zfunc0.c12
-rw-r--r--gs/psi/zfunc3.c12
-rw-r--r--gs/psi/zfunc4.c34
-rw-r--r--gs/psi/zgeneric.c34
-rw-r--r--gs/psi/zgstate.c4
-rw-r--r--gs/psi/zht.c2
-rw-r--r--gs/psi/zht1.c2
-rw-r--r--gs/psi/zht2.c26
-rw-r--r--gs/psi/zicc.c16
-rw-r--r--gs/psi/zimage.c32
-rw-r--r--gs/psi/zimage3.c8
-rw-r--r--gs/psi/ziodev.c28
-rw-r--r--gs/psi/ziodev2.c8
-rw-r--r--gs/psi/ziodevs.c12
-rw-r--r--gs/psi/ziodevsc.c12
-rw-r--r--gs/psi/zmath.c8
-rw-r--r--gs/psi/zmatrix.c2
-rw-r--r--gs/psi/zmedia2.c4
-rw-r--r--gs/psi/zmisc.c12
-rw-r--r--gs/psi/zmisc1.c6
-rw-r--r--gs/psi/zmisc2.c12
-rw-r--r--gs/psi/zpacked.c4
-rw-r--r--gs/psi/zpaint.c2
-rw-r--r--gs/psi/zpath1.c2
-rw-r--r--gs/psi/zpcolor.c20
-rw-r--r--gs/psi/zpdf_r6.c14
-rw-r--r--gs/psi/zpdfops.c8
-rw-r--r--gs/psi/zshade.c38
-rw-r--r--gs/psi/zstack.c20
-rw-r--r--gs/psi/zstring.c8
-rw-r--r--gs/psi/ztoken.c8
-rw-r--r--gs/psi/ztrans.c12
-rw-r--r--gs/psi/ztrap.c2
-rw-r--r--gs/psi/ztype.c38
-rw-r--r--gs/psi/zupath.c44
-rw-r--r--gs/psi/zusparam.c8
-rw-r--r--gs/psi/zutf8.c4
-rw-r--r--gs/psi/zvmem.c14
-rw-r--r--gs/psi/zvmem2.c8
-rw-r--r--gs/psi/zwinutf8.c6
143 files changed, 1567 insertions, 1653 deletions
diff --git a/gs/psi/apitest.c b/gs/psi/apitest.c
index c63147ac4..192d73f19 100644
--- a/gs/psi/apitest.c
+++ b/gs/psi/apitest.c
@@ -90,12 +90,12 @@ static void *gs_main(void *arg)
code = gsapi_init_with_args(minst, gsargc, gsargv);
code1 = gsapi_exit(minst);
- if ((code == 0) || (code == e_Quit))
+ if ((code == 0) || (code == gs_error_Quit))
code = code1;
gsapi_delete_instance(minst);
- if ((code == 0) || (code == e_Quit))
+ if ((code == 0) || (code == gs_error_Quit))
return (void *)0;
return (void *)1;
diff --git a/gs/psi/dmmain.c b/gs/psi/dmmain.c
index 3edad6bce..23c1da669 100644
--- a/gs/psi/dmmain.c
+++ b/gs/psi/dmmain.c
@@ -142,7 +142,7 @@ static int GSDLLCALL gsdll_poll(void *handle)
while (WaitNextEvent(everyEvent, &eventStructure, 0, NULL))
doEvents(&eventStructure);
- return (gDone ? e_Fatal : 0);
+ return (gDone ? gs_error_Fatal : 0);
}
/*********************************************************************/
@@ -222,7 +222,7 @@ static int display_presize(void *handle, void *device, int width, int height,
{
printf("DisplayFormat has been set to an incompatible value.\n");
fflush(stdout);
- return e_rangecheck;
+ return gs_error_rangecheck;
}
return 0;
@@ -248,7 +248,7 @@ static int display_size(void *handle, void *device, int width, int height,
DisposePixMap(img->pixmapHdl);
img->pixmapHdl = NULL;
}
- return e_rangecheck;
+ return gs_error_rangecheck;
}
/* Create the PixMap */
diff --git a/gs/psi/dpmain.c b/gs/psi/dpmain.c
index 2ed49594d..6b683f6e8 100644
--- a/gs/psi/dpmain.c
+++ b/gs/psi/dpmain.c
@@ -379,19 +379,19 @@ static int run_gspmdrv(IMAGE *img)
gs_sprintf(term_queue_name, "\\QUEUES\\TERMQ_%s", id);
if (DosCreateQueue(&(img->term_queue), QUE_FIFO, term_queue_name)) {
fprintf(stdout, "run_gspmdrv: failed to create termination queue\n");
- return e_limitcheck;
+ return gs_error_limitcheck;
}
/* get full path to gsos2.exe and hence path to gspmdrv.exe */
if ((rc = DosGetInfoBlocks(&pptib, &pppib)) != 0) {
fprintf(stdout, "run_gspmdrv: Couldn't get module handle, rc = %d\n",
rc);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
if ((rc = DosQueryModuleName(pppib->pib_hmte, sizeof(progname) - 1,
progname)) != 0) {
fprintf(stdout, "run_gspmdrv: Couldn't get module name, rc = %d\n",
rc);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
if ((tail = strrchr(progname, '\\')) != (PCHAR) NULL) {
tail++;
@@ -439,7 +439,7 @@ static int run_gspmdrv(IMAGE *img)
fprintf(stdout, "run_gspmdrv: failed to run %s, rc = %d\n",
sdata.PgmName, rc);
fprintf(stdout, "run_gspmdrv: error_message: %s\n", error_message);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
#ifdef DEBUG
if (debug)
@@ -570,12 +570,12 @@ int display_open(void *handle, void *device)
* a new PM application which can display multiple windows
* within a single session.
*/
- return e_limitcheck;
+ return gs_error_limitcheck;
}
img = (IMAGE *)malloc(sizeof(IMAGE));
if (img == NULL)
- return e_limitcheck;
+ return gs_error_limitcheck;
memset(img, 0, sizeof(IMAGE));
/* add to list */
@@ -589,7 +589,7 @@ int display_open(void *handle, void *device)
/* Derive ID from process ID */
if (DosGetInfoBlocks(&pptib, &pppib)) {
fprintf(stdout, "\ndisplay_open: Couldn't get pid\n");
- return e_limitcheck;
+ return gs_error_limitcheck;
}
img->pid = pppib->pib_ulppid; /* use parent (CMD.EXE) pid */
gs_sprintf(id, ID_NAME, img->pid, (ULONG) img->device);
@@ -598,7 +598,7 @@ int display_open(void *handle, void *device)
gs_sprintf(name, SYNC_NAME, id);
if (DosCreateEventSem(name, &(img->sync_event), 0, FALSE)) {
fprintf(stdout, "display_open: failed to create event semaphore %s\n", name);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
/* Create mutex - used for preventing gspmdrv from accessing */
/* bitmap while we are changing the bitmap size. Initially unowned. */
@@ -606,7 +606,7 @@ int display_open(void *handle, void *device)
if (DosCreateMutexSem(name, &(img->bmp_mutex), 0, FALSE)) {
DosCloseEventSem(img->sync_event);
fprintf(stdout, "display_open: failed to create mutex semaphore %s\n", name);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
/* Shared memory is common to all processes so we don't want to
@@ -616,7 +616,7 @@ int display_open(void *handle, void *device)
if (DosAllocSharedMem((PPVOID) & img->bitmap, name,
13 * 1024 * 1024, PAG_READ | PAG_WRITE)) {
fprintf(stdout, "display_open: failed allocating shared BMP memory %s\n", name);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
/* commit one page so there is enough storage for a */
@@ -624,7 +624,7 @@ int display_open(void *handle, void *device)
if (DosSetMem(img->bitmap, MIN_COMMIT, PAG_COMMIT | PAG_DEFAULT)) {
DosFreeMem(img->bitmap);
fprintf(stdout, "display: failed committing BMP memory\n");
- return e_limitcheck;
+ return gs_error_limitcheck;
}
img->committed = MIN_COMMIT;
@@ -742,7 +742,7 @@ int display_presize(void *handle, void *device, int width, int height,
img->format_known = TRUE;
if (!img->format_known) {
fprintf(stdout, "display_presize: format %d = 0x%x is unsupported\n", format, format);
- return e_limitcheck;
+ return gs_error_limitcheck;
}
/* grab mutex to stop other thread using bitmap */
DosRequestMutexSem(img->bmp_mutex, 120000);
@@ -775,7 +775,7 @@ int display_size(void *handle, void *device, int width, int height,
img = image_find(handle, device);
if (img) {
if (!img->format_known)
- return e_limitcheck;
+ return gs_error_limitcheck;
img->width = width;
img->height = height;
@@ -860,7 +860,7 @@ int display_sync(void *handle, void *device)
img = image_find(handle, device);
if (img) {
if (!img->format_known)
- return e_limitcheck;
+ return gs_error_limitcheck;
/* delay starting gspmdrv until display_size has been called */
if (!img->session_id && (img->width != 0) && (img->height != 0))
run_gspmdrv(img);
@@ -1042,7 +1042,7 @@ main(int argc, char *argv[])
if (code == 0)
code = gsdll.run_string(instance, start_string, 0, &exit_code);
code1 = gsdll.exit(instance);
- if (code == 0 || (code == e_Quit && code1 != 0))
+ if (code == 0 || (code == gs_error_Quit && code1 != 0))
code = code1;
gsdll.delete_instance(instance);
@@ -1055,10 +1055,10 @@ main(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Info:
- case e_Quit:
+ case gs_error_Info:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
default:
diff --git a/gs/psi/dwmain.c b/gs/psi/dwmain.c
index 6cb022e76..7c8b1c790 100644
--- a/gs/psi/dwmain.c
+++ b/gs/psi/dwmain.c
@@ -66,7 +66,7 @@ static int poll(void)
}
/* If text window closing then abort Ghostscript */
if (tw->quitnow)
- return e_Fatal;
+ return gs_error_Fatal;
return 0;
}
@@ -335,11 +335,11 @@ int new_main(int argc, char *argv[])
if (code == 0)
code = gsdll.run_string(instance, start_string, 0, &exit_code);
code1 = gsdll.exit(instance);
- if (code == 0 || (code == e_Quit && code1 != 0))
+ if (code == 0 || (code == gs_error_Quit && code1 != 0))
code = code1;
#if defined(_MSC_VER) || defined(__BORLANDC__)
} __except(exception_code() == EXCEPTION_STACK_OVERFLOW) {
- code = e_Fatal;
+ code = gs_error_Fatal;
text_puts(tw, "*** C stack overflow. Quiting...\n");
}
#endif
@@ -357,12 +357,12 @@ int new_main(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Quit:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
- case e_Info:
+ case gs_error_Info:
default:
exit_status = 255;
}
diff --git a/gs/psi/dwmainc.c b/gs/psi/dwmainc.c
index 017e37301..f71d8643a 100644
--- a/gs/psi/dwmainc.c
+++ b/gs/psi/dwmainc.c
@@ -633,11 +633,11 @@ static int main_utf8(int argc, char *argv[])
if (code == 0)
code = gsdll.run_string(instance, start_string, 0, &exit_code);
code1 = gsdll.exit(instance);
- if (code == 0 || (code == e_Quit && code1 != 0))
+ if (code == 0 || (code == gs_error_Quit && code1 != 0))
code = code1;
#if defined(_MSC_VER) || defined(__BORLANDC__)
} __except(exception_code() == EXCEPTION_STACK_OVERFLOW) {
- code = e_Fatal;
+ code = gs_error_Fatal;
fprintf(stderr, "*** C stack overflow. Quiting...\n");
}
#endif
@@ -666,10 +666,10 @@ static int main_utf8(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Info:
- case e_Quit:
+ case gs_error_Info:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
default:
diff --git a/gs/psi/dxmain.c b/gs/psi/dxmain.c
index c79890393..6cb03a98c 100644
--- a/gs/psi/dxmain.c
+++ b/gs/psi/dxmain.c
@@ -507,7 +507,7 @@ static int display_presize(void *handle, void *device, int width, int height,
int raster, unsigned int format)
{
/* Assume everything is OK.
- * It would be better to return e_rangecheck if we can't
+ * It would be better to return gs_error_rangecheck if we can't
* support the format.
*/
return 0;
@@ -563,7 +563,7 @@ static int display_size(void *handle, void *device, int width, int height,
return -1;
}
else
- return e_rangecheck; /* not supported */
+ return gs_error_rangecheck; /* not supported */
case DISPLAY_COLORS_GRAY:
if (depth == DISPLAY_DEPTH_8) {
img->rgbbuf = (guchar *)malloc(width * height * 3);
@@ -1219,9 +1219,9 @@ int main(int argc, char *argv[])
if (code == 0)
code = gsapi_run_string(instance, start_string, 0, &exit_code);
code1 = gsapi_exit(instance);
- if (code == 0 || code == e_Quit)
+ if (code == 0 || code == gs_error_Quit)
code = code1;
- if (code == e_Quit)
+ if (code == gs_error_Quit)
code = 0; /* user executed 'quit' */
gsapi_delete_instance(instance);
@@ -1230,10 +1230,10 @@ int main(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Info:
- case e_Quit:
+ case gs_error_Info:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
default:
diff --git a/gs/psi/dxmainc.c b/gs/psi/dxmainc.c
index f6a5cb884..8e0da40b2 100644
--- a/gs/psi/dxmainc.c
+++ b/gs/psi/dxmainc.c
@@ -88,9 +88,9 @@ int main(int argc, char *argv[])
if (code == 0)
code = gsapi_run_string(instance, start_string, 0, &exit_code);
code1 = gsapi_exit(instance);
- if (code == 0 || code == e_Quit)
+ if (code == 0 || code == gs_error_Quit)
code = code1;
- if (code == e_Quit)
+ if (code == gs_error_Quit)
code = 0; /* user executed 'quit' */
gsapi_delete_instance(instance);
@@ -99,10 +99,10 @@ int main(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Info:
- case e_Quit:
+ case gs_error_Info:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
default:
diff --git a/gs/psi/estack.h b/gs/psi/estack.h
index 2683a078b..6dc106520 100644
--- a/gs/psi/estack.h
+++ b/gs/psi/estack.h
@@ -134,7 +134,7 @@
/* Macro to ensure enough entries on the execution stack */
#define check_esp(n)\
if ( esp < esbot + ((n) - 1) )\
- { e_stack.requested = (n); return_error(e_ExecStackUnderflow); }
+ { e_stack.requested = (n); return_error(gs_error_ExecStackUnderflow); }
/* Define the various kinds of execution stack marks. */
#define es_other 0 /* internal use */
diff --git a/gs/psi/gs.c b/gs/psi/gs.c
index dc5bb31ea..dde82cd12 100644
--- a/gs/psi/gs.c
+++ b/gs/psi/gs.c
@@ -91,7 +91,7 @@ main(int argc, char *argv[])
(void)setlocale(LC_CTYPE, "");
mem = gs_malloc_init();
minst = gs_main_alloc_instance(mem);
- code = (minst == NULL ? e_Fatal : 0);
+ code = (minst == NULL ? gs_error_Fatal : 0);
if (code >= 0)
code = gs_main_init_with_args(minst, argc, argv);
@@ -125,10 +125,10 @@ main(int argc, char *argv[])
exit_status = 0;
switch (code) {
case 0:
- case e_Info:
- case e_Quit:
+ case gs_error_Info:
+ case gs_error_Quit:
break;
- case e_Fatal:
+ case gs_error_Fatal:
exit_status = 1;
break;
default:
diff --git a/gs/psi/gsdll.c b/gs/psi/gsdll.c
index 9c1c477ce..0774172d8 100644
--- a/gs/psi/gsdll.c
+++ b/gs/psi/gsdll.c
@@ -95,7 +95,7 @@ gsdll_init_with_encoding(GSDLL_CALLBACK callback, HWND hwnd, int argc, char * ar
code = gsapi_set_arg_encoding(pgs_minst, encoding);
if (code >= 0)
code = gsapi_init_with_args(pgs_minst, argc, argv);
- if (code == e_Quit) {
+ if (code == gs_error_Quit) {
gsapi_exit(pgs_minst);
return GSDLL_INIT_QUIT;
}
@@ -138,7 +138,7 @@ gsdll_execute_cont(const char * str, int len)
int exit_code;
int code = gsapi_run_string_continue(pgs_minst, str, len,
0, &exit_code);
- if (code == e_NeedInput)
+ if (code == gs_error_NeedInput)
code = 0; /* this is not an error */
return code;
}
diff --git a/gs/psi/gserver.c b/gs/psi/gserver.c
index 5652c3217..2438aa516 100644
--- a/gs/psi/gserver.c
+++ b/gs/psi/gserver.c
@@ -62,8 +62,8 @@ int gs_server_initialize(int fno_stdin, int fno_stdout, int fno_stderr,
* do modify the baseline state for future calls of ...run_string and
* ...run_files. There are four cases of return values:
* value = 0: normal return.
- * value = e_Quit: the PostScript code executed a `quit'.
- * value = e_Fatal: the PostScript code encountered a fatal error.
+ * value = gs_error_Quit: the PostScript code executed a `quit'.
+ * value = gs_error_Fatal: the PostScript code encountered a fatal error.
* *exit_code_ptr holds the C exit code.
* other value: the PostScript code encountered a PostScript error
* while processing another error, or some other fatal
diff --git a/gs/psi/ialloc.c b/gs/psi/ialloc.c
index 7050c02e9..97087197a 100644
--- a/gs/psi/ialloc.c
+++ b/gs/psi/ialloc.c
@@ -83,7 +83,7 @@ ialloc_init(gs_dual_memory_t *dmem, gs_memory_t * rmem, uint chunk_size,
ialloc_free_state(ismem);
ialloc_free_state(ilmem_stable);
ialloc_free_state(ilmem);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
/* ================ Local/global VM ================ */
@@ -199,7 +199,7 @@ gs_alloc_ref_array(gs_ref_memory_t * mem, ref * parr, uint attrs,
obj = gs_alloc_struct_array((gs_memory_t *) mem, num_refs + 1,
ref, &st_refs, cname);
if (obj == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
/* Set the terminating ref now. */
end = (ref *) obj + num_refs;
make_mark(end);
@@ -243,7 +243,7 @@ gs_resize_ref_array(gs_ref_memory_t * mem, ref * parr,
ref *obj = parr->value.refs;
if (new_num_refs > old_num_refs || !r_has_type(parr, t_array))
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
diff = old_num_refs - new_num_refs;
/* Check for LIFO. See gs_free_ref_array for more details. */
if (mem->cc.rtop == mem->cc.cbot &&
@@ -374,7 +374,7 @@ gs_alloc_string_ref(gs_ref_memory_t * mem, ref * psref,
byte *str = gs_alloc_string((gs_memory_t *) mem, nbytes, cname);
if (str == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_string(psref, attrs | mem->space, nbytes, str);
return 0;
}
diff --git a/gs/psi/iapi.c b/gs/psi/iapi.c
index 2a90eb57f..1378c49ac 100644
--- a/gs/psi/iapi.c
+++ b/gs/psi/iapi.c
@@ -89,12 +89,12 @@ gsapi_new_instance(void **pinstance, void *caller_handle)
gs_main_instance *minst = NULL;
if (pinstance == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
#ifndef GS_THREADSAFE
/* limited to 1 instance, till it works :) */
if ( gsapi_instance_counter >= gsapi_instance_max )
- return e_Fatal;
+ return gs_error_Fatal;
++gsapi_instance_counter;
#endif
@@ -109,11 +109,11 @@ gsapi_new_instance(void **pinstance, void *caller_handle)
}
if (mem == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
minst = gs_main_alloc_instance(mem);
if (minst == NULL) {
gs_malloc_release(mem);
- return e_Fatal;
+ return gs_error_Fatal;
}
mem->gs_lib_ctx->top_of_system = (void*) minst;
mem->gs_lib_ctx->caller_handle = caller_handle;
@@ -169,7 +169,7 @@ gsapi_set_stdio(void *lib,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
ctx->stdin_fn = stdin_fn;
ctx->stdout_fn = stdout_fn;
ctx->stderr_fn = stderr_fn;
@@ -183,7 +183,7 @@ gsapi_set_poll(void *lib,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
ctx->poll_fn = poll_fn;
return 0;
}
@@ -194,7 +194,7 @@ gsapi_set_display_callback(void *lib, display_callback *callback)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
get_minst_from_memory(ctx->memory)->display = callback;
/* not in a language switched build */
return 0;
@@ -206,7 +206,7 @@ gsapi_set_default_device_list(void *lib, char *list, int listlen)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_lib_ctx_set_default_device_list(ctx->memory, list, listlen);
}
@@ -215,7 +215,7 @@ gsapi_get_default_device_list(void *lib, char **list, int *listlen)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_lib_ctx_get_default_device_list(ctx->memory, list, listlen);
}
@@ -309,7 +309,7 @@ gsapi_set_arg_encoding(void *lib, int encoding)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
#if defined(GS_NO_UTF8)
if (encoding == GS_ARG_ENCODING_LOCAL) {
@@ -340,7 +340,7 @@ gsapi_set_arg_encoding(void *lib, int encoding)
return 0;
}
#endif
- return e_Fatal;
+ return gs_error_Fatal;
}
GSDLLEXPORT int GSDLLAPI
@@ -348,7 +348,7 @@ gsapi_init_with_args(void *lib, int argc, char **argv)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_main_init_with_args(get_minst_from_memory(ctx->memory), argc, argv);
}
@@ -365,7 +365,7 @@ gsapi_run_string_begin(void *lib, int user_errors,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_main_run_string_begin(get_minst_from_memory(ctx->memory),
user_errors, pexit_code,
@@ -378,7 +378,7 @@ gsapi_run_string_continue(void *lib,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_main_run_string_continue(get_minst_from_memory(ctx->memory),
str, length, user_errors, pexit_code,
@@ -391,7 +391,7 @@ gsapi_run_string_end(void *lib,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_main_run_string_end(get_minst_from_memory(ctx->memory),
user_errors, pexit_code,
@@ -404,7 +404,7 @@ gsapi_run_string_with_length(void *lib,
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
return gs_main_run_string_with_length(get_minst_from_memory(ctx->memory),
str, length, user_errors, pexit_code,
@@ -432,7 +432,7 @@ gsapi_run_file(void *lib, const char *file_name,
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
gs_main_instance *minst;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
minst = get_minst_from_memory(ctx->memory);
#ifdef GS_NO_UTF8
@@ -470,13 +470,13 @@ gsapi_init_with_argsW(void *lib, int argc, wchar_t **argv)
{
#ifdef GS_NO_UTF8
/* Cannot call the W entrypoints in a GS_NO_UTF8 build */
- return e_Fatal;
+ return gs_error_Fatal;
#else
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
int code;
gs_arg_get_codepoint *old;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
old = gs_main_inst_get_arg_decode(get_minst_from_memory(ctx->memory));
code = gsapi_set_arg_encoding(lib, GS_ARG_ENCODING_UTF16LE);
@@ -495,7 +495,7 @@ gsapi_init_with_argsA(void *lib, int argc, char **argv)
int code;
gs_arg_get_codepoint *old;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
old = gs_main_inst_get_arg_decode(get_minst_from_memory(ctx->memory));
code = gsapi_set_arg_encoding(lib, GS_ARG_ENCODING_LOCAL);
@@ -512,13 +512,13 @@ gsapi_run_fileW(void *lib, const wchar_t *file_name,
{
#ifdef GS_NO_UTF8
/* Cannot call the W entrypoints in a GS_NO_UTF8 build */
- return e_Fatal;
+ return gs_error_Fatal;
#else
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
int code;
gs_arg_get_codepoint *old;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
old = gs_main_inst_get_arg_decode(get_minst_from_memory(ctx->memory));
code = gsapi_set_arg_encoding(lib, GS_ARG_ENCODING_UTF16LE);
@@ -538,7 +538,7 @@ gsapi_run_fileA(void *lib, const char *file_name,
int code;
gs_arg_get_codepoint *old;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
old = gs_main_inst_get_arg_decode(get_minst_from_memory(ctx->memory));
code = gsapi_set_arg_encoding(lib, GS_ARG_ENCODING_LOCAL);
@@ -556,7 +556,7 @@ gsapi_exit(void *lib)
{
gs_lib_ctx_t *ctx = (gs_lib_ctx_t *)lib;
if (lib == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
gs_to_exit(ctx->memory, 0);
return 0;
diff --git a/gs/psi/iapi.h b/gs/psi/iapi.h
index 1018110b5..ee6be52a2 100644
--- a/gs/psi/iapi.h
+++ b/gs/psi/iapi.h
@@ -233,10 +233,10 @@ enum {
/* Initialise the interpreter.
* This calls gs_main_init_with_args() in imainarg.c
* 1. If quit or EOF occur during gsapi_init_with_args(),
- * the return value will be e_Quit. This is not an error.
+ * the return value will be gs_error_Quit. This is not an error.
* You must call gsapi_exit() and must not call any other
* gsapi_XXX functions.
- * 2. If usage info should be displayed, the return value will be e_Info
+ * 2. If usage info should be displayed, the return value will be gs_error_Info
* which is not an error. Do not call gsapi_exit().
* 3. Under normal conditions this returns 0. You would then
* call one or more gsapi_run_*() functions and then finish
@@ -259,7 +259,7 @@ GSDLLEXPORT int GSDLLAPI gsapi_init_with_argsW(void *instance,
* If these functions return <= -100, either quit or a fatal
* error has occured. You then call gsapi_exit() next.
* The only exception is gsapi_run_string_continue()
- * which will return e_NeedInput if all is well.
+ * which will return gs_error_NeedInput if all is well.
*/
GSDLLEXPORT int GSDLLAPI
diff --git a/gs/psi/ibnum.c b/gs/psi/ibnum.c
index 2b28cf4e3..638a1a3a0 100644
--- a/gs/psi/ibnum.c
+++ b/gs/psi/ibnum.c
@@ -46,13 +46,13 @@ num_array_format(const ref * op)
const byte *bp = op->value.bytes;
if (r_size(op) < 4 || bp[0] != bt_num_array_value)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
format = bp[1];
if (!num_is_valid(format) ||
sdecodeshort(bp + 2, format) !=
(r_size(op) - 4) / encoded_number_bytes(format)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
break;
case t_array:
@@ -61,7 +61,7 @@ num_array_format(const ref * op)
format = num_array;
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
check_read(*op);
return format;
@@ -93,7 +93,7 @@ num_array_get(const gs_memory_t *mem, const ref * op, int format, uint index, re
case t_real:
return t_real;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
} else {
uint nbytes = encoded_number_bytes(format);
@@ -155,7 +155,7 @@ sdecode_number(const byte * str, int format, ref * np)
return t_real;
}
default:
- return_error(e_syntaxerror); /* invalid format?? */
+ return_error(gs_error_syntaxerror); /* invalid format?? */
}
}
@@ -203,7 +203,7 @@ sdecodebits32(const byte * p, int format, bits32 *v)
}
/* Decode a float. We assume that native floats occupy 32 bits. */
-/* If the float is an IEEE NaN or Inf, return e_undefinedresult. */
+/* If the float is an IEEE NaN or Inf, return gs_error_undefinedresult. */
int
sdecode_float(const byte * p, int format, float *pfnum)
{
@@ -234,7 +234,7 @@ sdecode_float(const byte * p, int format, float *pfnum)
if (expt == 0 && mant == 0)
fnum = 0;
else if (expt == 0xff)
- return_error(e_undefinedresult); /* Inf or NaN */
+ return_error(gs_error_undefinedresult); /* Inf or NaN */
else {
mant += 0x800000;
fnum = (float)ldexp((float)mant, expt - 127 - 23);
@@ -254,6 +254,6 @@ sdecode_float(const byte * p, int format, float *pfnum)
* IEEE (which is the case if control arrives here).
*/
if (!(~lnum & 0x7f800000)) /* i.e. exponent all 1's */
- return_error(e_undefinedresult); /* Inf or NaN */
+ return_error(gs_error_undefinedresult); /* Inf or NaN */
return 0;
}
diff --git a/gs/psi/icontext.c b/gs/psi/icontext.c
index 5c5f42756..0d440c069 100644
--- a/gs/psi/icontext.c
+++ b/gs/psi/icontext.c
@@ -106,7 +106,7 @@ public_st_context_state();
static int
no_reschedule(i_ctx_t **pi_ctx_p)
{
- return (e_invalidcontext);
+ return (gs_error_invalidcontext);
}
/* Allocate the state of a context. */
@@ -124,7 +124,7 @@ context_state_alloc(gs_context_state_t ** ppcst,
pcst = gs_alloc_struct((gs_memory_t *) mem, gs_context_state_t,
&st_context_state, "context_state_alloc");
if (pcst == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
code = gs_interp_alloc_stacks(mem, pcst);
if (code < 0)
@@ -138,7 +138,7 @@ context_state_alloc(gs_context_state_t ** ppcst,
pcst->dict_stack.userdict_index = 0;
pcst->pgs = int_gstate_alloc(dmem);
if (pcst->pgs == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto x1;
}
pcst->memory = *dmem;
@@ -292,7 +292,7 @@ context_state_store(gs_context_state_t * pcst)
i_ctx_t *i_ctx_p = pcst;
if (dict_find_string(systemdict, "userparams", &puserparams) < 0)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
pcst->userparams = *puserparams;
}
return 0;
diff --git a/gs/psi/idict.c b/gs/psi/idict.c
index bf50298c4..40ea01907 100644
--- a/gs/psi/idict.c
+++ b/gs/psi/idict.c
@@ -193,7 +193,7 @@ dict_create_contents(uint size, const ref * pdref, bool pack)
register uint i;
if (asize == 0 || asize > max_array_size - 1) /* too large */
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
asize++; /* allow room for wraparound entry */
code = gs_alloc_ref_array(mem, &pdict->values, a_all, asize,
"dict_create_contents(values)");
@@ -302,7 +302,7 @@ dict_find(const ref * pdref, const ref * pkey,
int code;
if (!r_has_attr(pkey, a_read))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
code = name_ref(mem, pkey->value.bytes, r_size(pkey), &nref, 1);
if (code < 0)
return code;
@@ -336,7 +336,7 @@ dict_find(const ref * pdref, const ref * pkey,
nidx = 0; /* only to pacify gcc */
break;
case t_null: /* not allowed as a key */
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
default:
hash = r_btype(pkey) * 99; /* yech */
kpack = packed_key_impossible;
@@ -360,12 +360,12 @@ dict_find(const ref * pdref, const ref * pkey,
* we must return dictfull if length = maxlength.
*/
if (pslot == 0 || d_length(pdict) == d_maxlength(pdict))
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
*ppvalue = pdict->values.value.refs + (pslot - kbot);
return 0;
miss: /* Key is missing, not double wrap. See above re dictfull. */
if (d_length(pdict) == d_maxlength(pdict))
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
if (pslot == 0)
pslot = kp;
*ppvalue = pdict->values.value.refs + (pslot - kbot);
@@ -388,7 +388,7 @@ dict_find(const ref * pdref, const ref * pkey,
if (kp == kbot) { /* wrap */
if (wrap++) { /* wrapped twice */
if (pslot == 0)
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
break;
}
kp += size + 1;
@@ -405,7 +405,7 @@ dict_find(const ref * pdref, const ref * pkey,
}
}
if (d_length(pdict) == d_maxlength(pdict))
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
*ppvalue = pdict->values.value.refs +
((pslot != 0 ? pslot : kp) - kbot);
return 0;
@@ -428,8 +428,8 @@ dict_find_string(const ref * pdref, const char *kstr, ref ** ppvalue)
(const byte *)kstr, strlen(kstr), &kname, -1)) < 0)
return code;
code = dict_find(pdref, &kname, ppvalue);
- if (code == e_dictfull)
- return_error(e_undefined);
+ if (code == gs_error_dictfull)
+ return_error(gs_error_undefined);
return code;
}
return 0;
@@ -458,14 +458,14 @@ dict_put(ref * pdref /* t_dictionary */ , const ref * pkey, const ref * pvalue,
switch (code) {
case 0:
break;
- case e_dictfull:
+ case gs_error_dictfull:
if (!pmem->gs_lib_ctx->dict_auto_expand)
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
code = dict_grow(pdref, pds);
if (code < 0)
return code;
goto top; /* keep things simple */
- default: /* e_typecheck */
+ default: /* gs_error_typecheck */
return code;
}
index = pvslot - pdict->values.value.refs;
@@ -474,7 +474,7 @@ dict_put(ref * pdref /* t_dictionary */ , const ref * pkey, const ref * pvalue,
int code;
if (!r_has_attr(pkey, a_read))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
code = name_from_string(pmem, pkey, &kname);
if (code < 0)
return code;
@@ -567,8 +567,8 @@ dict_undef(ref * pdref, const ref * pkey, dict_stack_t *pds)
switch (code) {
case 0:
- case e_dictfull:
- return_error(e_undefined);
+ case gs_error_dictfull:
+ return_error(gs_error_undefined);
case 1:
break;
default: /* other error */
@@ -753,7 +753,7 @@ dict_resize(ref * pdref, uint new_size, dict_stack_t *pds)
if (new_size < d_length(pdict)) {
if (!mem->gs_lib_ctx->dict_auto_expand)
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
new_size = d_length(pdict);
}
make_tav(&drto, t_dictionary, r_space(pdref) | a_all | new_mask,
@@ -887,7 +887,7 @@ dict_value_index(const ref * pdref, const ref * pvalue)
}
/* Return the entry at a given index within a dictionary. */
-/* If the index designates an unoccupied entry, return e_undefined. */
+/* If the index designates an unoccupied entry, return gs_error_undefined. */
int
dict_index_entry(const ref * pdref, int index, ref * eltp /* ref eltp[2] */ )
{
@@ -900,5 +900,5 @@ dict_index_entry(const ref * pdref, int index, ref * eltp /* ref eltp[2] */ )
eltp[1] = pdict->values.value.refs[index + 1];
return 0;
}
- return e_undefined;
+ return gs_error_undefined;
}
diff --git a/gs/psi/idict.h b/gs/psi/idict.h
index 828c36213..ff784bd24 100644
--- a/gs/psi/idict.h
+++ b/gs/psi/idict.h
@@ -48,8 +48,8 @@ extern const uint dict_max_size;
/*
* Define whether dictionaries expand automatically when full. Note that
* if dict_auto_expand is true, dict_put, dict_copy, dict_resize, and
- * dict_grow cannot return e_dictfull; however, they can return e_VMerror.
- * (dict_find can return e_dictfull even if dict_auto_expand is true.)
+ * dict_grow cannot return gs_error_dictfull; however, they can return gs_error_VMerror.
+ * (dict_find can return gs_error_dictfull even if dict_auto_expand is true.)
*/
extern bool dict_auto_expand;
@@ -83,11 +83,11 @@ int dict_alloc(gs_ref_memory_t *, uint maxlength, ref * pdref);
* The caller is responsible for checking that the dictionary is readable.
* Return 1 if found, 0 if not and there is room for a new entry,
* Failure returns:
- * e_typecheck if the key is null;
- * e_invalidaccess if the key is a string lacking read access;
- * e_VMerror or e_limitcheck if the key is a string and the corresponding
+ * gs_error_typecheck if the key is null;
+ * gs_error_invalidaccess if the key is a string lacking read access;
+ * gs_error_VMerror or gs_error_limitcheck if the key is a string and the corresponding
* error occurs from attempting to convert it to a name;
- * e_dictfull if the dictionary is full and the key is missing.
+ * gs_error_dictfull if the dictionary is full and the key is missing.
*/
int dict_find(const ref * pdref, const ref * key, ref ** ppvalue);
@@ -101,18 +101,18 @@ int dict_find_string(const ref * pdref, const char *kstr, ref ** ppvalue);
* Enter a key-value pair in a dictionary.
* The caller is responsible for checking that the dictionary is writable.
* Return 1 if this was a new entry, 0 if this replaced an existing entry.
- * Failure returns are as for dict_find, except that e_dictfull doesn't
+ * Failure returns are as for dict_find, except that gs_error_dictfull doesn't
* occur if the dictionary is full but expandable, plus:
- * e_invalidaccess for an attempt to store a younger key or value into
+ * gs_error_invalidaccess for an attempt to store a younger key or value into
* an older dictionary, or as described just below;
- * e_VMerror if a VMerror occurred while trying to expand the
+ * gs_error_VMerror if a VMerror occurred while trying to expand the
* dictionary.
* Note that this procedure, and all procedures that may change the
* contents of a dictionary, take a pointer to a dictionary stack,
* so they can update the cached 'top' values and also update the cached
* value pointer in names. A NULL pointer for the dictionary stack is
* allowed, but in this case, if the dictionary is present on any dictionary
- * stack, an e_invalidaccess error will occur if cached values need updating.
+ * stack, an gs_error_invalidaccess error will occur if cached values need updating.
* THIS ERROR CHECK IS NOT IMPLEMENTED YET.
*/
int dict_put(ref * pdref, const ref * key, const ref * pvalue,
@@ -126,8 +126,8 @@ int dict_put_string(ref * pdref, const char *kstr, const ref * pvalue,
/*
* Remove a key-value pair from a dictionary.
- * Return any of the same values as dict_put, except for 0 and e_dictfull
- * which are converted to e_undefined.
+ * Return any of the same values as dict_put, except for 0 and gs_error_dictfull
+ * which are converted to gs_error_undefined.
*/
int dict_undef(ref * pdref, const ref * key, dict_stack_t *pds);
@@ -149,7 +149,7 @@ uint dict_max_index(const ref * pdref);
/*
* Copy one dictionary into another.
- * Return 0 or e_dictfull.
+ * Return 0 or gs_error_dictfull.
* If new_only is true, only copy entries whose keys
* aren't already present in the destination.
*/
@@ -161,7 +161,7 @@ int dict_copy_entries(const ref * dfrom, ref * dto, bool new_only,
/*
* Grow or shrink a dictionary.
- * Return 0, e_dictfull, or e_VMerror.
+ * Return 0, gs_error_dictfull, or gs_error_VMerror.
*/
int dict_resize(ref * pdref, uint newmaxlength, dict_stack_t *pds);
@@ -203,7 +203,7 @@ int dict_value_index(const ref * pdref, const ref * pvalue);
/*
* Given an index in [0..max_index-1], as returned by dict_value_index,
* return the key and value, as returned by dict_next.
- * If the index designates an unoccupied entry, return e_undefined.
+ * If the index designates an unoccupied entry, return gs_error_undefined.
*/
int dict_index_entry(const ref * pdref, int index, ref * eltp);
diff --git a/gs/psi/idparam.c b/gs/psi/idparam.c
index 4e0b807ea..c16d4fb8a 100644
--- a/gs/psi/idparam.c
+++ b/gs/psi/idparam.c
@@ -45,7 +45,7 @@ dict_bool_param(const ref * pdict, const char *kstr,
return 1;
}
if (!r_has_type(pdval, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
*pvalue = pdval->value.boolval;
return 0;
}
@@ -54,7 +54,7 @@ dict_bool_param(const ref * pdict, const char *kstr,
/* Return 0 if found, 1 if defaulted, <0 if invalid. */
/* If the parameter is null, return 2 without setting *pvalue. */
/* Note that the default value may be out of range, in which case */
-/* a missing value will return e_undefined rather than 1. */
+/* a missing value will return gs_error_undefined rather than 1. */
int
dict_int_null_param(const ref * pdict, const char *kstr, int minval,
int maxval, int defaultval, int *pvalue)
@@ -69,7 +69,7 @@ dict_int_null_param(const ref * pdict, const char *kstr, int minval,
switch (r_type(pdval)) {
case t_integer:
if (pdval->value.intval < minval || pdval->value.intval > maxval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ival = pdval->value.intval;
break;
case t_real:
@@ -78,29 +78,29 @@ dict_int_null_param(const ref * pdict, const char *kstr, int minval,
/* as well) sometimes generates output that */
/* needs this. */
if (pdval->value.realval < minval || pdval->value.realval > maxval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ival = (long)pdval->value.realval;
if (ival != pdval->value.realval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
break;
case t_null:
return 2;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = 0;
}
if (ival < minval || ival > maxval) {
if (code == 1)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
*pvalue = (int)ival;
return code;
}
/* Get an integer parameter from a dictionary. */
-/* Return like dict_int_null_param, but return e_typecheck for null. */
+/* Return like dict_int_null_param, but return gs_error_typecheck for null. */
int
dict_int_param(const ref * pdict, const char *kstr, int minval, int maxval,
int defaultval, int *pvalue)
@@ -108,13 +108,13 @@ dict_int_param(const ref * pdict, const char *kstr, int minval, int maxval,
int code = dict_int_null_param(pdict, kstr, minval, maxval,
defaultval, pvalue);
- return (code == 2 ? gs_note_error(e_typecheck) : code);
+ return (code == 2 ? gs_note_error(gs_error_typecheck) : code);
}
/* Get an unsigned integer parameter from a dictionary. */
/* Return 0 if found, 1 if defaulted, <0 if invalid. */
/* Note that the default value may be out of range, in which case */
-/* a missing value will return e_undefined rather than 1. */
+/* a missing value will return gs_error_undefined rather than 1. */
int
dict_uint_param(const ref * pdict, const char *kstr,
uint minval, uint maxval, uint defaultval, uint * pvalue)
@@ -129,15 +129,15 @@ dict_uint_param(const ref * pdict, const char *kstr,
} else {
check_type_only(*pdval, t_integer);
if (pdval->value.intval != (uint) pdval->value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ival = (uint) pdval->value.intval;
code = 0;
}
if (ival < minval || ival > maxval) {
if (code == 1)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
*pvalue = ival;
return code;
@@ -163,7 +163,7 @@ dict_float_param(const ref * pdict, const char *kstr,
*pvalue = pdval->value.realval;
return 0;
}
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
/* Get an integer array from a dictionary. */
@@ -179,7 +179,7 @@ dict_int_array_check_param(const gs_memory_t *mem, const ref * pdict,
if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0)
return 0;
if (!r_is_array(pdval))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
size = r_size(pdval);
if (size > len)
return_error(over_error);
@@ -191,7 +191,7 @@ dict_int_array_check_param(const gs_memory_t *mem, const ref * pdict,
switch (r_type(&pa)) {
case t_integer:
if (pa.value.intval != (int)pa.value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ivec[i] = (int)pa.value.intval;
break;
case t_real:
@@ -199,11 +199,11 @@ dict_int_array_check_param(const gs_memory_t *mem, const ref * pdict,
pa.value.realval > max_int ||
pa.value.realval != (int)pa.value.realval
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ivec[i] = (int)pa.value.realval;
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
return (size == len || under_error >= 0 ? size :
@@ -214,14 +214,14 @@ dict_int_array_param(const gs_memory_t *mem, const ref * pdict,
const char *kstr, uint maxlen, int *ivec)
{
return dict_int_array_check_param(mem, pdict, kstr, maxlen, ivec,
- 0, e_limitcheck);
+ 0, gs_error_limitcheck);
}
int
dict_ints_param(const gs_memory_t *mem, const ref * pdict,
const char *kstr, uint len, int *ivec)
{
return dict_int_array_check_param(mem, pdict, kstr, len, ivec,
- e_rangecheck, e_rangecheck);
+ gs_error_rangecheck, gs_error_rangecheck);
}
/* Get a float array from a dictionary. */
@@ -248,7 +248,7 @@ dict_float_array_check_param(const gs_memory_t *mem,
}
if (!r_is_array(pdval))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
size = r_size(pdval);
if (over_error < 0 && size > len)
return_error(over_error);
@@ -265,7 +265,7 @@ dict_float_array_param(const gs_memory_t *mem,
uint maxlen, float *fvec, const float *defaultvec)
{
return dict_float_array_check_param(mem ,pdict, kstr, maxlen, fvec,
- defaultvec, 0, e_limitcheck);
+ defaultvec, 0, gs_error_limitcheck);
}
int
dict_floats_param(const gs_memory_t *mem,
@@ -274,7 +274,7 @@ dict_floats_param(const gs_memory_t *mem,
{
return dict_float_array_check_param(mem, pdict, kstr, maxlen,
fvec, defaultvec,
- e_rangecheck, e_rangecheck);
+ gs_error_rangecheck, gs_error_rangecheck);
}
/* Do dict_floats_param() and store [/key any] array in $error.errorinfo
@@ -287,7 +287,7 @@ dict_floats_param_errorinfo(i_ctx_t *i_ctx_p,
{
ref *val;
int code = dict_float_array_check_param(imemory, pdict, kstr, maxlen,
- fvec, defaultvec, e_rangecheck, e_rangecheck);
+ fvec, defaultvec, gs_error_rangecheck, gs_error_rangecheck);
if (code < 0) {
if (dict_find_string(pdict, kstr, &val) > 0)
gs_errorinfo_put_pair(i_ctx_p, kstr, strlen(kstr), val);
@@ -326,7 +326,7 @@ dict_matrix_param(const gs_memory_t *mem, const ref * pdict, const char *kstr, g
ref *pdval;
if (pdict == 0 || dict_find_string(pdict, kstr, &pdval) <= 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return read_matrix(mem, pdval, pmat);
}
@@ -351,22 +351,22 @@ dict_uid_param(const ref * pdict, gs_uid * puid, int defaultval,
uint size, i;
if (!r_has_type(puniqueid, t_array))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
size = r_size(puniqueid);
if (size == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
xvalues = (long *)gs_alloc_byte_array(mem, size, sizeof(long),
"get XUID");
if (xvalues == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
/* Get the values from the XUID array. */
for (i = 0; i < size; i++) {
const ref *pvalue = puniqueid->value.const_refs + i;
if (!r_has_type(pvalue, t_integer)) {
gs_free_object(mem, xvalues, "get XUID");
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
xvalues[i] = pvalue->value.intval;
}
@@ -381,9 +381,9 @@ dict_uid_param(const ref * pdict, gs_uid * puid, int defaultval,
return defaultval;
} else {
if (!r_has_type(puniqueid, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (puniqueid->value.intval < 0 || puniqueid->value.intval > 0xffffff)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Apparently fonts created by Fontographer often have */
/* a UniqueID of 0, contrary to Adobe's specifications. */
/* Treat 0 as equivalent to -1 (no UniqueID). */
@@ -452,7 +452,7 @@ gs_errorinfo_put_pair(i_ctx_t *i_ctx_p, const char *key, int len, const ref *any
!r_has_type(pderror, t_dictionary) ||
idict_put_string(pderror, "errorinfo", &pair) < 0
)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
return 0;
}
diff --git a/gs/psi/ierrors.h b/gs/psi/ierrors.h
index 8c5294d3d..9480e11b0 100644
--- a/gs/psi/ierrors.h
+++ b/gs/psi/ierrors.h
@@ -19,6 +19,8 @@
#ifndef ierrors_INCLUDED
# define ierrors_INCLUDED
+#include "gserrors.h"
+
/*
* DO NOT USE THIS FILE IN THE GRAPHICS LIBRARY.
* THIS FILE IS PART OF THE POSTSCRIPT INTERPRETER.
@@ -37,32 +39,6 @@ extern const char *const gs_error_names[];
/* ------ PostScript Level 1 errors ------ */
-#define e_unknownerror (-1) /* unknown error */
-#define e_dictfull (-2)
-#define e_dictstackoverflow (-3)
-#define e_dictstackunderflow (-4)
-#define e_execstackoverflow (-5)
-#define e_interrupt (-6)
-#define e_invalidaccess (-7)
-#define e_invalidexit (-8)
-#define e_invalidfileaccess (-9)
-#define e_invalidfont (-10)
-#define e_invalidrestore (-11)
-#define e_ioerror (-12)
-#define e_limitcheck (-13)
-#define e_nocurrentpoint (-14)
-#define e_rangecheck (-15)
-#define e_stackoverflow (-16)
-#define e_stackunderflow (-17)
-#define e_syntaxerror (-18)
-#define e_timeout (-19)
-#define e_typecheck (-20)
-#define e_undefined (-21)
-#define e_undefinedfilename (-22)
-#define e_undefinedresult (-23)
-#define e_unmatchedmark (-24)
-#define e_VMerror (-25) /* must be the last Level 1 error */
-
#define LEVEL1_ERROR_NAMES\
"unknownerror", "dictfull", "dictstackoverflow", "dictstackunderflow",\
"execstackoverflow", "interrupt", "invalidaccess", "invalidexit",\
@@ -73,83 +49,21 @@ extern const char *const gs_error_names[];
/* ------ Additional Level 2 errors (also in DPS) ------ */
-#define e_configurationerror (-26)
-#define e_undefinedresource (-27)
-#define e_unregistered (-28)
-
#define LEVEL2_ERROR_NAMES\
"configurationerror", "undefinedresource", "unregistered"
/* ------ Additional DPS errors ------ */
-#define e_invalidcontext (-29)
-/* invalidid is for the NeXT DPS extension. */
-#define e_invalidid (-30)
-
#define DPS_ERROR_NAMES\
"invalidcontext", "invalidid"
#define ERROR_NAMES\
LEVEL1_ERROR_NAMES, LEVEL2_ERROR_NAMES, DPS_ERROR_NAMES
- /* ------ Pseudo-errors used internally ------ */
-
-/*
- * Internal code for a fatal error.
- * gs_interpret also returns this for a .quit with a positive exit code.
- */
-#define e_Fatal (-100)
-
-/*
- * Internal code for the .quit operator.
- * The real quit code is an integer on the operand stack.
- * gs_interpret returns this only for a .quit with a zero exit code.
- */
-#define e_Quit (-101)
-
-/*
- * Internal code for a normal exit from the interpreter.
- * Do not use outside of interp.c.
- */
-#define e_InterpreterExit (-102)
-
-/*
- * Internal code that indicates that a procedure has been stored in the
- * remap_proc of the graphics state, and should be called before retrying
- * the current token. This is used for color remapping involving a call
- * back into the interpreter -- inelegant, but effective.
- */
-#define e_RemapColor (-103)
-
-/*
- * Internal code to indicate we have underflowed the top block
- * of the e-stack.
- */
-#define e_ExecStackUnderflow (-104)
-
-/*
- * Internal code for the vmreclaim operator with a positive operand.
- * We need to handle this as an error because otherwise the interpreter
- * won't reload enough of its state when the operator returns.
- */
-#define e_VMreclaim (-105)
-
-/*
- * Internal code for requesting more input from run_string.
- */
-#define e_NeedInput (-106)
-
-/*
- * Internal code for a normal exit when usage info is displayed.
- * This allows Window versions of Ghostscript to pause until
- * the message can be read.
- */
-#define e_Info (-110)
-
/*
* Define which error codes require re-executing the current object.
*/
-#define ERROR_IS_INTERRUPT(ecode)\
- ((ecode) == e_interrupt || (ecode) == e_timeout)
+#define GS_ERROR_IS_INTERRUPT(ecode)\
+ ((ecode) == gs_error_interrupt || (ecode) == gs_error_timeout)
#endif /* ierrors_INCLUDED */
diff --git a/gs/psi/igstate.h b/gs/psi/igstate.h
index 088939ce9..0af15608a 100644
--- a/gs/psi/igstate.h
+++ b/gs/psi/igstate.h
@@ -161,7 +161,7 @@ typedef struct int_gstate_s {
/*
* Remap_color_info is used temporarily to communicate the need for
* Pattern or DeviceNcolor remapping to the interpreter. See
- * e_RemapColor in ierrors.h. The extra level of indirection through a
+ * gs_error_Remap_Color in gserrors.h. The extra level of indirection through a
* structure is needed because the gstate passed to the PaintProc is
* different from the current gstate in the graphics state, and because
* the DeviceN color being remapped is not necessarily the current color
diff --git a/gs/psi/iinit.c b/gs/psi/iinit.c
index 18b286fff..6deaf25f7 100644
--- a/gs/psi/iinit.c
+++ b/gs/psi/iinit.c
@@ -276,7 +276,7 @@ obj_init(i_ctx_t **pi_ctx_p, gs_dual_memory_t *idmem)
for (def = *tptr; def->oname != 0; def++)
if (op_def_is_begin_dict(def)) {
if (make_initial_dict(i_ctx_p, def->oname, idicts) == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
}
@@ -290,7 +290,7 @@ obj_init(i_ctx_t **pi_ctx_p, gs_dual_memory_t *idmem)
dstack_userdict_index = dsp - dsbot;
r = make_initial_dict(i_ctx_p, dname, idicts);
if (r == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
ref_assign(dsp, r);
}
@@ -426,7 +426,7 @@ alloc_op_array_table(i_ctx_t *i_ctx_p, uint size, uint space,
(ushort *) ialloc_byte_array(size, sizeof(ushort),
"op_array nx_table");
if (opt->nx_table == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
opt->count = 0;
opt->attrs = space | a_executable;
return 0;
@@ -454,9 +454,9 @@ op_init(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (!dict_find(systemdict, &nref, &pdict))
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
if (!r_has_type(pdict, t_dictionary))
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
} else {
ref oper;
uint index_in_table = def - *tptr;
@@ -465,14 +465,14 @@ op_init(i_ctx_t *i_ctx_p)
if (index_in_table >= OP_DEFS_MAX_SIZE) {
lprintf1("opdef overrun! %s\n", def->oname);
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
gs_interp_make_oper(&oper, def->proc, opidx);
/* The first character of the name is a digit */
/* giving the minimum acceptable number of operands. */
/* Check to make sure it's within bounds. */
if (*nstr - '0' > gs_interp_max_op_num_args)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
nstr++;
/*
* Skip internal operators, and the second occurrence of
diff --git a/gs/psi/imain.c b/gs/psi/imain.c
index 9ddd03ed5..033b9f622 100644
--- a/gs/psi/imain.c
+++ b/gs/psi/imain.c
@@ -162,14 +162,14 @@ gs_main_init0(gs_main_instance * minst, FILE * in, FILE * out, FILE * err,
paths = (ref *) gs_alloc_byte_array(minst->heap, max_lib_paths, sizeof(ref),
"lib_path array");
if (paths == 0) {
- gs_lib_finit(1, e_VMerror, minst->heap);
- return_error(e_VMerror);
+ gs_lib_finit(1, gs_error_VMerror, minst->heap);
+ return_error(gs_error_VMerror);
}
array = (ref *) gs_alloc_byte_array(minst->heap, max_lib_paths, sizeof(ref),
"lib_path array");
if (array == 0) {
- gs_lib_finit(1, e_VMerror, minst->heap);
- return_error(e_VMerror);
+ gs_lib_finit(1, gs_error_VMerror, minst->heap);
+ return_error(gs_error_VMerror);
}
make_array(&minst->lib_path.container, avm_foreign, max_lib_paths,
array);
@@ -208,7 +208,7 @@ gs_main_init1(gs_main_instance * minst)
idmem.space_system);
if (nt == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
mem->gs_lib_ctx->gs_name_table = nt;
code = gs_register_struct_root(mem, NULL,
(void **)&mem->gs_lib_ctx->gs_name_table,
@@ -352,7 +352,7 @@ gs_main_init2(gs_main_instance * minst)
outprintf(minst->heap,
" --saved-pages not supported by the '%s' device.\n",
pdev->dname);
- return e_Fatal;
+ return gs_error_Fatal;
}
code = gx_saved_pages_param_process(ppdev, minst->saved_pages_initial_arg,
strlen(minst->saved_pages_initial_arg));
@@ -384,7 +384,7 @@ extend_path_list_container (gs_main_instance * minst, gs_file_path * pfp)
"extend_path_list_container array");
if (paths == 0) {
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
make_array(&minst->lib_path.container, avm_foreign, len + LIB_PATH_EXTEND, paths);
make_array(&minst->lib_path.list, avm_foreign | a_readonly, 0,
@@ -553,7 +553,7 @@ gs_main_run_file_open(gs_main_instance * minst, const char *file_name, ref * pfr
emprintf1(minst->heap,
"Can't find initialization file %s.\n",
file_name);
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
r_set_attrs(pfref, a_execute + a_executable);
return 0;
@@ -584,7 +584,7 @@ gs_run_init_file(gs_main_instance * minst, int *pexit_code, ref * perror_object)
"Initialization file %s does not begin with an integer.\n",
gs_init_file);
*pexit_code = 255;
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
*++osp = first_token;
r_set_attrs(&ifile, a_executable);
@@ -613,7 +613,7 @@ gs_main_run_string_with_length(gs_main_instance * minst, const char *str,
return code;
code = gs_main_run_string_continue(minst, str, length, user_errors,
pexit_code, perror_object);
- if (code != e_NeedInput)
+ if (code != gs_error_NeedInput)
return code;
return gs_main_run_string_end(minst, user_errors,
pexit_code, perror_object);
@@ -633,7 +633,7 @@ gs_main_run_string_begin(gs_main_instance * minst, int user_errors,
strlen(setup), (const byte *)setup);
code = gs_main_interpret(minst, &rstr, user_errors, pexit_code,
perror_object);
- return (code == e_NeedInput ? 0 : code == 0 ? e_Fatal : code);
+ return (code == gs_error_NeedInput ? 0 : code == 0 ? gs_error_Fatal : code);
}
/* Continue running a string with the option of suspending. */
int
@@ -719,7 +719,7 @@ static int
pop_value(i_ctx_t *i_ctx_p, ref * pvalue)
{
if (!ref_stack_count(&o_stack))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
*pvalue = *ref_stack_index(&o_stack, 0L);
return 0;
}
@@ -771,7 +771,7 @@ gs_pop_real(gs_main_instance * minst, float *result)
*result = (float)(vref.value.intval);
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
ref_stack_pop(&o_stack, 1);
return 0;
@@ -797,7 +797,7 @@ gs_pop_string(gs_main_instance * minst, gs_string * result)
result->size = r_size(&vref);
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
ref_stack_pop(&o_stack, 1);
return code;
@@ -906,7 +906,7 @@ gs_main_finit(gs_main_instance * minst, int exit_status, int code)
emprintf1(minst->heap,
"ERROR %d reclaiming the memory while the interpreter finalization.\n",
code);
- return e_Fatal;
+ return gs_error_Fatal;
}
i_ctx_p = minst->i_ctx_p; /* interp_reclaim could change it. */
}
@@ -930,7 +930,7 @@ gs_main_finit(gs_main_instance * minst, int exit_status, int code)
code,
dname);
rc_decrement(pdev, "gs_main_finit"); /* device might be freed */
- if (exit_status == 0 || exit_status == e_Quit)
+ if (exit_status == 0 || exit_status == gs_error_Quit)
exit_status = code;
}
#endif
diff --git a/gs/psi/imain.h b/gs/psi/imain.h
index 11a202bb6..a840f7ad3 100644
--- a/gs/psi/imain.h
+++ b/gs/psi/imain.h
@@ -151,9 +151,9 @@ int gs_main_lib_open(gs_main_instance * minst, const char *fname,
* (gs_main_run_string_begin/continue/end).
*
* The value returned by the first three of these calls is
- * 0 if the interpreter ran to completion, e_Quit for a normal quit,
- * or e_Fatal for a non-zero quit or a fatal error.
- * e_Fatal stores the exit code in the third argument.
+ * 0 if the interpreter ran to completion, gs_error_Quit for a normal quit,
+ * or gs_error_Fatal for a non-zero quit or a fatal error.
+ * gs_error_Fatal stores the exit code in the third argument.
* The str argument of gs_main_run_string[_with_length] must be allocated
* in non-garbage-collectable space (e.g., by malloc or gs_malloc,
* or statically).
@@ -182,9 +182,9 @@ int gs_main_run_file_open(gs_main_instance * minst,
* be a properly formed PostScript program fragment. To use them:
* Call run_string_begin.
* Call run_string_continue as many times as desired,
- * stopping if it returns anything other than e_NeedInput.
+ * stopping if it returns anything other than gs_error_NeedInput.
* If run_string_continue didn't indicate an error or a quit
- * (i.e., a return value other than e_NeedInput), call run_string_end
+ * (i.e., a return value other than gs_error_NeedInput), call run_string_end
* to provide an EOF indication.
* Note that run_string_continue takes a pointer and a length, like
* run_string_with_length.
@@ -204,8 +204,8 @@ int gs_main_run_string_end(gs_main_instance * minst, int user_errors,
* The following procedures are not used in normal operation;
* they exist only to allow clients driving the interpreter through the
* gs_main_run_xxx procedures to push parameters quickly and to get results
- * back. The push procedures return 0, e_stackoverflow, or e_VMerror;
- * the pop procedures return 0, e_stackunderflow, or e_typecheck.
+ * back. The push procedures return 0, gs_error_stackoverflow, or gs_error_VMerror;
+ * the pop procedures return 0, gs_error_stackunderflow, or gs_error_typecheck.
*
* Procedures to push values on the operand stack:
*/
diff --git a/gs/psi/imainarg.c b/gs/psi/imainarg.c
index 7c86dc488..1abfcf8c6 100644
--- a/gs/psi/imainarg.c
+++ b/gs/psi/imainarg.c
@@ -191,7 +191,7 @@ gs_main_init_with_args(gs_main_instance * minst, int argc, char *argv[])
helping = true;
}
if (helping)
- return e_Info;
+ return gs_error_Info;
}
/* Execute files named in the command line, */
/* processing options along the way. */
@@ -210,10 +210,10 @@ gs_main_init_with_args(gs_main_instance * minst, int argc, char *argv[])
gp_getenv(GS_OPTIONS, opts, &len); /* can't fail */
#if defined(GS_NO_UTF8)
if (arg_push_memory_string(&args, opts, false, minst->heap))
- return e_Fatal;
+ return gs_error_Fatal;
#else
if (arg_push_decoded_memory_string(&args, opts, false, true, minst->heap))
- return e_Fatal;
+ return gs_error_Fatal;
#endif
}
}
@@ -269,7 +269,7 @@ gs_main_init_with_args(gs_main_instance * minst, int argc, char *argv[])
dmprintf(minst->heap, "\n");
}
if (!minst->run_start)
- return e_Quit;
+ return gs_error_Quit;
return code ;
}
@@ -364,7 +364,7 @@ run_stdin:
outprintf(minst->heap,
" Only one --saved-pages=... command allowed before processing input\n");
arg_finit(pal);
- return e_Fatal;
+ return gs_error_Fatal;
}
} else {
/* get the current device */
@@ -374,7 +374,7 @@ run_stdin:
" --saved-pages not supported by the '%s' device.\n",
pdev->dname);
arg_finit(pal);
- return e_Fatal;
+ return gs_error_Fatal;
}
ppdev = (gx_device_printer *)pdev;
code = gx_saved_pages_param_process(ppdev, (byte *)arg+12, strlen(arg+12));
@@ -397,15 +397,15 @@ run_stdin:
const char *psarg = arg_next(pal, &code, minst->heap);
if (code < 0)
- return e_Fatal;
+ return gs_error_Fatal;
if (psarg == 0) {
outprintf(minst->heap, "Usage: gs ... -%c file.ps arg1 ... argn\n", sw);
arg_finit(pal);
- return e_Fatal;
+ return gs_error_Fatal;
}
psarg = arg_copy(psarg, minst->heap);
if (psarg == NULL)
- code = e_Fatal;
+ code = gs_error_Fatal;
else
code = gs_main_init2(minst);
if (code >= 0)
@@ -420,7 +420,7 @@ run_stdin:
code = runarg(minst, "]put", psarg, ".runfile", runInit | runFlush);
arg_free((char *)psarg, minst->heap);
if (code >= 0)
- code = e_Quit;
+ code = gs_error_Quit;
return code;
}
@@ -434,7 +434,7 @@ run_stdin:
break;
default:
puts(minst->heap, "-A may only be followed by -");
- return e_Fatal;
+ return gs_error_Fatal;
}
break;
case 'B': /* set run_string buffer size */
@@ -449,7 +449,7 @@ run_stdin:
outprintf(minst->heap,
"-B must be followed by - or size between 1 and %u\n",
MAX_BUFFERED_SIZE);
- return e_Fatal;
+ return gs_error_Fatal;
}
minst->run_buffer_size = bsize;
}
@@ -472,11 +472,11 @@ run_stdin:
return code;
}
if (code < 0)
- return e_Fatal;
+ return gs_error_Fatal;
if (arg != 0) {
char *p = arg_copy(arg, minst->heap);
if (p == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
arg_push_string(pal, p, true);
}
pal->expand_ats = ats;
@@ -492,7 +492,7 @@ run_stdin:
break;
default:
puts(minst->heap, "-E may only be followed by -");
- return e_Fatal;
+ return gs_error_Fatal;
}
break;
case 'f': /* run file of arbitrary name */
@@ -518,7 +518,7 @@ run_stdin:
case 'F': /* run file with buffer_size = 1 */
if (!*arg) {
puts(minst->heap, "-F requires a file name");
- return e_Fatal;
+ return gs_error_Fatal;
} {
uint bsize = minst->run_buffer_size;
@@ -550,7 +550,7 @@ run_stdin:
return code;
if (sscanf((const char *)arg, "%ldx%ld", &width, &height) != 2) {
puts(minst->heap, "-g must be followed by <width>x<height>");
- return e_Fatal;
+ return gs_error_Fatal;
}
make_int(&value, width);
initial_enter_name("DEVICEWIDTH", &value);
@@ -562,7 +562,7 @@ run_stdin:
case 'h': /* print help */
case '?': /* ditto */
print_help(minst);
- return e_Info; /* show usage info on exit */
+ return gs_error_Info; /* show usage info on exit */
case 'I': /* specify search path */
{
const char *path;
@@ -574,10 +574,10 @@ run_stdin:
} else
path = arg;
if (path == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
path = arg_copy(path, minst->heap);
if (path == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
gs_main_add_lib_path(minst, path);
}
break;
@@ -590,7 +590,7 @@ run_stdin:
if (msize <= 0 || msize > max_long >> 10) {
outprintf(minst->heap, "-K<numK> must have 1 <= numK <= %ld\n",
max_long >> 10);
- return e_Fatal;
+ return gs_error_Fatal;
}
rawheap->limit = msize << 10;
}
@@ -603,7 +603,7 @@ run_stdin:
#if ARCH_INTS_ARE_SHORT
if (msize <= 0 || msize >= 64) {
puts(minst->heap, "-M must be between 1 and 63");
- return e_Fatal;
+ return gs_error_Fatal;
}
#endif
minst->memory_chunk_size = msize << 10;
@@ -617,7 +617,7 @@ run_stdin:
#if ARCH_INTS_ARE_SHORT
if (nsize < 2 || nsize > 64) {
puts(minst->heap, "-N must be between 2 and 64");
- return e_Fatal;
+ return gs_error_Fatal;
}
#endif
minst->name_table_size = (ulong) nsize << 10;
@@ -641,7 +641,7 @@ run_stdin:
len = strlen(adef);
str = (char *)gs_alloc_bytes(minst->heap, (uint)len, "-o");
if (str == NULL)
- return e_VMerror;
+ return gs_error_VMerror;
memcpy(str, adef, len);
make_const_string(&value, a_readonly | avm_foreign,
len, (const byte *)str);
@@ -657,7 +657,7 @@ run_stdin:
minst->search_here_first = false;
else {
puts(minst->heap, "Only -P or -P- is allowed.");
- return e_Fatal;
+ return gs_error_Fatal;
}
break;
case 'q': /* quiet startup */
@@ -675,7 +675,7 @@ run_stdin:
switch (sscanf((const char *)arg, "%fx%f", &xres, &yres)) {
default:
puts(minst->heap, "-r must be followed by <res> or <xres>x<yres>");
- return e_Fatal;
+ return gs_error_Fatal;
case 1: /* -r<res> */
yres = xres;
case 2: /* -r<xres>x<yres> */
@@ -698,7 +698,7 @@ run_stdin:
ref value;
if (adef == NULL)
- return e_Fatal;
+ return gs_error_Fatal;
eqp = strchr(adef, '=');
if (eqp == NULL)
@@ -709,7 +709,7 @@ run_stdin:
return code;
if (eqp == adef) {
puts(minst->heap, "Usage: -dNAME, -dNAME=TOKEN, -sNAME=STRING");
- return e_Fatal;
+ return gs_error_Fatal;
}
if (eqp == NULL) {
if (isd)
@@ -765,7 +765,7 @@ run_stdin:
code = gs_scan_token(minst->i_ctx_p, &value, &state);
if (code) {
outprintf(minst->heap, "Invalid value for option -d%s, -dNAME= must be followed by a valid token\n", arg);
- return e_Fatal;
+ return gs_error_Fatal;
}
if (r_has_type_attrs(&value, t_name,
a_executable)) {
@@ -784,7 +784,7 @@ run_stdin:
make_false(&value);
else {
outprintf(minst->heap, "Invalid value for option -d%s, use -sNAME= to define string constants\n", arg);
- return e_Fatal;
+ return gs_error_Fatal;
}
}
}
@@ -796,7 +796,7 @@ run_stdin:
if (str == 0) {
lprintf("Out of memory!\n");
- return e_Fatal;
+ return gs_error_Fatal;
}
memcpy(str, eqp, len);
make_const_string(&value,
@@ -817,7 +817,7 @@ run_stdin:
case 'u': /* undefine name */
if (!*arg) {
puts(minst->heap, "-u requires a name to undefine.");
- return e_Fatal;
+ return gs_error_Fatal;
}
if ((code = gs_main_init1(minst)) < 0)
return code;
@@ -825,7 +825,7 @@ run_stdin:
break;
case 'v': /* print revision */
print_revision(minst);
- return e_Info;
+ return gs_error_Info;
/*#ifdef DEBUG */
/*
* Here we provide a place for inserting debugging code that can be
@@ -850,7 +850,7 @@ run_stdin:
run_x("== flush\n");
stop_x();
}
- return e_Quit;
+ return gs_error_Quit;
/*#endif */
case 'Z':
set_debug_flags(arg, gs_debug);
@@ -912,7 +912,7 @@ run_buffered(gs_main_instance * minst, const char *arg)
if (in == 0) {
outprintf(minst->heap, "Unable to open %s for reading", arg);
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
}
code = gs_main_init2(minst);
if (code < 0) {
@@ -925,15 +925,15 @@ run_buffered(gs_main_instance * minst, const char *arg)
char buf[MAX_BUFFERED_SIZE];
int count;
- code = e_NeedInput;
+ code = gs_error_NeedInput;
while ((count = fread(buf, 1, minst->run_buffer_size, in)) > 0) {
code = gs_main_run_string_continue(minst, buf, count,
minst->user_errors,
&exit_code, &error_object);
- if (code != e_NeedInput)
+ if (code != gs_error_NeedInput)
break;
}
- if (code == e_NeedInput) {
+ if (code == gs_error_NeedInput) {
code = gs_main_run_string_end(minst, minst->user_errors,
&exit_code, &error_object);
}
@@ -960,7 +960,7 @@ runarg(gs_main_instance * minst, const char *pre, const char *arg,
line = (char *)gs_alloc_bytes(minst->heap, len, "runarg");
if (line == 0) {
lprintf("Out of memory!\n");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
strcpy(line, pre);
esc_strcat(line, arg);
@@ -990,10 +990,10 @@ run_finish(gs_main_instance *minst, int code, int exit_code,
ref * perror_object)
{
switch (code) {
- case e_Quit:
+ case gs_error_Quit:
case 0:
break;
- case e_Fatal:
+ case gs_error_Fatal:
emprintf1(minst->heap,
"Unrecoverable error, exit code %d\n",
exit_code);
@@ -1037,7 +1037,7 @@ try_stdout_redirect(gs_main_instance * minst,
}
else if ((minst->heap->gs_lib_ctx->fstdout2 =
gp_fopen(filename, "w")) == (FILE *)NULL)
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
minst->heap->gs_lib_ctx->stdout_is_redirected = 1;
}
return 0;
diff --git a/gs/psi/iname.c b/gs/psi/iname.c
index 2eb8ee29f..88cc938fe 100644
--- a/gs/psi/iname.c
+++ b/gs/psi/iname.c
@@ -194,9 +194,9 @@ names_ref(name_table *nt, const byte *ptr, uint size, ref *pref, int enterflag)
}
/* Name was not in the table. Make a new entry. */
if (enterflag < 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (size > max_name_string)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
nidx = nt->free;
if (nidx == 0) {
int code = name_alloc_sub(nt);
@@ -211,7 +211,7 @@ names_ref(name_table *nt, const byte *ptr, uint size, ref *pref, int enterflag)
"names_ref(string)");
if (cptr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(cptr, ptr, size);
pnstr->string_bytes = cptr;
pnstr->foreign_string = 0;
@@ -477,7 +477,7 @@ name_alloc_sub(name_table * nt)
for (;; ++sub_index) {
if (sub_index > nt->max_sub_count)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if (nt->sub[sub_index].names == 0)
break;
}
@@ -492,7 +492,7 @@ name_alloc_sub(name_table * nt)
if (sub == 0 || ssub == 0) {
gs_free_object(mem, ssub, "name_alloc_sub(string sub-table)");
gs_free_object(mem, sub, "name_alloc_sub(sub-table)");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
memset(sub, 0, sizeof(name_sub_table));
memset(ssub, 0, sizeof(name_string_sub_table_t));
diff --git a/gs/psi/inobtokn.c b/gs/psi/inobtokn.c
index 20849036c..6c6cd3810 100644
--- a/gs/psi/inobtokn.c
+++ b/gs/psi/inobtokn.c
@@ -24,5 +24,5 @@
int
scan_binary_token(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
{
- return_error(e_unregistered);
+ return_error(gs_error_unregistered);
}
diff --git a/gs/psi/int.mak b/gs/psi/int.mak
index d98ec3b79..78effdd7b 100644
--- a/gs/psi/int.mak
+++ b/gs/psi/int.mak
@@ -49,7 +49,7 @@ INT_MAK=$(PSSRC)int.mak
# It knows about the PostScript data types, but isn't supposed to
# depend on anything outside itself.
-ierrors_h=$(PSSRC)ierrors.h
+ierrors_h=$(PSSRC)ierrors.h $(gserrors_h)
iconf_h=$(PSSRC)iconf.h
idebug_h=$(PSSRC)idebug.h
# Having iddstack.h at this level is unfortunate, but unavoidable.
diff --git a/gs/psi/interp.c b/gs/psi/interp.c
index 3e3aaaa25..64f336022 100644
--- a/gs/psi/interp.c
+++ b/gs/psi/interp.c
@@ -28,7 +28,7 @@
#include "icontext.h"
#include "icremap.h"
#include "idebug.h"
-#include "igstate.h" /* for handling e_RemapColor */
+#include "igstate.h" /* for handling gs_error_Remap_Color */
#include "inamedef.h"
#include "iname.h" /* for the_name_table */
#include "interp.h"
@@ -333,7 +333,7 @@ gs_interp_alloc_stacks(gs_ref_memory_t *mem, gs_context_state_t * pcst)
smem, NULL);
if (code < 0)
return code;
- ref_stack_set_error_codes(pos, e_stackunderflow, e_stackoverflow);
+ ref_stack_set_error_codes(pos, gs_error_stackunderflow, gs_error_stackoverflow);
ref_stack_set_max_count(pos, MAX_OSTACK);
stk.value.refs += REFS_SIZE_OSTACK;
}
@@ -348,8 +348,8 @@ gs_interp_alloc_stacks(gs_ref_memory_t *mem, gs_context_state_t * pcst)
smem, NULL);
if (code < 0)
return code;
- ref_stack_set_error_codes(pes, e_ExecStackUnderflow,
- e_execstackoverflow);
+ ref_stack_set_error_codes(pes, gs_error_ExecStackUnderflow,
+ gs_error_execstackoverflow);
/**************** E-STACK EXPANSION IS NYI. ****************/
ref_stack_allow_expansion(pes, false);
ref_stack_set_max_count(pes, MAX_ESTACK);
@@ -363,8 +363,8 @@ gs_interp_alloc_stacks(gs_ref_memory_t *mem, gs_context_state_t * pcst)
code = ref_stack_init(pds, &stk, 0, 0, NULL, smem, NULL);
if (code < 0)
return code;
- ref_stack_set_error_codes(pds, e_dictstackunderflow,
- e_dictstackoverflow);
+ ref_stack_set_error_codes(pds, gs_error_dictstackunderflow,
+ gs_error_dictstackoverflow);
ref_stack_set_max_count(pds, MAX_DSTACK);
}
@@ -400,7 +400,7 @@ gs_interp_reset(i_ctx_t *i_ctx_p)
static int
estack_underflow(i_ctx_t *i_ctx_p)
{
- return e_ExecStackUnderflow;
+ return gs_error_ExecStackUnderflow;
}
/*
@@ -520,25 +520,25 @@ again:
if (esp < esbot) /* popped guard entry */
esp = esbot;
switch (code) {
- case e_Fatal:
+ case gs_error_Fatal:
*pexit_code = 255;
return code;
- case e_Quit:
+ case gs_error_Quit:
*perror_object = osp[-1];
*pexit_code = code = osp->value.intval;
osp -= 2;
return
- (code == 0 ? e_Quit :
- code < 0 && code > -100 ? code : e_Fatal);
- case e_InterpreterExit:
+ (code == 0 ? gs_error_Quit :
+ code < 0 && code > -100 ? code : gs_error_Fatal);
+ case gs_error_InterpreterExit:
return 0;
- case e_ExecStackUnderflow:
+ case gs_error_ExecStackUnderflow:
/****** WRONG -- must keep mark blocks intact ******/
ref_stack_pop_block(&e_stack);
doref = *perror_object;
epref = &doref;
goto again;
- case e_VMreclaim:
+ case gs_error_VMreclaim:
/* Do the GC and continue. */
code = interp_reclaim(pi_ctx_p,
(osp->value.intval == 2 ?
@@ -548,8 +548,8 @@ again:
make_oper(&doref, 0, zpop);
epref = &doref;
goto again;
- case e_NeedInput:
- case e_interrupt:
+ case gs_error_NeedInput:
+ case gs_error_interrupt:
return code;
}
/* Adjust osp in case of operand stack underflow */
@@ -558,7 +558,7 @@ again:
/* We have to handle stack over/underflow specially, because */
/* we might be able to recover by adding or removing a block. */
switch (code) {
- case e_dictstackoverflow:
+ case gs_error_dictstackoverflow:
/* We don't have to handle this specially: */
/* The only places that could generate it */
/* use check_dstack, which does a ref_stack_extend, */
@@ -575,7 +575,7 @@ again:
dict_set_top();
*++osp = saref;
break;
- case e_dictstackunderflow:
+ case gs_error_dictstackunderflow:
if (ref_stack_pop_block(&d_stack) >= 0) {
dict_set_top();
doref = *perror_object;
@@ -583,7 +583,7 @@ again:
goto again;
}
break;
- case e_execstackoverflow:
+ case gs_error_execstackoverflow:
/* We don't have to handle this specially: */
/* The only places that could generate it */
/* use check_estack, which does a ref_stack_extend, */
@@ -620,7 +620,7 @@ again:
}
*++osp = saref;
break;
- case e_stackoverflow:
+ case gs_error_stackoverflow:
if (ref_stack_extend(&o_stack, o_stack.requested) >= 0) { /* We can't just re-execute the object, because */
/* it might be a procedure being pushed as a */
/* literal. We check for this case specially. */
@@ -638,7 +638,7 @@ again:
ref_stack_clear(&o_stack);
*++osp = saref;
break;
- case e_stackunderflow:
+ case gs_error_stackunderflow:
if (ref_stack_pop_block(&o_stack) >= 0) {
doref = *perror_object;
epref = &doref;
@@ -663,7 +663,7 @@ again:
doref = *epref;
epref = &doref;
/* Push the error object on the operand stack if appropriate. */
- if (!ERROR_IS_INTERRUPT(code)) {
+ if (!GS_ERROR_IS_INTERRUPT(code)) {
/* Replace the error object if within an oparray or .errorexec. */
*++osp = *perror_object;
errorexec_find(i_ctx_p, osp);
@@ -673,7 +673,7 @@ again:
static int
interp_exit(i_ctx_t *i_ctx_p)
{
- return e_InterpreterExit;
+ return gs_error_InterpreterExit;
}
/* Set the GC signal for all VMs. */
@@ -732,7 +732,7 @@ gs_errorname(i_ctx_t *i_ctx_p, int code, ref * perror_name)
if (dict_find_string(systemdict, "errordict", &perrordict) <= 0 ||
dict_find_string(systemdict, "ErrorNames", &pErrorNames) <= 0
)
- return_error(e_undefined); /* errordict or ErrorNames not found?! */
+ return_error(gs_error_undefined); /* errordict or ErrorNames not found?! */
return array_get(imemory, pErrorNames, (long)(-code - 1), perror_name);
}
@@ -751,12 +751,12 @@ gs_errorinfo_put_string(i_ctx_t *i_ctx_p, const char *str)
!r_has_type(pderror, t_dictionary) ||
idict_put_string(pderror, "errorinfo", &rstr) < 0
)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
return 0;
}
/* Main interpreter. */
-/* If execution terminates normally, return e_InterpreterExit. */
+/* If execution terminates normally, return gs_error_InterpreterExit. */
/* If an error occurs, leave the current object in *perror_object */
/* and return a (negative) error code. */
static int
@@ -830,9 +830,9 @@ interp(i_ctx_t **pi_ctx_p /* context for execution, updated if resched */,
#define return_with_code_iref()\
{ ierror.line = __LINE__; goto rweci; }
#define return_with_stackoverflow(objp)\
- { o_stack.requested = 1; return_with_error(e_stackoverflow, objp); }
+ { o_stack.requested = 1; return_with_error(gs_error_stackoverflow, objp); }
#define return_with_stackoverflow_iref()\
- { o_stack.requested = 1; return_with_error_iref(e_stackoverflow); }
+ { o_stack.requested = 1; return_with_error_iref(gs_error_stackoverflow); }
/*
* If control reaches the special operators (x_add, etc.) as a result of
* interpreting an executable name, iref points to the name, not the
@@ -899,7 +899,7 @@ interp(i_ctx_t **pi_ctx_p /* context for execution, updated if resched */,
/* so we push the argument on the estack and enter */
/* the loop at the bottom. */
if (iesp >= estop)
- return_with_error(e_execstackoverflow, pref);
+ return_with_error(gs_error_execstackoverflow, pref);
++iesp;
ref_assign_inline(iesp, pref);
goto bot;
@@ -919,7 +919,7 @@ interp(i_ctx_t **pi_ctx_p /* context for execution, updated if resched */,
(r_type(iosp) == t__invalid || r_type(iosp) >= tx_next_op)
) {
mlprintf(imemory, "Invalid value on o-stack!\n");
- return_with_error_iref(e_Fatal);
+ return_with_error_iref(gs_error_Fatal);
}
if (gs_debug['I'] ||
(gs_debug['i'] &&
@@ -964,13 +964,13 @@ interp(i_ctx_t **pi_ctx_p /* context for execution, updated if resched */,
#define cases_invalid()\
case plain(t__invalid): case plain_exec(t__invalid)
cases_invalid():
- return_with_error_iref(e_Fatal);
+ return_with_error_iref(gs_error_Fatal);
#define cases_nox()\
case nox_exec(t_array): case nox_exec(t_dictionary):\
case nox_exec(t_file): case nox_exec(t_string):\
case nox_exec(t_mixedarray): case nox_exec(t_shortarray)
cases_nox():
- return_with_error_iref(e_invalidaccess);
+ return_with_error_iref(gs_error_invalidaccess);
/*
* Literal objects. We have to enumerate all the types.
* In fact, we have to include some extra plain_exec entries
@@ -1032,10 +1032,10 @@ x_def: INCR(x_def);
case plain_exec(tx_op_dup):
x_dup: INCR(x_dup);
if (iosp < osbot)
- return_with_error_tx_op(e_stackunderflow);
+ return_with_error_tx_op(gs_error_stackunderflow);
if (iosp >= ostop) {
o_stack.requested = 1;
- return_with_error_tx_op(e_stackoverflow);
+ return_with_error_tx_op(gs_error_stackoverflow);
}
iosp++;
ref_assign_inline(iosp, iosp - 1);
@@ -1043,7 +1043,7 @@ x_dup: INCR(x_dup);
case plain_exec(tx_op_exch):
x_exch: INCR(x_exch);
if (iosp <= osbot)
- return_with_error_tx_op(e_stackunderflow);
+ return_with_error_tx_op(gs_error_stackunderflow);
ref_assign_inline(&token, iosp);
ref_assign_inline(iosp, iosp - 1);
ref_assign_inline(iosp - 1, &token);
@@ -1054,13 +1054,13 @@ x_if: INCR(x_if);
return_with_error_tx_op(check_proc_failed(iosp));
if (!r_has_type(iosp - 1, t_boolean))
return_with_error_tx_op((iosp <= osbot ?
- e_stackunderflow : e_typecheck));
+ gs_error_stackunderflow : gs_error_typecheck));
if (!iosp[-1].value.boolval) {
iosp -= 2;
next_either();
}
if (iesp >= estop)
- return_with_error_tx_op(e_execstackoverflow);
+ return_with_error_tx_op(gs_error_execstackoverflow);
store_state_either(iesp);
whichp = iosp;
iosp -= 2;
@@ -1073,9 +1073,9 @@ x_ifelse: INCR(x_ifelse);
return_with_error_tx_op(check_proc_failed(iosp - 1));
if (!r_has_type(iosp - 2, t_boolean))
return_with_error_tx_op((iosp < osbot + 2 ?
- e_stackunderflow : e_typecheck));
+ gs_error_stackunderflow : gs_error_typecheck));
if (iesp >= estop)
- return_with_error_tx_op(e_execstackoverflow);
+ return_with_error_tx_op(gs_error_execstackoverflow);
store_state_either(iesp);
whichp = (iosp[-2].value.boolval ? iosp - 1 : iosp);
iosp -= 3;
@@ -1103,7 +1103,7 @@ x_index: INCR(x_index);
case plain_exec(tx_op_pop):
x_pop: INCR(x_pop);
if (iosp < osbot)
- return_with_error_tx_op(e_stackunderflow);
+ return_with_error_tx_op(gs_error_stackunderflow);
iosp--;
next_either();
case plain_exec(tx_op_roll):
@@ -1132,7 +1132,7 @@ x_sub: INCR(x_sub);
store_state(iesp);
oppr: /* Record the stack depths in case of failure. */
if (iesp >= estop - 4)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
iesp += 5;
osp = iosp; /* ref_stack_count_inline needs this */
make_mark_estack(iesp - 4, es_other, oparray_cleanup);
@@ -1152,7 +1152,7 @@ x_sub: INCR(x_sub);
goto top;
}
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
++iesp;
/* Do a ref_assign, but also set iref. */
iesp->tas = pvalue->tas;
@@ -1203,7 +1203,7 @@ x_sub: INCR(x_sub);
case o_reschedule:
store_state(iesp);
goto res;
- case e_RemapColor:
+ case gs_error_Remap_Color:
oe_remap: store_state(iesp);
remap: if (iesp + 2 >= estop) {
esp = iesp;
@@ -1231,15 +1231,15 @@ remap: if (iesp + 2 >= estop) {
INCR(find_name);
if ((pvalue = dict_find_name_by_index_inline(nidx, htemp)) == 0)
- return_with_error_iref(e_undefined);
+ return_with_error_iref(gs_error_undefined);
}
/* Dispatch on the type of the value. */
/* Again, we have to over-populate the switch. */
switch (r_type_xe(pvalue)) {
cases_invalid():
- return_with_error_iref(e_Fatal);
+ return_with_error_iref(gs_error_Fatal);
cases_nox(): /* access errors */
- return_with_error_iref(e_invalidaccess);
+ return_with_error_iref(gs_error_invalidaccess);
cases_lit_1():
cases_lit_2():
cases_lit_3():
@@ -1310,7 +1310,7 @@ remap: if (iesp + 2 >= estop) {
case o_reschedule:
store_state(iesp);
goto res;
- case e_RemapColor:
+ case gs_error_Remap_Color:
goto oe_remap;
}
iosp = osp;
@@ -1361,13 +1361,13 @@ remap: if (iesp + 2 >= estop) {
store_state(iesp);
/* Push the file on the e-stack */
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
esfile_set_cache(++iesp);
ref_assign_inline(iesp, IREF);
SET_IREF(&token);
icount = 0;
goto top;
- case e_undefined: /* //name undefined */
+ case gs_error_undefined: /* //name undefined */
gs_scanner_error_object(i_ctx_p, &sstate, &token);
return_with_error(code, &token);
case scan_EOF: /* end of file */
@@ -1379,7 +1379,7 @@ remap: if (iesp + 2 >= estop) {
store_state(iesp);
/* Push the file on the e-stack */
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
esfile_set_cache(++iesp);
ref_assign_inline(iesp, IREF);
pvalue = &token;
@@ -1391,7 +1391,7 @@ remap: if (iesp + 2 >= estop) {
ref_assign_inline(&token, IREF);
/* Push the file on the e-stack */
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
++iesp;
ref_assign_inline(iesp, &token);
esp = iesp;
@@ -1422,7 +1422,7 @@ remap: if (iesp + 2 >= estop) {
store_state(iesp);
ref_assign_inline(&file_token, IREF);
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
++iesp;
ref_assign_inline(iesp, &file_token);
esp = iesp;
@@ -1461,7 +1461,7 @@ remap: if (iesp + 2 >= estop) {
if (size) {
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
++iesp;
iesp->tas.type_attrs = IREF->tas.type_attrs;
iesp->value.const_bytes = sbufptr(&ss);
@@ -1479,7 +1479,7 @@ remap: if (iesp + 2 >= estop) {
case scan_EOF: /* end of string */
goto bot;
case scan_Refill: /* error */
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
default: /* error */
ref_assign_inline(&token, IREF);
gs_scanner_error_object(i_ctx_p, &sstate, &token);
@@ -1576,7 +1576,7 @@ remap: if (iesp + 2 >= estop) {
case o_reschedule:
store_state_short(iesp);
goto res;
- case e_RemapColor:
+ case gs_error_Remap_Color:
store_state_short(iesp);
goto remap;
}
@@ -1615,7 +1615,7 @@ remap: if (iesp + 2 >= estop) {
INCR(p_find_name);
if ((pvalue = dict_find_name_by_index_inline(nidx, htemp)) == 0) {
names_index_ref(int_nt, nidx, &token);
- return_with_error(e_undefined, &token);
+ return_with_error(gs_error_undefined, &token);
}
}
if (r_has_masked_attrs(pvalue, a_execute, a_execute + a_executable)) { /* Literal, push it. */
@@ -1699,7 +1699,7 @@ res:
sst: /* Time-slice, but push the current object first. */
store_state(iesp);
if (iesp >= estop)
- return_with_error_iref(e_execstackoverflow);
+ return_with_error_iref(gs_error_execstackoverflow);
iesp++;
ref_assign_inline(iesp, iref);
#endif /****** ****** ***** */
@@ -1743,13 +1743,13 @@ res:
ierror.obj = &ierror.full;
}
error_exit:
- if (ERROR_IS_INTERRUPT(ierror.code)) { /* We must push the current object being interpreted */
+ if (GS_ERROR_IS_INTERRUPT(ierror.code)) { /* We must push the current object being interpreted */
/* back on the e-stack so it will be re-executed. */
/* Currently, this is always an executable operator, */
/* but it might be something else someday if we check */
/* for interrupts in the interpreter loop itself. */
if (iesp >= estop)
- code = e_execstackoverflow;
+ code = gs_error_execstackoverflow;
else {
iesp++;
ref_assign_inline(iesp, IREF);
@@ -1759,9 +1759,9 @@ res:
osp = iosp;
ref_assign_inline(perror_object, ierror.obj);
#ifdef DEBUG
- if (ierror.code == e_InterpreterExit) {
+ if (ierror.code == gs_error_InterpreterExit) {
/* Do not call gs_log_error to reduce the noise. */
- return e_InterpreterExit;
+ return gs_error_InterpreterExit;
}
#endif
return gs_log_error(ierror.code, __FILE__, ierror.line);
@@ -1921,7 +1921,7 @@ zsetstackprotect(i_ctx_t *i_ctx_p)
check_type(*op, t_boolean);
if (ep == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ep->value.opproc =
(op->value.boolval ? oparray_cleanup : oparray_no_cleanup);
pop(1);
@@ -1937,7 +1937,7 @@ zcurrentstackprotect(i_ctx_t *i_ctx_p)
ref *ep = oparray_find(i_ctx_p);
if (ep == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
push(1);
make_bool(op, ep->value.opproc == oparray_cleanup);
return 0;
diff --git a/gs/psi/iparam.c b/gs/psi/iparam.c
index 559b9b84b..4e63b6d25 100644
--- a/gs/psi/iparam.c
+++ b/gs/psi/iparam.c
@@ -42,7 +42,7 @@ ref_param_key(const iparam_list * plist, gs_param_name pkey, ref * pkref)
long key;
if (sscanf(pkey, "%ld", &key) != 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_int(pkref, key);
return 0;
} else
@@ -70,12 +70,12 @@ ref_to_key(const ref * pref, gs_param_key_t * key, iparam_list *plist)
/* GC will take care of freeing this: */
buf = gs_alloc_string(plist->memory, len, "ref_to_key");
if (!buf)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
key->data = buf;
key->size = len;
key->persistent = true;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return 0;
}
@@ -168,7 +168,7 @@ ref_param_begin_write_collection(gs_param_list * plist, gs_param_name pkey,
int code;
if (dlist == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (coll_type != gs_param_collection_array) {
ref dref;
@@ -261,7 +261,7 @@ ref_param_write_typed(gs_param_list * plist, gs_param_name pkey,
&pvalue->value.d,
(gs_param_collection_type_t)(pvalue->type - gs_param_type_dict));
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (code < 0)
return code;
@@ -314,7 +314,7 @@ ref_param_write_string_value(ref * pref, const gs_param_string * pvalue,
"ref_param_write_string");
if (pstr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(pstr, pdata, n);
make_string(pref, a_readonly | imemory_space(imem), n, pstr);
}
@@ -473,7 +473,7 @@ array_new_indexed_param_write(iparam_list * iplist, const ref * pkey,
ref *eltp;
if (!r_has_type(pkey, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_int_ltu(*pkey, r_size(arr));
store_check_dest(arr, pvalue);
eltp = arr->value.refs + pkey->value.intval;
@@ -531,10 +531,10 @@ static int ref_param_read_array(iparam_list *, gs_param_name,
gs_note_error(*(loc).presult = code)
#define iparam_check_type(loc, typ)\
if ( !r_has_type((loc).pvalue, typ) )\
- return iparam_note_error(loc, e_typecheck)
+ return iparam_note_error(loc, gs_error_typecheck)
#define iparam_check_read(loc)\
if ( !r_has_attr((loc).pvalue, a_read) )\
- return iparam_note_error(loc, e_invalidaccess)
+ return iparam_note_error(loc, gs_error_invalidaccess)
static int
ref_param_read_int_array(gs_param_list * plist, gs_param_name pkey,
@@ -554,13 +554,13 @@ ref_param_read_int_array(gs_param_list * plist, gs_param_name pkey,
"ref_param_read_int_array");
if (piv == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
for (i = 0; i < size; i++) {
ref elt;
array_get(plist->memory, loc.pvalue, i, &elt);
if (!r_has_type(&elt, t_integer)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
break;
}
piv[i] = (int)elt.value.intval;
@@ -593,7 +593,7 @@ ref_param_read_float_array(gs_param_list * plist, gs_param_name pkey,
"ref_param_read_float_array");
if (pfv == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
aref = *loc.pvalue;
loc.pvalue = &elt;
for (i = 0; code >= 0 && i < size; i++) {
@@ -628,7 +628,7 @@ ref_param_read_string_array(gs_param_list * plist, gs_param_name pkey,
gs_alloc_byte_array(plist->memory, size, sizeof(gs_param_string),
"ref_param_read_string_array");
if (psv == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
aref = *loc.pvalue;
if (r_has_type(&aref, t_array)) {
for (i = 0; code >= 0 && i < size; i++) {
@@ -670,7 +670,7 @@ ref_param_begin_read_collection(gs_param_list * plist, gs_param_name pkey,
gs_alloc_bytes(plist->memory, size_of(dict_param_list),
"ref_param_begin_read_collection");
if (dlist == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (r_has_type(loc.pvalue, t_dictionary)) {
code = dict_param_list_read(dlist, loc.pvalue, NULL, false,
iplist->ref_memory);
@@ -683,7 +683,7 @@ ref_param_begin_read_collection(gs_param_list * plist, gs_param_name pkey,
if (code >= 0)
pvalue->size = r_size(loc.pvalue);
} else
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
if (code < 0) {
gs_free_object(plist->memory, dlist, "ref_param_begin_write_collection");
return iparam_note_error(loc, code);
@@ -734,7 +734,7 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey,
pvalue->type = gs_param_type_int_array;
code = ref_param_read_int_array(plist, pkey,
&pvalue->value.ia);
- if (code != e_typecheck)
+ if (code != gs_error_typecheck)
return code;
/* This might be a float array. Fall through. */
*loc.presult = 0; /* reset error */
@@ -753,7 +753,7 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey,
default:
break;
}
- return gs_note_error(e_typecheck);
+ return gs_note_error(gs_error_typecheck);
case t_boolean:
pvalue->type = gs_param_type_bool;
pvalue->value.b = loc.pvalue->value.boolval;
@@ -801,7 +801,7 @@ ref_param_read_typed(gs_param_list * plist, gs_param_name pkey,
default:
break;
}
- return gs_note_error(e_typecheck);
+ return gs_note_error(gs_error_typecheck);
}
static int
@@ -829,7 +829,7 @@ ref_param_read_signal_error(gs_param_list * plist, gs_param_name pkey, int code)
case gs_param_policy_ignore:
return 0;
case gs_param_policy_consult_user:
- return_error(e_configurationerror);
+ return_error(gs_error_configurationerror);
default:
return code;
}
@@ -846,7 +846,7 @@ ref_param_read_commit(gs_param_list * plist)
/* Check to make sure that all parameters were actually read. */
for (i = 0; i < iplist->count; ++i)
if (iplist->results[i] == 0)
- iplist->results[i] = ecode = gs_note_error(e_undefined);
+ iplist->results[i] = ecode = gs_note_error(gs_error_undefined);
return ecode;
}
static int
@@ -889,13 +889,13 @@ ref_param_read_string_value(gs_memory_t *mem, const iparam_loc * ploc, gs_param_
simple call to .putdeviceparams, they are identical. */
iparam_check_read(*ploc);
if (gs_object_type(mem, pref->value.pstruct) != &st_bytes)
- return iparam_note_error(*ploc, e_typecheck);
+ return iparam_note_error(*ploc, gs_error_typecheck);
pvalue->data = r_ptr(pref, byte);
pvalue->size = gs_object_size(mem, pref->value.pstruct);
pvalue->persistent = false;
break;
default:
- return iparam_note_error(*ploc, e_typecheck);
+ return iparam_note_error(*ploc, gs_error_typecheck);
}
return 0;
}
@@ -909,7 +909,7 @@ ref_param_read_array(iparam_list * plist, gs_param_name pkey, iparam_loc * ploc)
if (code != 0)
return code;
if (!r_is_array(ploc->pvalue))
- return iparam_note_error(*ploc, e_typecheck);
+ return iparam_note_error(*ploc, gs_error_typecheck);
iparam_check_read(*ploc);
return 0;
}
@@ -961,7 +961,7 @@ ref_param_read_init(iparam_list * plist, uint count, const ref * ppolicies,
"ref_param_read_init");
if (plist->results == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memset(plist->results, 0, count * sizeof(int));
plist->int_keys = false;
@@ -1050,7 +1050,7 @@ array_param_list_read(array_param_list * plist, ref * bot, uint count,
iparam_list *const iplist = (iparam_list *) plist;
if (count & 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
plist->u.r.read = array_param_read;
plist->enumerate = array_param_enumerate;
plist->bot = bot;
@@ -1090,10 +1090,10 @@ stack_param_list_read(stack_param_list * plist, ref_stack_t * pstack,
uint count = ref_stack_counttomark(pstack);
if (count == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
count -= skip + 1;
if (count & 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
plist->u.r.read = stack_param_read;
plist->enumerate = stack_param_enumerate;
plist->pstack = pstack;
diff --git a/gs/psi/iparam.h b/gs/psi/iparam.h
index 5458cffd9..7ec332983 100644
--- a/gs/psi/iparam.h
+++ b/gs/psi/iparam.h
@@ -88,7 +88,7 @@ typedef struct stack_param_list_s {
* The 3rd (const ref *) parameter is the policies dictionary when reading,
* or the key selection dictionary when writing; it may be NULL in either case.
* If the bool parameter is true, if there are any unqueried parameters,
- * the commit procedure will return an e_undefined error.
+ * the commit procedure will return an gs_error_undefined error.
*/
int dict_param_list_read(dict_param_list *, const ref * /*t_dictionary */ ,
const ref *, bool, gs_ref_memory_t *);
diff --git a/gs/psi/iplugin.c b/gs/psi/iplugin.c
index 700ec5750..bc3c209a6 100644
--- a/gs/psi/iplugin.c
+++ b/gs/psi/iplugin.c
@@ -63,7 +63,7 @@ int i_plugin_init(i_ctx_t *i_ctx_p)
return code;
h = (i_plugin_holder *)gs_alloc_bytes_immovable(mem_raw, sizeof(i_plugin_holder), "plugin_holder");
if (h == 0)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
h->I = instance;
h->next = i_ctx_p->plugin_list;
i_ctx_p->plugin_list = h;
diff --git a/gs/psi/ireclaim.c b/gs/psi/ireclaim.c
index e883505ce..d72801636 100644
--- a/gs/psi/ireclaim.c
+++ b/gs/psi/ireclaim.c
@@ -90,7 +90,7 @@ ireclaim(gs_dual_memory_t * dmem, int space)
}
if (allocated >= mem->gc_status.max_vm) {
/* We can't satisfy this request within max_vm. */
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
}
return 0;
diff --git a/gs/psi/isave.c b/gs/psi/isave.c
index e02c7573a..701db620f 100644
--- a/gs/psi/isave.c
+++ b/gs/psi/isave.c
@@ -525,7 +525,7 @@ alloc_save_change_alloc(gs_ref_memory_t *mem, client_name_t cname, alloc_change_
cp = gs_alloc_struct((gs_memory_t *)mem, alloc_change_t,
&st_alloc_change, "alloc_save_change");
if (cp == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
cp->next = mem->changes;
cp->where = 0;
cp->offset = AC_OFFSET_ALLOCATED;
@@ -1195,7 +1195,7 @@ mark_allocated(void *obj, bool to_new, uint *psize)
if (pre->o_type != &st_refs) {
/* Must not happen. */
if_debug0('u', "Wrong object type when expected a ref.\n");
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
/* We know that every block of refs ends with */
/* a full-size ref, so we only need the end check */
diff --git a/gs/psi/iscan.c b/gs/psi/iscan.c
index 406137690..2cb18aa94 100644
--- a/gs/psi/iscan.c
+++ b/gs/psi/iscan.c
@@ -88,7 +88,7 @@ dynamic_free(da_ptr pda)
}
/* Resize a dynamic string. */
-/* If the allocation fails, return e_VMerror; otherwise, return 0. */
+/* If the allocation fails, return gs_error_VMerror; otherwise, return 0. */
static int
dynamic_resize(da_ptr pda, uint new_size)
{
@@ -101,11 +101,11 @@ dynamic_resize(da_ptr pda, uint new_size)
base = gs_resize_string(mem, pda->base, old_size,
new_size, "scanner");
if (base == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
} else { /* switching from static to dynamic */
base = gs_alloc_string(mem, new_size, "scanner");
if (base == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(base, pda->base, min(old_size, new_size));
pda->is_dynamic = true;
}
@@ -130,7 +130,7 @@ dynamic_grow(da_ptr pda, byte * next, uint max_size)
pda->next = next;
if (old_size >= max_size)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
while ((code = dynamic_resize(pda, new_size)) < 0 &&
new_size > old_size
) { /* Try trimming down the requested new size. */
@@ -297,7 +297,7 @@ gs_scan_handle_refill(i_ctx_t *i_ctx_p, scanner_state * sstate,
if (s->end_status == EOFC) {
/* More data needed, but none available, so this is a syntax error. */
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
status = s_process_read_buf(s);
if (sbufavailable(s) > avail)
@@ -310,7 +310,7 @@ gs_scan_handle_refill(i_ctx_t *i_ctx_p, scanner_state * sstate,
/* Let the caller find this out. */
return 0;
case ERRC:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
case INTC:
case CALLC:
{
@@ -322,7 +322,7 @@ gs_scan_handle_refill(i_ctx_t *i_ctx_p, scanner_state * sstate,
ialloc_struct(scanner_state_dynamic, &st_scanner_state_dynamic,
"gs_scan_handle_refill");
if (pstate == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
((scanner_state_dynamic *)pstate)->mem = imemory;
*pstate = *sstate;
} else
@@ -393,7 +393,7 @@ scan_comment(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate,
byte *cstr = ialloc_string(len, "scan_comment");
if (cstr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(cstr, base, len);
make_string(pref, a_all | icurrent_space, len, cstr);
}
@@ -413,7 +413,7 @@ gs_scan_string_token_options(i_ctx_t *i_ctx_p, ref * pstr, ref * pref,
int code;
if (!r_has_attr(pstr, a_read))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
s_init(s, NULL);
sread_string(s, pstr->value.bytes, r_size(pstr));
gs_scanner_init_stream_options(&state, s, options | SCAN_FROM_STRING);
@@ -432,7 +432,7 @@ gs_scan_string_token_options(i_ctx_t *i_ctx_p, ref * pstr, ref * pref,
}
break;
case scan_Refill: /* error */
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
case scan_EOF:
break;
}
@@ -446,7 +446,7 @@ gs_scan_string_token_options(i_ctx_t *i_ctx_p, ref * pstr, ref * pref,
* >0 for special situations (see iscan.h).
* If the token required a terminating character (i.e., was a name or
* number) and the next character was whitespace, read and discard
- * that character. Note that the state is relevant for e_VMerror
+ * that character. Note that the state is relevant for gs_error_VMerror
* as well as for scan_Refill.
*/
int
@@ -548,7 +548,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case scanning_string:
goto cont_string;
default:
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
}
/* Fetch any state variables that are relevant even if */
@@ -624,7 +624,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
scan_type = scanning_string;
goto suspend;
} else
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
}
break;
}
@@ -633,7 +633,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case 1:
if (!check_only) {
retcode = dynamic_grow(&da, da.next, max_string_size);
- if (retcode == e_VMerror) {
+ if (retcode == gs_error_VMerror) {
scan_type = scanning_string;
goto suspend;
} else if (retcode < 0)
@@ -647,7 +647,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
switch (status) {
default:
/*case ERRC: */
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
case INTC:
case CALLC:
scan_type = scanning_string;
@@ -692,10 +692,10 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
}
/* falls through */
case ')':
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
case '}':
if (pstack == 0)
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
osp--;
{
uint size = ref_stack_count_inline(&o_stack) - pstack;
@@ -707,7 +707,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
ref_stack_index(&o_stack, size)->value.intval),
size + pstack);
if (size > max_array_size)
- sreturn(e_limitcheck);
+ sreturn(gs_error_limitcheck);
myref = (pstack == pdepth ? pref : &arr);
if (check_only) {
make_empty_array(myref, 0);
@@ -853,7 +853,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
*/
goto end_comment;
default:
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
}
if (daptr < comment_line + max_comment_line)
*daptr++ = c;
@@ -875,12 +875,12 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
if (pstack != 0) {
if (check_only)
goto pause;
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
}
retcode = scan_EOF;
break;
case ERRC:
- sreturn(e_ioerror);
+ sreturn(gs_error_ioerror);
/* Check for a Level 2 funny name (<< or >>). */
/* c is '<' or '>'. We already did an ensure2. */
@@ -895,7 +895,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
}
scan_putback();
}
- sreturn(e_syntaxerror);
+ sreturn(gs_error_syntaxerror);
/* Handle separately the names that might be a number. */
case '0':
@@ -1069,7 +1069,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
retcode = dynamic_grow(&da, da.limit, name_max_string);
if (retcode < 0) {
dynamic_save(&da);
- if (retcode != e_VMerror)
+ if (retcode != gs_error_VMerror)
sreturn(retcode);
scan_type = scanning_name;
goto pause_ret;
@@ -1084,7 +1084,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
name_max_string);
if (retcode < 0) {
dynamic_save(&da);
- if (retcode != e_VMerror)
+ if (retcode != gs_error_VMerror)
sreturn(retcode);
scan_putback();
scan_type = scanning_name;
@@ -1121,7 +1121,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case CALLC:
goto pause_name;
case ERRC:
- sreturn(e_ioerror);
+ sreturn(gs_error_ioerror);
case EOFC:
break;
}
@@ -1135,11 +1135,11 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
if (retcode == 1) {
ref_mark_new(myref);
retcode = 0;
- } else if (retcode != e_syntaxerror) {
+ } else if (retcode != gs_error_syntaxerror) {
dynamic_free(&da);
if (name_type == 2)
- sreturn(e_syntaxerror);
- break; /* might be e_limitcheck */
+ sreturn(gs_error_syntaxerror);
+ break; /* might be gs_error_limitcheck */
}
}
if (da.is_dynamic) { /* We've already allocated the string on the heap. */
@@ -1164,7 +1164,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
}
/* Done scanning. Check for preceding /'s. */
if (retcode < 0) {
- if (retcode != e_VMerror)
+ if (retcode != gs_error_VMerror)
sreturn(retcode);
if (!da.is_dynamic) {
da.next = daptr;
@@ -1190,12 +1190,12 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
ref_assign(&sstate.s_error.object, myref);
r_set_attrs(&sstate.s_error.object,
a_executable); /* Adobe compatibility */
- sreturn(e_undefined);
+ sreturn(gs_error_undefined);
}
if (pstack != 0 &&
r_space(pvalue) > ialloc_space(idmemory)
)
- sreturn(e_invalidaccess);
+ sreturn(gs_error_invalidaccess);
ref_assign_new(myref, pvalue);
}
}
@@ -1204,7 +1204,7 @@ gs_scan_token(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
scan_end_inline();
pstate->s_error = sstate.s_error;
if (pstack != 0) {
- if (retcode == e_undefined)
+ if (retcode == gs_error_undefined)
*pref = *osp; /* return undefined name as error token */
ref_stack_pop(&o_stack,
ref_stack_count(&o_stack) - (pdepth - 1));
diff --git a/gs/psi/iscanbin.c b/gs/psi/iscanbin.c
index 53765f24d..aefb9abe0 100644
--- a/gs/psi/iscanbin.c
+++ b/gs/psi/iscanbin.c
@@ -172,7 +172,7 @@ scan_binary_token(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
code = scan_bin_scalar(i_ctx_p, pref, pstate);
}
if (code == scan_Refill && s->end_status == EOFC)
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
if (code < 0 && pstate->s_error.string[0] == 0)
snprintf(pstate->s_error.string, sizeof(pstate->s_error.string),
"binary token, type=%d", btype);
@@ -208,7 +208,7 @@ scan_bos(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
pbs->lsize = lsize = sdecodeint32(p + 4, num_format);
if ((size = lsize) != lsize) {
scan_bos_error(pstate, "bin obj seq length too large");
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
hsize = 8;
} else {
@@ -220,7 +220,7 @@ scan_bos(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
}
if (size < hsize || (size - hsize) >> 3 < top_size) {
scan_bos_error(pstate, "sequence too short");
- return_error(e_syntaxerror); /* size too small */
+ return_error(gs_error_syntaxerror); /* size too small */
}
{ /* Preliminary syntax check to avoid potentialy large
* memory allocation on junk data. Bug 688833
@@ -233,11 +233,11 @@ scan_bos(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
int c = q[-1] & 0x7f;
if (c > 10 && c != BS_TYPE_DICTIONARY) {
scan_bos_error(pstate, "invalid object type");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
if (*q != 0) {
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
}
}
@@ -305,7 +305,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
case BT_FIXED:
num_format = p[1];
if (!num_is_valid(num_format))
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
wanted = 1 + encoded_number_bytes(num_format);
if (rlimit - p < wanted) {
s_end_inline(s, p - 1, rlimit);
@@ -329,7 +329,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
r_set_type(pref, code);
break;
case t_null:
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
default:
return code;
}
@@ -338,7 +338,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
case BT_BOOLEAN:
arg = p[1];
if (arg & ~1)
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
make_bool(pref, arg);
s_end_inline(s, p + 1, rlimit);
return 0;
@@ -365,7 +365,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
byte *str = ialloc_string(arg, "string token");
if (str == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
s_end_inline(s, p, rlimit);
pstate->s_da.base = pstate->s_da.next = str;
pstate->s_da.limit = str + arg;
@@ -405,7 +405,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
case BT_NUM_ARRAY:
num_format = p[1];
if (!num_is_valid(num_format))
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
arg = sdecodeushort(p + 2, num_format);
code = ialloc_ref_array(&pbs->bin_array, a_all, arg,
"number array token");
@@ -424,7 +424,7 @@ scan_bin_scalar(i_ctx_t *i_ctx_p, ref *pref, scanner_state *pstate)
}
return code;
}
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
/* Get a system or user name. */
@@ -433,14 +433,14 @@ scan_bin_get_name(scanner_state *pstate, const gs_memory_t *mem,
const ref *pnames /*t_array*/, int index, ref *pref,
const char *usstring)
{
- /* Convert all errors to e_undefined to match Adobe. */
+ /* Convert all errors to gs_error_undefined to match Adobe. */
if (pnames == 0 || array_get(mem, pnames, (long)index, pref) < 0 ||
!r_has_type(pref, t_name)) {
snprintf(pstate->s_error.string,
sizeof(pstate->s_error.string),
"%s%d", usstring, index);
pstate->s_error.is_name = true;
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
return 0;
}
@@ -499,7 +499,7 @@ scan_bin_num_array_continue(i_ctx_t *i_ctx_p, ref * pref,
break;
case t_null:
scan_bos_error(pstate, "bad number format");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
default:
return code;
}
@@ -548,7 +548,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
}
if (p[2] != 0) { /* reserved, must be 0 */
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
attrs = (p[1] & 128 ? a_executable : 0);
/*
@@ -561,14 +561,14 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case BS_TYPE_NULL:
if (osize | value) { /* unused */
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
make_null(op);
break;
case BS_TYPE_INTEGER:
if (osize) { /* unused */
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
make_int(op, value);
break;
@@ -578,7 +578,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
if (osize != 0) { /* fixed-point number */
if (osize > 31) {
scan_bos_error(pstate, "invalid number format");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
/* ldexp requires a signed 2nd argument.... */
vreal = (float)ldexp((double)value, -(int)osize);
@@ -595,7 +595,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
case BS_TYPE_BOOLEAN:
if (osize) { /* unused */
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
make_bool(op, value != 0);
break;
@@ -612,7 +612,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
value + osize > size
) {
scan_bos_error(pstate, "invalid string offset");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
if (value < min_string_index) {
/* We have to (re)allocate the strings. */
@@ -626,7 +626,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
sbase = ialloc_string(str_size,
"bos strings");
if (sbase == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
pstate->s_da.is_dynamic = true;
pstate->s_da.base = pstate->s_da.next = sbase;
pstate->s_da.limit = sbase + str_size;
@@ -666,7 +666,7 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
value & (SIZEOF_BIN_SEQ_OBJ - 1)
) {
scan_bos_error(pstate, "bad array offset");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
{
uint aindex = value / SIZEOF_BIN_SEQ_OBJ;
@@ -680,19 +680,19 @@ scan_bos_continue(i_ctx_t *i_ctx_p, ref * pref, scanner_state * pstate)
break;
case BS_TYPE_DICTIONARY: /* EXTENSION */
if ((osize & 1) != 0 && osize != 1)
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
atype = t_mixedarray; /* mark as dictionary */
goto arr;
case BS_TYPE_MARK:
if (osize | value) { /* unused */
scan_bos_error(pstate, "non-zero unused field");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
make_mark(op);
break;
default:
scan_bos_error(pstate, "invalid object type");
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
}
s_end_inline(s, p, rlimit);
@@ -774,7 +774,7 @@ scan_bos_string_continue(i_ctx_t *i_ctx_p, ref * pref,
ref *defp = dict_find_name(op);
if (defp == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
store_check_space(space, defp);
ref_assign(op, defp);
}
@@ -836,7 +836,7 @@ scan_bos_string_continue(i_ctx_t *i_ctx_p, ref * pref,
ref rdict;
if (r_has_type(piref, t_mixedarray)) /* ref to indirect */
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
ref_assign(&rdict, piref);
r_copy_attrs(&rdict, a_executable, op);
ref_assign(op, &rdict);
@@ -879,7 +879,7 @@ encode_binary_token(i_ctx_t *i_ctx_p, const ref *obj, ps_int *ref_offset,
type = BS_TYPE_REAL;
if (sizeof(obj->value.realval) != sizeof(int)) {
/* The PLRM allocates exactly 4 bytes for reals. */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
value = *(const ps_int *)&obj->value.realval;
#if !(ARCH_FLOATS_ARE_IEEE && BYTE_SWAP_IEEE_NATIVE_REALS)
@@ -917,7 +917,7 @@ nos:
obj = &nstr;
goto nos;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
{
byte s0 = (byte) size, s1 = (byte) (size >> 8);
diff --git a/gs/psi/iscanbin.h b/gs/psi/iscanbin.h
index ea20a2dee..827a6de7e 100644
--- a/gs/psi/iscanbin.h
+++ b/gs/psi/iscanbin.h
@@ -21,7 +21,7 @@
/*
* Scan a binary token. The main scanner calls this iff recognize_btokens()
- * is true. Return e_unregistered if Level 2 features are not included.
+ * is true. Return gs_error_unregistered if Level 2 features are not included.
* Return 0 or scan_BOS on success, <0 on failure.
*
* This header file exists only because there are two implementations of
diff --git a/gs/psi/iscannum.c b/gs/psi/iscannum.c
index 2cf00f193..0b52dcb27 100644
--- a/gs/psi/iscannum.c
+++ b/gs/psi/iscannum.c
@@ -67,14 +67,14 @@ scan_number(const byte * str, const byte * end, int sign,
#define WOULD_OVERFLOW(val, d, maxv)\
(val >= maxv / 10 && (val > maxv / 10 || d > (int64_t)(maxv % 10)))
- GET_NEXT(c, sp, return_error(e_syntaxerror));
+ GET_NEXT(c, sp, return_error(gs_error_syntaxerror));
if (!IS_DIGIT(d, c)) {
if (c != '.')
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
/* Might be a number starting with '.'. */
- GET_NEXT(c, sp, return_error(e_syntaxerror));
+ GET_NEXT(c, sp, return_error(gs_error_syntaxerror));
if (!IS_DIGIT(d, c))
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
ival = 0;
goto i2r;
}
@@ -153,7 +153,7 @@ scan_number(const byte * str, const byte * end, int sign,
ps_int uval = 0, imax;
if (sign || radix < min_radix || radix > max_radix)
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
/* Avoid multiplies for power-of-2 radix. */
if (!(radix & (radix - 1))) {
int shift;
@@ -175,7 +175,7 @@ scan_number(const byte * str, const byte * end, int sign,
shift = 5, imax = MAX_PS_UINT >> 5;
break;
default: /* can't happen */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
for (;; uval = (uval << shift) + d) {
GET_NEXT(c, sp, break);
@@ -186,7 +186,7 @@ scan_number(const byte * str, const byte * end, int sign,
break;
}
if (uval > imax)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
} else {
ps_int irem = MAX_PS_UINT % radix;
@@ -203,7 +203,7 @@ scan_number(const byte * str, const byte * end, int sign,
if (uval >= imax &&
(uval > imax || d > irem)
)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
}
if (scanner_options & SCAN_CPSI_MODE) {
@@ -253,7 +253,7 @@ l2d:
exp10 = 0;
goto fs;
case '#':
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
}
/* We saw a '.' while accumulating an integer in ival. */
@@ -314,16 +314,16 @@ fe:
int esign = 0;
int iexp;
- GET_NEXT(c, sp, return_error(e_syntaxerror));
+ GET_NEXT(c, sp, return_error(gs_error_syntaxerror));
switch (c) {
case '-':
esign = 1;
case '+':
- GET_NEXT(c, sp, return_error(e_syntaxerror));
+ GET_NEXT(c, sp, return_error(gs_error_syntaxerror));
}
/* Scan the exponent. We limit it arbitrarily to 999. */
if (!IS_DIGIT(d, c))
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
iexp = d;
for (;; iexp = iexp * 10 + d) {
GET_NEXT(c, sp, break);
@@ -333,7 +333,7 @@ fe:
break;
}
if (iexp > 99)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
if (esign)
exp10 -= iexp;
@@ -368,10 +368,10 @@ fe:
*/
if (dval >= 0) {
if (dval > MAX_FLOAT)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
} else {
if (dval < -MAX_FLOAT)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
rret:
make_real(pref, dval);
diff --git a/gs/psi/istack.c b/gs/psi/istack.c
index c3b1a3890..c0fac5ed8 100644
--- a/gs/psi/istack.c
+++ b/gs/psi/istack.c
@@ -171,7 +171,7 @@ ref_stack_set_margin(ref_stack_t *pstack, uint margin)
refset_null_new(pstack->top + 1, pstack->margin - margin, 0);
} else {
if (margin > data_size >> 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (pstack->top - pstack->p < margin) {
uint used = pstack->p + 1 - pstack->bot;
uint keep = data_size - margin;
@@ -244,7 +244,7 @@ ref_stack_counttomark(const ref_stack_t *pstack)
/*
* Do the store check for storing 'count' elements of a stack, starting
- * 'skip' elements below the top, into an array. Return 0 or e_invalidaccess.
+ * 'skip' elements below the top, into an array. Return 0 or gs_error_invalidaccess.
*/
int
ref_stack_store_check(const ref_stack_t *pstack, ref *parray, uint count,
@@ -286,8 +286,8 @@ ref_stack_store_check(const ref_stack_t *pstack, ref *parray, uint count,
/*
* Store the top 'count' elements of a stack, starting 'skip' elements below
* the top, into an array, with or without store/undo checking. age=-1 for
- * no check, 0 for old, 1 for new. May return e_rangecheck or
- * e_invalidaccess.
+ * no check, 0 for old, 1 for new. May return gs_error_rangecheck or
+ * gs_error_invalidaccess.
*/
#undef idmemory /****** NOTA BENE ******/
int
@@ -300,7 +300,7 @@ ref_stack_store(const ref_stack_t *pstack, ref *parray, uint count,
ref_stack_enum_t rsenum;
if (count > ref_stack_count(pstack) || count > r_size(parray))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (check) {
int code = ref_stack_store_check(pstack, parray, count, skip);
@@ -408,7 +408,7 @@ ref_stack_pop_block(ref_stack_t *pstack)
uint left;
if (moved == 0)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
memmove(bot + moved, bot, count * sizeof(ref));
left = used - moved;
memcpy(bot, body + left, moved * sizeof(ref));
@@ -437,7 +437,7 @@ ref_stack_pop_block(ref_stack_t *pstack)
/*
* Extend a stack to recover from an overflow condition.
- * May return overflow_error or e_VMerror.
+ * May return overflow_error or gs_error_VMerror.
*/
int
ref_stack_extend(ref_stack_t *pstack, uint request)
@@ -459,7 +459,7 @@ ref_stack_extend(ref_stack_t *pstack, uint request)
* Push N empty slots onto a stack. These slots are not initialized:
* the caller must immediately fill them. May return overflow_error
* (if max_stack would be exceeded, or the stack has no allocator)
- * or e_VMerror.
+ * or gs_error_VMerror.
*/
int
ref_stack_push(ref_stack_t *pstack, uint count)
@@ -492,7 +492,7 @@ ref_stack_push(ref_stack_t *pstack, uint count)
* Push a block onto the stack, specifying how many elements of the current
* top block should remain in the top block and also how many elements we
* are trying to add. Requires keep <= count. May return overflow_error or
- * e_VMerror.
+ * gs_error_VMerror.
*/
static int
ref_stack_push_block(ref_stack_t *pstack, uint keep, uint add)
@@ -507,7 +507,7 @@ ref_stack_push_block(ref_stack_t *pstack, uint keep, uint add)
int code;
if (keep > count)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
/* Check for overflowing the maximum size, */
/* or expansion not allowed. */
if (pstack->extension_used + (pstack->top - pstack->bot) + add >=
diff --git a/gs/psi/istack.h b/gs/psi/istack.h
index abe93df61..909b9d7c1 100644
--- a/gs/psi/istack.h
+++ b/gs/psi/istack.h
@@ -110,7 +110,7 @@ uint ref_stack_counttomark(const ref_stack_t *pstack);
/*
* Do the store check for storing 'count' elements of a stack, starting
- * 'skip' elements below the top, into an array. Return 0 or e_invalidaccess.
+ * 'skip' elements below the top, into an array. Return 0 or gs_error_invalidaccess.
*/
int ref_stack_store_check(const ref_stack_t *pstack, ref *parray,
uint count, uint skip);
@@ -118,8 +118,8 @@ int ref_stack_store_check(const ref_stack_t *pstack, ref *parray,
/*
* Store the top 'count' elements of a stack, starting 'skip' elements below
* the top, into an array, with or without store/undo checking. age=-1 for
- * no check, 0 for old, 1 for new. May return e_rangecheck or
- * e_invalidaccess.
+ * no check, 0 for old, 1 for new. May return gs_error_rangecheck or
+ * gs_error_invalidaccess.
*/
#ifndef gs_dual_memory_DEFINED
# define gs_dual_memory_DEFINED
@@ -145,7 +145,7 @@ int ref_stack_pop_block(ref_stack_t *pstack);
/*
* Extend a stack to recover from an overflow condition.
* Uses the requested value to decide what to do.
- * May return overflow_error or e_VMerror.
+ * May return overflow_error or gs_error_VMerror.
*/
int ref_stack_extend(ref_stack_t *pstack, uint request);
@@ -153,7 +153,7 @@ int ref_stack_extend(ref_stack_t *pstack, uint request);
* Push N empty slots onto a stack. These slots are not initialized:
* the caller must immediately fill them. May return overflow_error
* (if max_stack would be exceeded, or the stack has no allocator)
- * or e_VMerror.
+ * or gs_error_VMerror.
*/
int ref_stack_push(ref_stack_t *pstack, uint count);
diff --git a/gs/psi/iutil.c b/gs/psi/iutil.c
index a982e730f..41befbbab 100644
--- a/gs/psi/iutil.c
+++ b/gs/psi/iutil.c
@@ -257,8 +257,8 @@ obj_ident_eq(const gs_memory_t *mem, const ref * pref1, const ref * pref2)
/*
* Set *pchars and *plen to point to the data of a name or string, and
- * return 0. If the object isn't a name or string, return e_typecheck.
- * If the object is a string without read access, return e_invalidaccess.
+ * return 0. If the object isn't a name or string, return gs_error_typecheck.
+ * If the object is a string without read access, return gs_error_invalidaccess.
*/
int
obj_string_data(const gs_memory_t *mem, const ref *op, const byte **pchars, uint *plen)
@@ -278,19 +278,19 @@ obj_string_data(const gs_memory_t *mem, const ref *op, const byte **pchars, uint
*plen = r_size(op);
return 0;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
/*
* Create a printable representation of an object, a la cvs and =
* (full_print = 0), == (full_print = 1), or === (full_print = 2). Return 0
- * if OK, 1 if the destination wasn't large enough, e_invalidaccess if the
+ * if OK, 1 if the destination wasn't large enough, gs_error_invalidaccess if the
* object's contents weren't readable. If the return value is 0 or 1,
* *prlen contains the amount of data returned. start_pos is the starting
* output position -- the first start_pos bytes of output are discarded.
*
- * When (restart = false) return e_rangecheck the when destination wasn't
+ * When (restart = false) return gs_error_rangecheck the when destination wasn't
* large enough without modifying the destination. This is needed for
* compatibility with Adobe implementation of cvs and cvrs, which don't
* change the destination string on failure.
@@ -365,7 +365,7 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
if (start_pos > 0)
return obj_cvp(op, str, len, prlen, 0, start_pos - 1, mem, restart);
if (len < 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = obj_cvp(op, str + 1, len - 1, prlen, 0, 0, mem, restart);
if (code < 0)
return code;
@@ -390,7 +390,7 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
if (start_pos == 0) {
if (len < 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
str[0] = '(';
skip = 0;
wstr = str + 1;
@@ -424,7 +424,7 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
if (status == 0) {
#ifdef DEBUG
if (skip > (truncate ? 4 : 1)) {
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
#endif
}
@@ -467,7 +467,7 @@ obj_cvp(const ref * op, byte * str, uint len, uint * prlen,
if (size > 4 && !memcmp(data + size - 4, "type", 4))
size -= 4;
if (size > sizeof(buf) - 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
buf[0] = '-';
memcpy(buf + 1, data, size);
buf[size + 1] = '-';
@@ -480,10 +480,10 @@ other:
int rtype = r_btype(op);
if (rtype >= countof(type_strings))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
data = (const byte *)type_strings[rtype];
if (data == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
goto rs;
}
@@ -551,9 +551,9 @@ other:
}
rs: size = strlen((const char *)data);
nl: if (size < start_pos)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (!restart && size > len)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
size -= start_pos;
*prlen = min(size, len);
memmove(str, data + start_pos, *prlen);
@@ -583,8 +583,8 @@ ensure_dot(char *buf)
/*
* Create a printable representation of an object, a la cvs and =. Return 0
- * if OK, e_rangecheck if the destination wasn't large enough,
- * e_invalidaccess if the object's contents weren't readable. If pchars !=
+ * if OK, gs_error_rangecheck if the destination wasn't large enough,
+ * gs_error_invalidaccess if the object's contents weren't readable. If pchars !=
* NULL, then if the object was a string or name, store a pointer to its
* characters in *pchars even if it was too large; otherwise, set *pchars =
* str. In any case, store the length in *prlen.
@@ -598,7 +598,7 @@ obj_cvs(const gs_memory_t *mem, const ref * op, byte * str, uint len, uint * prl
if (code == 1) {
if (pchars)
obj_string_data(mem, op, pchars, prlen);
- return gs_note_error(e_rangecheck);
+ return gs_note_error(gs_error_rangecheck);
} else {
if (pchars)
*pchars = str;
@@ -652,7 +652,7 @@ int
array_get(const gs_memory_t *mem, const ref * aref, long index_long, ref * pref)
{
if ((ulong)index_long >= r_size(aref))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
switch (r_type(aref)) {
case t_array:
{
@@ -679,7 +679,7 @@ array_get(const gs_memory_t *mem, const ref * aref, long index_long, ref * pref)
}
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
return 0;
}
@@ -719,7 +719,7 @@ packed_get(const gs_memory_t *mem, const ref_packed * packed, ref * pref)
/* Check to make sure an interval contains no object references */
/* to a space younger than a given one. */
-/* Return 0 or e_invalidaccess. */
+/* Return 0 or gs_error_invalidaccess. */
int
refs_check_space(const ref * bot, uint size, uint space)
{
@@ -785,9 +785,9 @@ num_params(const ref * op, int count, double *pval)
mask++;
break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
op--;
}
@@ -808,9 +808,9 @@ float_params(const ref * op, int count, float *pval)
*--pval = (float)op->value.intval;
break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
return 0;
}
@@ -844,7 +844,7 @@ process_float_array(const gs_memory_t *mem, const ref * parray, int count, float
}
/* Get a single real parameter. */
-/* The only possible errors are e_typecheck and e_stackunderflow. */
+/* The only possible errors are gs_error_typecheck and gs_error_stackunderflow. */
/* If an error is returned, the return value is not updated. */
int
real_param(const ref * op, double *pparam)
@@ -857,9 +857,9 @@ real_param(const ref * op, double *pparam)
*pparam = op->value.realval;
break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
return 0;
}
@@ -887,7 +887,7 @@ int_param(const ref * op, int max_value, int *pparam)
int
make_reals(ref * op, const double *pval, int count)
{
- /* This should return e_limitcheck if any real is too large */
+ /* This should return gs_error_limitcheck if any real is too large */
/* to fit into a float on the stack. */
for (; count--; op++, pval++)
make_real(op, *pval);
@@ -896,7 +896,7 @@ make_reals(ref * op, const double *pval, int count)
int
make_floats(ref * op, const float *pval, int count)
{
- /* This should return e_undefinedresult for infinities. */
+ /* This should return gs_error_undefinedresult for infinities. */
for (; count--; op++, pval++)
make_real(op, *pval);
return 0;
@@ -910,14 +910,14 @@ check_proc_failed(const ref * pref)
{
if (r_is_array(pref)) {
if (r_has_attr(pref, a_executable))
- return e_invalidaccess;
+ return gs_error_invalidaccess;
else
- return e_typecheck;
+ return gs_error_typecheck;
} else {
if (r_has_type(pref, t__invalid))
- return e_stackunderflow;
+ return gs_error_stackunderflow;
else
- return e_typecheck;
+ return gs_error_typecheck;
}
}
@@ -926,7 +926,7 @@ check_proc_failed(const ref * pref)
int
check_type_failed(const ref * op)
{
- return (r_has_type(op, t__invalid) ? e_stackunderflow : e_typecheck);
+ return (r_has_type(op, t__invalid) ? gs_error_stackunderflow : gs_error_typecheck);
}
/* ------ Matrix utilities ------ */
@@ -962,7 +962,7 @@ read_matrix(const gs_memory_t *mem, const ref * op, gs_matrix * pmat)
}
check_read(*op);
if (r_size(op) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = float_params(pvalues + 5, 6, (float *)pmat);
return (code < 0 ? code : 0);
}
@@ -979,7 +979,7 @@ write_matrix_in(ref * op, const gs_matrix * pmat, gs_dual_memory_t *idmemory,
check_write_type(*op, t_array);
if (r_size(op) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
aptr = op->value.refs;
pel = (const float *)pmat;
for (i = 5; i >= 0; i--, aptr++, pel++) {
diff --git a/gs/psi/iutil.h b/gs/psi/iutil.h
index 4f03c1e2c..f51790f29 100644
--- a/gs/psi/iutil.h
+++ b/gs/psi/iutil.h
@@ -45,15 +45,15 @@ bool obj_ident_eq(const gs_memory_t *mem, const ref *, const ref *);
/*
* Set *pchars and *plen to point to the data of a name or string, and
- * return 0. If the object isn't a name or string, return e_typecheck.
- * If the object is a string without read access, return e_invalidaccess.
+ * return 0. If the object isn't a name or string, return gs_error_typecheck.
+ * If the object is a string without read access, return gs_error_invalidaccess.
*/
int obj_string_data(const gs_memory_t *mem, const ref *op, const byte **pchars, uint *plen);
/*
* Create a printable representation of an object, a la cvs and =
* (full_print = 0), == (full_print = 1), or === (full_print = 2). Return 0
- * if OK, 1 if the destination wasn't large enough, e_invalidaccess if the
+ * if OK, 1 if the destination wasn't large enough, gs_error_invalidaccess if the
* object's contents weren't readable. If the return value is 0 or 1,
* *prlen contains the amount of data returned. start_pos is the starting
* output position -- the first start_pos bytes of output are discarded.
@@ -68,14 +68,14 @@ int obj_cvp(const ref * op, byte *str, uint len, uint * prlen,
/*
* Create a printable representation of an object, a la cvs and =. Return 0
- * if OK, e_rangecheck if the destination wasn't large enough,
- * e_invalidaccess if the object's contents weren't readable. If pchars !=
+ * if OK, gs_error_rangecheck if the destination wasn't large enough,
+ * gs_error_invalidaccess if the object's contents weren't readable. If pchars !=
* NULL, then if the object was a string or name, store a pointer to its
* characters in *pchars even if it was too large; otherwise, set *pchars =
* str. In any case, store the length in *prlen.
*
* obj_cvs is different from obj_cvp in two respects: if the printed
- * representation is too large, it returns e_rangecheck rather than 1;
+ * representation is too large, it returns gs_error_rangecheck rather than 1;
* and it can return a pointer to the data for names and strings, like
* obj_string_data.
*/
@@ -93,7 +93,7 @@ void packed_get(const gs_memory_t *mem, const ref_packed *, ref *);
/* Check to make sure an interval contains no object references */
/* to a space younger than a given one. */
-/* Return 0 or e_invalidaccess. */
+/* Return 0 or gs_error_invalidaccess. */
int refs_check_space(const ref * refs, uint size, uint space);
/* ------ String utilities ------ */
@@ -117,7 +117,7 @@ int float_params(const ref *, int, float *);
int process_float_array(const gs_memory_t *mem, const ref *, int, float *);
/* Get a single real parameter. */
-/* The only possible error is e_typecheck. */
+/* The only possible error is gs_error_typecheck. */
int real_param(const ref *, double *);
/* float_param can lose accuracy for large integers. */
@@ -127,7 +127,7 @@ int float_param(const ref *, float *);
int int_param(const ref *, int, int *);
/* Make real values on the stack. */
-/* Return e_limitcheck for infinities or double->float overflow. */
+/* Return gs_error_limitcheck for infinities or double->float overflow. */
int make_reals(ref *, const double *, int);
int make_floats(ref *, const float *, int);
diff --git a/gs/psi/iutil2.c b/gs/psi/iutil2.c
index df63c703b..3d04eeaa3 100644
--- a/gs/psi/iutil2.c
+++ b/gs/psi/iutil2.c
@@ -41,7 +41,7 @@ param_read_password(gs_param_list * plist, const char *kstr, password * ppass)
switch (code) {
case 0: /* OK */
if (ps.size > MAX_PASSWORD)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
/* Copy the data back. */
memcpy(ppass->data, ps.data, ps.size);
ppass->size = ps.size;
@@ -51,7 +51,7 @@ param_read_password(gs_param_list * plist, const char *kstr, password * ppass)
}
/* We might have gotten a typecheck because */
/* the supplied password was an integer. */
- if (code != e_typecheck)
+ if (code != gs_error_typecheck)
return code;
code = param_read_long(plist, kstr, &ipass);
if (code != 0) /* error or missing */
@@ -70,7 +70,7 @@ param_write_password(gs_param_list * plist, const char *kstr,
ps.data = (const byte *)ppass->data, ps.size = ppass->size,
ps.persistent = false;
if (ps.size > MAX_PASSWORD)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
return param_write_string(plist, kstr, &ps);
}
@@ -103,12 +103,12 @@ dict_find_password(ref ** ppvalue, const ref * pdref, const char *kstr)
ref *pvalue;
if (dict_find_string(pdref, kstr, &pvalue) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (!r_has_type(pvalue, t_string) ||
r_has_attrs(pvalue, a_read) ||
pvalue->value.const_bytes[0] >= r_size(pvalue)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
*ppvalue = pvalue;
return 0;
}
@@ -121,7 +121,7 @@ dict_read_password(password * ppass, const ref * pdref, const char *pkey)
if (code < 0)
return code;
if (pvalue->value.const_bytes[0] > MAX_PASSWORD)
- return_error(e_rangecheck); /* limitcheck? */
+ return_error(gs_error_rangecheck); /* limitcheck? */
memcpy(ppass->data, pvalue->value.const_bytes + 1,
(ppass->size = pvalue->value.const_bytes[0]));
return 0;
@@ -136,11 +136,11 @@ dict_write_password(const password * ppass, ref * pdref, const char *pkey,
if (code < 0)
return code;
if (ppass->size >= r_size(pvalue))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (!change_allowed &&
bytes_compare(pvalue->value.bytes + 1, pvalue->value.bytes[0],
ppass->data, ppass->size) != 0)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
memcpy(pvalue->value.bytes + 1, ppass->data,
(pvalue->value.bytes[0] = ppass->size));
return 0;
diff --git a/gs/psi/ivmspace.h b/gs/psi/ivmspace.h
index 1e5040918..a028ccfdd 100644
--- a/gs/psi/ivmspace.h
+++ b/gs/psi/ivmspace.h
@@ -92,7 +92,7 @@ typedef enum {
/* Check whether a store is allowed. */
#define store_check_space(destspace,rpnew)\
if ( r_space(rpnew) > (destspace) )\
- return_error(e_invalidaccess)
+ return_error(gs_error_invalidaccess)
#define store_check_dest(rpdest,rpnew)\
store_check_space(r_space(rpdest), rpnew)
/* BACKWARD COMPATIBILITY (not used by any Ghostscript code per se) */
diff --git a/gs/psi/opcheck.h b/gs/psi/opcheck.h
index 2c53df6b7..9a5d40774 100644
--- a/gs/psi/opcheck.h
+++ b/gs/psi/opcheck.h
@@ -26,14 +26,14 @@
* subsidiary objects obtained from places other than the stack.
*/
#define check_type_only(rf,typ)\
- BEGIN if ( !r_has_type(&rf,typ) ) return_error(e_typecheck); END
+ BEGIN if ( !r_has_type(&rf,typ) ) return_error(gs_error_typecheck); END
#define check_stype_only(rf,styp)\
- BEGIN if ( !r_has_stype(&rf,imemory,styp) ) return_error(e_typecheck); END
+ BEGIN if ( !r_has_stype(&rf,imemory,styp) ) return_error(gs_error_typecheck); END
/* Check for array */
#define check_array_else(rf,errstat)\
BEGIN if ( !r_has_type(&rf, t_array) ) errstat; END
#define check_array_only(rf)\
- check_array_else(rf, return_error(e_typecheck))
+ check_array_else(rf, return_error(gs_error_typecheck))
/* Check for procedure. check_proc_failed includes the stack underflow */
/* check, but it doesn't do any harm in the off-stack case. */
int check_proc_failed(const ref *);
@@ -44,14 +44,14 @@ int check_proc_failed(const ref *);
/* Check for read, write, or execute access. */
#define check_access(rf,acc1)\
- BEGIN if ( !r_has_attr(&rf,acc1) ) return_error(e_invalidaccess); END
+ BEGIN if ( !r_has_attr(&rf,acc1) ) return_error(gs_error_invalidaccess); END
#define check_read(rf) check_access(rf,a_read)
#define check_write(rf) check_access(rf,a_write)
#define check_execute(rf) check_access(rf,a_execute)
#define check_type_access_only(rf,typ,acc1)\
BEGIN\
if ( !r_has_type_attrs(&rf,typ,acc1) )\
- return_error((!r_has_type(&rf,typ) ? e_typecheck : e_invalidaccess));\
+ return_error((!r_has_type(&rf,typ) ? gs_error_typecheck : gs_error_invalidaccess));\
END
#define check_read_type_only(rf,typ)\
check_type_access_only(rf,typ,a_read)
@@ -62,17 +62,17 @@ int check_proc_failed(const ref *);
#define check_int_leu(orf, u)\
BEGIN\
check_type(orf, t_integer);\
- if ( (ulong)(orf).value.intval > (u) ) return_error(e_rangecheck);\
+ if ( (ulong)(orf).value.intval > (u) ) return_error(gs_error_rangecheck);\
END
#define check_int_leu_only(rf, u)\
BEGIN\
check_type_only(rf, t_integer);\
- if ( (ulong)(rf).value.intval > (u) ) return_error(e_rangecheck);\
+ if ( (ulong)(rf).value.intval > (u) ) return_error(gs_error_rangecheck);\
END
#define check_int_ltu(orf, u)\
BEGIN\
check_type(orf, t_integer);\
- if ( (ulong)(orf).value.intval >= (u) ) return_error(e_rangecheck);\
+ if ( (ulong)(orf).value.intval >= (u) ) return_error(gs_error_rangecheck);\
END
#endif /* opcheck_INCLUDED */
diff --git a/gs/psi/oper.h b/gs/psi/oper.h
index 194586180..b8fd180c9 100644
--- a/gs/psi/oper.h
+++ b/gs/psi/oper.h
@@ -40,8 +40,8 @@
* we must make an additional check to determine which error
* should be reported. In order not to have to make this check in-line
* in every type check in every operator, we define a procedure that takes
- * an o-stack pointer and returns e_stackunderflow if it points to
- * a guard entry, e_typecheck otherwise.
+ * an o-stack pointer and returns gs_error_stackunderflow if it points to
+ * a guard entry, gs_error_typecheck otherwise.
*
* Note that we only need to do this for typecheck, not for any other
* kind of error such as invalidaccess, since any operator that can
@@ -72,7 +72,7 @@ int check_type_failed(const ref *);
#define check_type_access(orf,typ,acc1)\
if ( !r_has_type_attrs(&orf,typ,acc1) )\
return_error((!r_has_type(&orf,typ) ? check_type_failed(&orf) :\
- e_invalidaccess))
+ gs_error_invalidaccess))
#define check_read_type(orf,typ)\
check_type_access(orf,typ,a_read)
#define check_write_type(orf,typ)\
@@ -81,7 +81,7 @@ int check_type_failed(const ref *);
/* Macro for as yet unimplemented operators. */
/* The if ( 1 ) is to prevent the compiler from complaining about */
/* unreachable code. */
-#define NYI(msg) if ( 1 ) return_error(e_undefined)
+#define NYI(msg) if ( 1 ) return_error(gs_error_undefined)
/*
* If an operator has popped or pushed something on the control stack,
diff --git a/gs/psi/ostack.h b/gs/psi/ostack.h
index 336ae31b0..ec28731fe 100644
--- a/gs/psi/ostack.h
+++ b/gs/psi/ostack.h
@@ -33,7 +33,7 @@
/* Macro to ensure enough room on the operand stack */
#define check_ostack(n)\
if ( ostop - osp < (n) )\
- { o_stack.requested = (n); return_error(e_stackoverflow); }
+ { o_stack.requested = (n); return_error(gs_error_stackoverflow); }
/* Operand stack manipulation. */
@@ -41,7 +41,7 @@
#define push(n)\
BEGIN\
if ( (op += (n)) > ostop )\
- { o_stack.requested = (n); return_error(e_stackoverflow); }\
+ { o_stack.requested = (n); return_error(gs_error_stackoverflow); }\
else osp = op;\
END
@@ -68,7 +68,7 @@
* operator's declared minimum number of entries.)
*/
#define check_op(nargs)\
- if ( op < osbot + ((nargs) - 1) ) return_error(e_stackunderflow)
+ if ( op < osbot + ((nargs) - 1) ) return_error(gs_error_stackunderflow)
/*
* Similarly, in order to simplify some overflow checks, we allocate
* a few guard entries just above the top of the o-stack.
diff --git a/gs/psi/zalg.c b/gs/psi/zalg.c
index 2346a60d8..7182c0769 100644
--- a/gs/psi/zalg.c
+++ b/gs/psi/zalg.c
@@ -59,7 +59,7 @@ zsort(i_ctx_t *i_ctx_p)
/* Check operands for type and access */
/* we can sort only writable [and unpacked] arrays */
if (r_type(&op[-1]) == t_mixedarray || r_type(&op[-1]) == t_shortarray)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
check_write_type(op[-1], t_array);
/* the predicate must be an executable array/ string/ name/ [pseudo-]operator */
if (!r_has_attr(&op[0], a_executable))
@@ -70,7 +70,7 @@ zsort(i_ctx_t *i_ctx_p)
case t_shortarray:
case t_string:
if (!r_has_attr(&op[0], a_execute))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
break;
case t_name:
case t_operator:
@@ -156,7 +156,7 @@ H4: i = j;
}
case 5:
/*H5_cont:*/if (!r_has_type(&op[0], t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (op[0].value.boolval)
j++;
H6: H = 6;
@@ -166,7 +166,7 @@ H6: H = 6;
break;
case 6:
/*H6_cont:*/if (!r_has_type(&op[0], t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (op[0].value.boolval) {
/* H7: */ ref_assign_old(&arry, &Rn[i], &Rn[j], ".sort(H7)");
goto H4;
diff --git a/gs/psi/zarith.c b/gs/psi/zarith.c
index 2cf60345a..9e7c7eae2 100644
--- a/gs/psi/zarith.c
+++ b/gs/psi/zarith.c
@@ -111,7 +111,7 @@ zdiv(i_ctx_t *i_ctx_p)
return_op_typecheck(op);
case t_real:
if (op->value.realval == 0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
switch (r_type(op1)) {
default:
return_op_typecheck(op1);
@@ -124,7 +124,7 @@ zdiv(i_ctx_t *i_ctx_p)
break;
case t_integer:
if (op->value.intval == 0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
switch (r_type(op1)) {
default:
return_op_typecheck(op1);
@@ -273,7 +273,7 @@ zidiv(i_ctx_t *i_ctx_p)
int tmpval;
if ((op->value.intval == 0) || (op[-1].value.intval == (ps_int)MIN_PS_INT32 && op->value.intval == -1)) {
/* Anomalous boundary case: -MININT / -1, fail. */
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
}
tmpval = (int)op[-1].value.intval / op->value.intval;
op[-1].value.intval = (int64_t)tmpval;
@@ -281,7 +281,7 @@ zidiv(i_ctx_t *i_ctx_p)
else {
if ((op->value.intval == 0) || (op[-1].value.intval == MIN_PS_INT && op->value.intval == -1)) {
/* Anomalous boundary case: -MININT / -1, fail. */
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
}
op[-1].value.intval /= op->value.intval;
}
@@ -298,7 +298,7 @@ zmod(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
check_type(op[-1], t_integer);
if (op->value.intval == 0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
op[-1].value.intval %= op->value.intval;
pop(1);
return 0;
diff --git a/gs/psi/zarray.c b/gs/psi/zarray.c
index 47877dbca..659f2a590 100644
--- a/gs/psi/zarray.c
+++ b/gs/psi/zarray.c
@@ -35,9 +35,9 @@ zarray(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (op->value.intval > max_array_size)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
size = op->value.intval;
code = ialloc_ref_array((ref *)op, a_all, size, "array");
if (code < 0)
@@ -101,13 +101,13 @@ zastore(i_ctx_t *i_ctx_p)
if (size == 0)
return 0;
if (!r_has_type_attrs(op, t_array, a_write))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
if (size > op - osbot) {
/* The store operation might involve other stack segments. */
ref arr;
if (size >= ref_stack_count(&o_stack))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
arr = *op;
code = ref_stack_store(&o_stack, &arr, size, 1, 0, true, idmemory,
"astore");
diff --git a/gs/psi/zbfont.c b/gs/psi/zbfont.c
index fced10fed..8c8237403 100644
--- a/gs/psi/zbfont.c
+++ b/gs/psi/zbfont.c
@@ -281,7 +281,7 @@ build_gs_font_procs(os_ptr op, build_proc_refs * pbuild)
gcode = dict_find_string(op, "BuildGlyph", &pBuildGlyph);
if (ccode <= 0) {
if (gcode <= 0)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
make_null(&pbuild->BuildChar);
} else {
check_proc(*pBuildChar);
@@ -343,16 +343,16 @@ build_gs_primitive_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font_base ** ppfont,
if (dict_find_string(op, "CharStrings", &pcharstrings) <= 0) {
if (!(options & bf_CharStrings_optional))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
} else {
ref *ignore;
if (!r_has_type(pcharstrings, t_dictionary))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if ((options & bf_notdef_required) != 0 &&
dict_find_string(pcharstrings, ".notdef", &ignore) <= 0
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
/*
* Since build_gs_simple_font may resize the dictionary and cause
* pointers to become invalid, save CharStrings.
@@ -615,7 +615,7 @@ sub_font_params(gs_memory_t *mem, const ref *op, gs_matrix *pmat, gs_matrix *pom
if (dict_find_string(op, "FontMatrix", &pmatrix) <= 0 ||
read_matrix(mem, pmatrix, pmat) < 0
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (dict_find_string(op, "OrigFont", &porigfont) <= 0)
porigfont = NULL;
if (pomat!= NULL) {
@@ -637,7 +637,7 @@ sub_font_params(gs_memory_t *mem, const ref *op, gs_matrix *pmat, gs_matrix *pom
byte *sfname = gs_alloc_string(mem, fssize, "sub_font_params");
if (sfname == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(sfname, tmpStr1, fssize1);
sfname[fssize1]=',' ;
memcpy(sfname + fssize1 + 1, tmpStr2, fssize2);
@@ -682,14 +682,14 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
!r_has_type(pftype, t_integer) ||
pftype->value.intval != (int)ftype
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (dict_find_string(op, "Encoding", &pencoding) <= 0) {
if (!(options & bf_Encoding_optional))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
pencoding = 0;
} else {
if (!r_is_array(pencoding))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
if (pencoding) { /* observed Adobe behavior */
int count = r_size(pencoding);
@@ -702,13 +702,13 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
!(r_has_type(&r, type) || r_has_type(&r, t_null))) {
if (!cpsi_mode && ftype == ft_user_defined) {
if (code < 0 || r_has_type(&r, t_null)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
fixit = true;
break;
}
else {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
}
@@ -735,7 +735,7 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
while (count--) {
ref r;
if (array_get(imemory, pencoding, count, &r) < 0){
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
/* For type 3, we know the Encoding entries must be names */
if (r_has_type(&r, t_name)){
@@ -782,7 +782,7 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
if (obj_eq(pfont->memory, pfont_dict(pfont), op)) {
if (pfont->base == pfont) { /* original font */
if (!level2_enabled)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
*ppfont = pfont;
return 1;
} else { /* This was made by makefont or scalefont. */
@@ -801,7 +801,7 @@ build_gs_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font ** ppfont, font_type ftype,
}
/* This is a new font. */
if (!r_has_attr(aop, a_write))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
{
ref encoding;
@@ -860,7 +860,7 @@ build_gs_sub_font(i_ctx_t *i_ctx_p, const ref *op, gs_font **ppfont,
pdata = ialloc_struct(font_data, &st_font_data,
"buildfont(data)");
if (pfont == 0 || pdata == 0)
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
else if (fid_op)
code = add_FID(i_ctx_p, fid_op, pfont, iimemory);
if (code < 0) {
diff --git a/gs/psi/zbseq.c b/gs/psi/zbseq.c
index f8daafc78..40a394919 100644
--- a/gs/psi/zbseq.c
+++ b/gs/psi/zbseq.c
@@ -43,7 +43,7 @@ create_names_array(ref **ppnames, gs_memory_t *mem, client_name_t cname)
&st_names_array_ref, cname);
if (pnames == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_empty_array(pnames, a_readonly);
*ppnames = pnames;
return 0;
@@ -72,7 +72,7 @@ zinstallsystemnames(i_ctx_t *i_ctx_p)
os_ptr op = osp;
if (r_space(op) != avm_global || imemory_save_level(iimemory_global) != 0)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
check_read_type(*op, t_shortarray);
ref_assign_old(NULL, system_names_p, op, ".installsystemnames");
pop(1);
@@ -99,7 +99,7 @@ zsetobjectformat(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0 || op->value.intval > 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_struct(&cont, avm_local, ref_binary_object_format_container);
ref_assign_old(&cont, &ref_binary_object_format, op, "setobjectformat");
pop(1);
@@ -126,7 +126,7 @@ zbosobject(i_ctx_t *i_ctx_p)
check_type(op[-2], t_integer);
check_write_type(*op, t_string);
if (r_size(op) < 8)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = encode_binary_token(i_ctx_p, op - 1, &op[-3].value.intval,
&op[-2].value.intval, op->value.bytes);
if (code < 0)
diff --git a/gs/psi/zcfont.c b/gs/psi/zcfont.c
index 525576ad0..b61cb3312 100644
--- a/gs/psi/zcfont.c
+++ b/gs/psi/zcfont.c
@@ -53,7 +53,7 @@ zcshow(i_ctx_t *i_ctx_p)
str_op = op - 1;
} else {
check_op(2);
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if ((code = op_show_setup(i_ctx_p, str_op)) != 0 ||
(code = gs_cshow_begin(igs, str_op->value.bytes, r_size(str_op),
diff --git a/gs/psi/zchar.c b/gs/psi/zchar.c
index 255280f84..51081f0b7 100644
--- a/gs/psi/zchar.c
+++ b/gs/psi/zchar.c
@@ -105,10 +105,10 @@ widthshow_aux(i_ctx_t *i_ctx_p, bool single_byte_space)
check_type(op[-1], t_integer);
if (gs_currentfont(igs)->FontType == ft_composite) {
if ((gs_char) (op[-1].value.intval) != op[-1].value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} else {
if (op[-1].value.intval < 0 || op[-1].value.intval > 255)
- return_error(e_rangecheck); /* per PLRM and CET 13-26 */
+ return_error(gs_error_rangecheck); /* per PLRM and CET 13-26 */
}
if ((code = num_params(op - 2, 2, cxy)) < 0 )
return code;
@@ -170,10 +170,10 @@ awidthshow_aux(i_ctx_t *i_ctx_p, bool single_byte_space)
check_type(op[-3], t_integer);
if (gs_currentfont(igs)->FontType == ft_composite) {
if ((gs_char) (op[-3].value.intval) != op[-3].value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} else {
if (op[-3].value.intval < 0 || op[-3].value.intval > 255)
- return_error(e_rangecheck); /* per PLRM and CET 13-02 */
+ return_error(gs_error_rangecheck); /* per PLRM and CET 13-02 */
}
if ((code = num_params(op - 4, 2, cxy)) < 0 )
return code;
@@ -225,7 +225,7 @@ zkshow(i_ctx_t *i_ctx_p)
* so we check for it here.
*/
if (gs_currentfont(igs)->FontType == ft_composite)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if ((code = op_show_setup(i_ctx_p, op)) != 0 ||
(code = gs_kshow_begin(igs, op->value.bytes, r_size(op),
imemory_local, &penum)) < 0)
@@ -328,7 +328,7 @@ zsetcachedevice(i_ctx_t *i_ctx_p)
int code = num_params(op, 6, wbox);
if (penum == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (code < 0)
return code;
if (zchar_show_width_only(penum))
@@ -352,7 +352,7 @@ zsetcachedevice2(i_ctx_t *i_ctx_p)
int code = num_params(op, 10, wbox);
if (penum == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (code < 0)
return code;
if (zchar_show_width_only(penum))
@@ -378,7 +378,7 @@ zsetcharwidth(i_ctx_t *i_ctx_p)
int code = num_params(op, 2, width);
if (penum == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (code < 0)
return code;
if (zchar_show_width_only(penum))
@@ -530,7 +530,7 @@ op_show_finish_setup(i_ctx_t *i_ctx_p, gs_text_enum_t * penum, int npop,
penum->text.data.bytes[0] ==
(gs_text_current_char(osenum) & 0xff))
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
text = penum->text;
text.operation =
(text.operation &
@@ -551,7 +551,7 @@ op_show_finish_setup(i_ctx_t *i_ctx_p, gs_text_enum_t * penum, int npop,
int ft = igs->root_font->FontType;
if ((ft >= ft_CID_encrypted && ft <= ft_CID_TrueType) || ft == ft_CID_bitmap)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
make_mark_estack(ep - (snumpush - 1), es_show, op_show_cleanup);
if (endproc == NULL)
@@ -722,15 +722,15 @@ op_show_continue_dispatch(i_ctx_t *i_ctx_p, int npop, int code)
code = z1_set_cache(i_ctx_p, (gs_font_base *)pfont,
&cnref, glyph, cont, &exec_cont);
else
- return_error(e_unregistered); /* Unimplemented. */
+ return_error(gs_error_unregistered); /* Unimplemented. */
if (exec_cont != 0)
- return_error(e_unregistered); /* Must not happen. */
+ return_error(gs_error_unregistered); /* Must not happen. */
return code;
}
default: /* error */
err:
if (code >= 0)
- code = gs_note_error(e_invalidfont);
+ code = gs_note_error(gs_error_invalidfont);
return op_show_free(i_ctx_p, code);
}
}
@@ -826,11 +826,11 @@ op_show_return_width(i_ctx_t *i_ctx_p, uint npop, double *pwidth)
/* Restore the operand and dictionary stacks. */
ocount = ref_stack_count(&o_stack) - (uint) esodepth(ep).value.intval;
if (ocount < npop)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
dsaved = (uint) esddepth(ep).value.intval;
dcount = ref_stack_count(&d_stack);
if (dcount < dsaved)
- return_error(e_dictstackunderflow);
+ return_error(gs_error_dictstackunderflow);
while (dcount > dsaved) {
code = zend(i_ctx_p);
if (code < 0)
@@ -896,7 +896,7 @@ op_show_restore(i_ctx_t *i_ctx_p, bool for_error)
* Bad news: we got an error inside a save inside a BuildChar or
* BuildGlyph. Don't attempt to recover.
*/
- code = gs_note_error(e_Fatal);
+ code = gs_note_error(gs_error_Fatal);
} else
code = gs_grestore(igs);
}
@@ -937,7 +937,7 @@ font_bbox_param(const gs_memory_t *mem, const ref * pfdict, double bbox[4])
bbox[0] = bbox[1] = bbox[2] = bbox[3] = 0.0;
if (dict_find_string(pfdict, "FontBBox", &pbbox) > 0) {
if (!r_is_array(pbbox))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pbbox) == 4) {
const ref_packed *pbe = pbbox->value.packed;
ref rbe[4];
@@ -961,7 +961,7 @@ font_bbox_param(const gs_memory_t *mem, const ref * pfdict, double bbox[4])
bbox[0] = bbox[1] = bbox[2] = bbox[3] = 0.0;
}
} else if (gs_currentcpsimode(mem)) {
- return_error(e_invalidfont); /* CPSI requires FontBBox */
+ return_error(gs_error_invalidfont); /* CPSI requires FontBBox */
}
return 0;
}
diff --git a/gs/psi/zchar1.c b/gs/psi/zchar1.c
index 9f014be04..72f7b5358 100644
--- a/gs/psi/zchar1.c
+++ b/gs/psi/zchar1.c
@@ -219,7 +219,7 @@ charstring_execchar_aux(i_ctx_t *i_ctx_p, gs_text_enum_t *penum, gs_font *pfont)
*/
check_type(*op, t_string);
if (r_size(op) <= max(pdata->lenIV, 0))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
/*
* In order to make character oversampling work, we must
* set up the cache before calling .type1addpath.
@@ -348,7 +348,7 @@ charstring_execchar(i_ctx_t *i_ctx_p, int font_type_mask)
if (penum == 0 ||
pfont->FontType >= sizeof(font_type_mask) * 8 ||
!(font_type_mask & (1 << (int)pfont->FontType)))
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = charstring_execchar_aux(i_ctx_p, penum, pfont);
if (code < 0 && igs->in_cachedevice == CACHE_DEVICE_CACHING) {
/* Perform the cache cleanup, when the cached character data
@@ -410,7 +410,7 @@ type1exec_bbox(i_ctx_t *i_ctx_p, gs_text_enum_t *penum, gs_type1exec_state * pcx
switch (code) {
default: /* code < 0 or done, error */
return ((code < 0 ? code :
- gs_note_error(e_invalidfont)));
+ gs_note_error(gs_error_invalidfont)));
case type1_result_callothersubr: /* unknown OtherSubr */
return type1_call_OtherSubr(i_ctx_p, pcxs,
bbox_getsbw_continue,
@@ -452,7 +452,7 @@ bbox_getsbw_continue(i_ctx_t *i_ctx_p)
switch (code) {
default: /* code < 0 or done, error */
op_type1_free(i_ctx_p);
- return ((code < 0 ? code : gs_note_error(e_invalidfont)));
+ return ((code < 0 ? code : gs_note_error(gs_error_invalidfont)));
case type1_result_callothersubr: /* unknown OtherSubr */
return type1_push_OtherSubr(i_ctx_p, pcxs, bbox_getsbw_continue,
&other_subr);
@@ -533,13 +533,13 @@ bbox_finish(i_ctx_t *i_ctx_p, op_proc_t cont, op_proc_t *exec_cont)
if (code < 0)
return code;
if (penum == 0 || !font_uses_charstrings(pfont))
- return_error(e_undefined);
+ return_error(gs_error_undefined);
{
gs_font_type1 *const pfont1 = (gs_font_type1 *) pfont;
int lenIV = pfont1->data.lenIV;
if (lenIV > 0 && r_size(opc) <= lenIV)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
check_estack(5); /* in case we need to do a callout */
code = type1_exec_init(pcis, penum, igs, pfont1);
if (code < 0)
@@ -611,13 +611,13 @@ bbox_draw(i_ctx_t *i_ctx_p, int (*draw)(gs_state *), op_proc_t *exec_cont)
return code;
penum = op_show_find(i_ctx_p);
if (penum == 0 || !font_uses_charstrings(pfont))
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if ((code = gs_pathbbox(igs, &bbox)) < 0) {
/*
* If the matrix is singular, all user coordinates map onto a
* straight line. Don't bother rendering the character at all.
*/
- if (code == e_undefinedresult) {
+ if (code == gs_error_undefinedresult) {
pop(4);
gs_newpath(igs);
return 0;
@@ -778,7 +778,7 @@ type1_call_OtherSubr(i_ctx_t *i_ctx_p, const gs_type1exec_state * pcxs,
"type1_call_OtherSubr");
if (hpcxs == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
*hpcxs = *pcxs;
gs_type1_set_callback_data(&hpcxs->cis, hpcxs);
push_mark_estack(es_show, op_type1_cleanup);
@@ -804,7 +804,7 @@ type1_callout_dispatch(i_ctx_t *i_ctx_p, int (*cont)(i_ctx_t *),
return 0;
default: /* code < 0 or done, error */
op_type1_free(i_ctx_p);
- return ((code < 0 ? code : gs_note_error(e_invalidfont)));
+ return ((code < 0 ? code : gs_note_error(gs_error_invalidfont)));
case type1_result_callothersubr: /* unknown OtherSubr */
return type1_push_OtherSubr(i_ctx_p, pcxs, cont, &other_subr);
case type1_result_sbw: /* [h]sbw, just continue */
@@ -869,7 +869,7 @@ nobbox_finish(i_ctx_t *i_ctx_p, gs_type1exec_state * pcxs)
)
return code;
if (penum == 0 || !font_uses_charstrings(pfont))
- return_error(e_undefined);
+ return_error(gs_error_undefined);
{
gs_font_base *const pbfont = (gs_font_base *) pfont;
gs_font_type1 *const pfont1 = (gs_font_type1 *) pfont;
@@ -956,11 +956,11 @@ zsetweightvector(i_ctx_t *i_ctx_p)
return 0;
}
if (pfont->FontType != ft_encrypted && pfont->FontType != ft_encrypted2)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
pfont1 = (gs_font_type1 *)pfont;
size = r_size(op);
if (size != pfont1->data.WeightVector.count)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
code = process_float_array(imemory, op, size, pfont1->data.WeightVector.values);
if (code < 0)
return code;
@@ -1025,7 +1025,7 @@ z1_seac_data(gs_font_type1 *pfont, int ccode, gs_glyph *pglyph,
ref rglyph;
if (glyph == GS_NO_GLYPH)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = gs_c_glyph_name(glyph, gstr)) < 0 ||
(code = name_ref(pfont->memory, gstr->data, gstr->size, &rglyph, 0)) < 0
)
@@ -1116,10 +1116,10 @@ zcharstring_outline(gs_font_type1 *pfont1, int WMode, const ref *pgref,
pdata = &pfont1->data;
if (pgd->bits.size <= max(pdata->lenIV, 0))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
#if 0 /* Ignore CDevProc for now. */
if (zchar_get_CDevProc((const gs_font_base *)pfont1, &pcdevproc))
- return_error(e_rangecheck); /* can't call CDevProc from here */
+ return_error(gs_error_rangecheck); /* can't call CDevProc from here */
#endif
switch (WMode) {
default:
@@ -1174,7 +1174,7 @@ icont:
default: /* code < 0, error */
return code;
case type1_result_callothersubr: /* unknown OtherSubr */
- return_error(e_rangecheck); /* can't handle it */
+ return_error(gs_error_rangecheck); /* can't handle it */
case type1_result_sbw: /* [h]sbw, just continue */
type1_cis_get_metrics(pcis, cxs.sbw);
type1_cis_get_metrics(pcis, sbw);
@@ -1186,7 +1186,7 @@ icont:
/*
* Redefine glyph_info to take Metrics[2] and CDevProc into account (unless
* GLYPH_INFO_OUTLINE_WIDTHS is set). If CDevProc is present, return
- * e_rangecheck, since we can't call the interpreter from here.
+ * gs_error_rangecheck, since we can't call the interpreter from here.
*/
int
z1_glyph_info_generic(gs_font *font, gs_glyph glyph, const gs_matrix *pmat,
@@ -1210,7 +1210,7 @@ z1_glyph_info_generic(gs_font *font, gs_glyph glyph, const gs_matrix *pmat,
done_members |= GLYPH_INFO_CDEVPROC;
if (members & GLYPH_INFO_CDEVPROC) {
info->members = done_members;
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} else {
/* Ignore CDevProc. Used to compure MissingWidth.*/
}
diff --git a/gs/psi/zchar32.c b/gs/psi/zchar32.c
index bf5937950..f31293d71 100644
--- a/gs/psi/zchar32.c
+++ b/gs/psi/zchar32.c
@@ -52,13 +52,13 @@ zmakeglyph32(i_ctx_t *i_ctx_p)
long_form = false;
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
code = num_params(op[-4].value.refs + msize - 1, msize, metrics);
if (code < 0)
return code;
if (~code & 0x3c) /* check llx .. ury for integers */
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_read_type(op[-3], t_string);
llx = (int)metrics[2];
lly = (int)metrics[3];
@@ -68,16 +68,16 @@ zmakeglyph32(i_ctx_t *i_ctx_p)
height = ury - lly;
raster = (width + 7) >> 3;
if (width < 0 || height < 0 || r_size(op - 3) != raster * height)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_int_leu(op[-2], 65535);
code = font_param(op - 1, &pfont);
if (code < 0)
return code;
if (pfont->FontType != ft_CID_bitmap)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
check_write_type(*op, t_string);
if (r_size(op) < 22)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
str = op->value.bytes;
if (long_form || metrics[0] != (wx = (int)metrics[0]) ||
metrics[1] != 0 || height == 0 ||
@@ -134,7 +134,7 @@ zremoveglyphs(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (range.font->FontType != ft_CID_bitmap)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
range.cid_min = gs_min_cid_glyph + op[-2].value.intval;
range.cid_max = gs_min_cid_glyph + op[-1].value.intval;
gx_purge_selected_cached_chars(range.font->dir, select_cid_range,
@@ -158,7 +158,7 @@ zgetmetrics32(i_ctx_t *i_ctx_p)
data = op->value.const_bytes;
size = r_size(op);
if (size < 5)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (data[0]) {
/* Short form. */
int llx = (int)data[3] - 128, lly = (int)data[4] - 128;
@@ -176,13 +176,13 @@ zgetmetrics32(i_ctx_t *i_ctx_p)
if (data[1]) {
/* Long form, both WModes. */
if (size < 22)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
n = 10;
size = 22;
} else {
/* Long form, WMode = 0 only. */
if (size < 14)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
n = 6;
size = 14;
}
diff --git a/gs/psi/zchar42.c b/gs/psi/zchar42.c
index 69892ce6f..cca86b99c 100644
--- a/gs/psi/zchar42.c
+++ b/gs/psi/zchar42.c
@@ -177,7 +177,7 @@ ztype42execchar(i_ctx_t *i_ctx_p)
(pfont->FontType != ft_TrueType &&
pfont->FontType != ft_CID_TrueType)
)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
/*
* Any reasonable implementation would execute something like
* 1 setmiterlimit 0 setlinejoin 0 setlinecap
@@ -255,7 +255,7 @@ type42_finish(i_ctx_t *i_ctx_p, int (*cont) (gs_state *))
if (penum == 0 || (pfont->FontType != ft_TrueType &&
pfont->FontType != ft_CID_TrueType)
)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
pfont42 = (gs_font_type42 *)pfont;
if (!i_ctx_p->RenderTTNotdef) {
diff --git a/gs/psi/zcharout.c b/gs/psi/zcharout.c
index 9a9dc9549..548584d0f 100644
--- a/gs/psi/zcharout.c
+++ b/gs/psi/zcharout.c
@@ -105,7 +105,7 @@ zchar_get_metrics(const gs_font_base * pbfont, const ref * pcnref,
4, psbw);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if (code < 0)
return code;
@@ -311,7 +311,7 @@ zchar_charstring_data(gs_font *font, const ref *pgref, gs_glyph_data_t *pgd)
ref *pcstr;
if (dict_find(&pfont_data(font)->CharStrings, pgref, &pcstr) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (!r_has_type(pcstr, t_string)) {
/*
* The ADOBEPS4 Windows driver replaces the .notdef entry of
@@ -327,7 +327,7 @@ zchar_charstring_data(gs_font *font, const ref *pgref, gs_glyph_data_t *pgd)
)
return charstring_make_notdef(pgd, font);
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
gs_glyph_data_from_string(pgd, pcstr->value.const_bytes, r_size(pcstr),
NULL);
@@ -373,7 +373,7 @@ charstring_make_notdef(gs_glyph_data_t *pgd, gs_font *font)
byte *chars = gs_alloc_string(font->memory, len, "charstring_make_notdef");
if (chars == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
gs_glyph_data_from_string(pgd, chars, len, font);
if (pfont->data.lenIV < 0)
memcpy(chars, char_data, sizeof(char_data));
diff --git a/gs/psi/zcharx.c b/gs/psi/zcharx.c
index 3afc9728a..7e2fc3172 100644
--- a/gs/psi/zcharx.c
+++ b/gs/psi/zcharx.c
@@ -109,7 +109,7 @@ moveshow(i_ctx_t *i_ctx_p, bool have_x, bool have_y)
size = num_array_size(op, format);
values = (float *)ialloc_byte_array(size, sizeof(float), "moveshow");
if (values == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (CPSI_mode)
memset(values, 0, size * sizeof(values[0])); /* Safety. */
if ((code = gs_xyshow_begin(igs, op[-1].value.bytes, r_size(op - 1),
@@ -143,7 +143,7 @@ moveshow(i_ctx_t *i_ctx_p, bool have_x, bool have_y)
case t_real:
values[i] = value.value.realval; break;
case t_null:
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
/* falls through */
default:
ifree_object(values, "moveshow");
diff --git a/gs/psi/zcid.c b/gs/psi/zcid.c
index 53bcd4778..00c0c8f27 100644
--- a/gs/psi/zcid.c
+++ b/gs/psi/zcid.c
@@ -34,11 +34,11 @@ cid_system_info_param(gs_cid_system_info_t *pcidsi, const ref *prcidsi)
int code;
if (!r_has_type(prcidsi, t_dictionary))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (dict_find_string(prcidsi, "Registry", &pregistry) <= 0 ||
dict_find_string(prcidsi, "Ordering", &pordering) <= 0
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_read_type_only(*pregistry, t_string);
check_read_type_only(*pordering, t_string);
pcidsi->Registry.data = pregistry->value.const_bytes;
@@ -145,7 +145,7 @@ set_CIDMap_element(const gs_memory_t *mem, ref *CIDMap, uint cid, uint glyph_ind
uchar *c;
if (glyph_index >= 65536)
- return_error(e_rangecheck); /* Can't store with GDBytes == 2. */
+ return_error(gs_error_rangecheck); /* Can't store with GDBytes == 2. */
for (i = 0; i < count; i++) {
array_get(mem, CIDMap, i, &s);
size = r_size(&s) & ~1;
@@ -172,9 +172,9 @@ cid_fill_CIDMap(const gs_memory_t *mem,
int count, i;
if (GDBytes != 2)
- return_error(e_unregistered); /* Unimplemented. */
+ return_error(gs_error_unregistered); /* Unimplemented. */
if (r_type(CIDMap) != t_array)
- return_error(e_unregistered); /* Unimplemented. It could be a single string. */
+ return_error(gs_error_unregistered); /* Unimplemented. It could be a single string. */
count = r_size(CIDMap);
/* Checking the CIDMap structure correctness : */
for (i = 0; i < count; i++) {
@@ -195,7 +195,7 @@ cid_fill_CIDMap(const gs_memory_t *mem,
if (!r_has_type(&el[0], t_integer))
continue;
if (!r_has_type(&el[1], t_array))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
index = el[0].value.intval;
count = r_size(&el[1]);
for (i = 0; i < count; i++) {
diff --git a/gs/psi/zcidtest.c b/gs/psi/zcidtest.c
index 6aa91ad23..c69d36e22 100644
--- a/gs/psi/zcidtest.c
+++ b/gs/psi/zcidtest.c
@@ -71,7 +71,7 @@ zwrapfont(i_ctx_t *i_ctx_p)
font->memory);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if (code < 0)
return code;
@@ -100,7 +100,7 @@ zwritecmap(i_ctx_t *i_ctx_p)
if (dict_find_string(op, "CodeMap", &pcodemap) <= 0 ||
!r_is_struct(pcodemap)
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_write_file(s, op - 1);
pcmap = r_ptr(pcodemap, gs_cmap_t);
code = psf_write_cmap(s, pcmap, zfcmap_put_name_default, NULL, -1);
@@ -122,7 +122,7 @@ zwritefont9(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (pfont->FontType != ft_CID_encrypted)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
check_write_file(s, op - 1);
pfcid = (gs_font_cid0 *)pfont;
code = psf_write_cid0_font(s, pfcid,
diff --git a/gs/psi/zcie.c b/gs/psi/zcie.c
index 9e540d51e..5085ede3a 100644
--- a/gs/psi/zcie.c
+++ b/gs/psi/zcie.c
@@ -91,7 +91,7 @@ dict_proc_array_param(const gs_memory_t *mem,
check_array_only(*pvalue);
if (r_size(pvalue) != count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i = 0; i < count; i++) {
ref proc;
@@ -169,7 +169,7 @@ cie_points_param(const gs_memory_t *mem,
pwb->BlackPoint.v < 0 ||
pwb->BlackPoint.w < 0
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return 0;
}
@@ -192,7 +192,7 @@ cie_table_param(const ref * ptref, gx_color_lookup_table * pclt,
for (i = 0; i < n; ++i) {
check_type_only(pta[i], t_integer);
if (pta[i].value.intval <= 1 || pta[i].value.intval > max_ushort)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclt->dims[i] = (int)pta[i].value.intval;
}
nbytes = m * pclt->dims[n - 2] * pclt->dims[n - 1];
@@ -201,7 +201,7 @@ cie_table_param(const ref * ptref, gx_color_lookup_table * pclt,
gs_alloc_struct_array(mem->stable_memory, pclt->dims[0], gs_const_string,
&st_const_string_element, "cie_table_param");
if (table == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = cie_3d_table_param(pta + 3, pclt->dims[0], nbytes, table);
} else { /* n == 4 */
int d0 = pclt->dims[0], d1 = pclt->dims[1];
@@ -210,12 +210,12 @@ cie_table_param(const ref * ptref, gx_color_lookup_table * pclt,
check_read_type(pta[4], t_array);
if (r_size(pta + 4) != d0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
table =
gs_alloc_struct_array(mem->stable_memory, ntables, gs_const_string,
&st_const_string_element, "cie_table_param");
if (table == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
psuba = pta[4].value.const_refs;
/*
* We know that d0 > 0, so code will always be set in the loop:
@@ -243,14 +243,14 @@ cie_3d_table_param(const ref * ptable, uint count, uint nbytes,
check_read_type(*ptable, t_array);
if (r_size(ptable) != count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
rstrings = ptable->value.const_refs;
for (i = 0; i < count; ++i) {
const ref *const prt2 = rstrings + i;
check_read_type(*prt2, t_string);
if (r_size(prt2) != nbytes)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
strings[i].data = prt2->value.const_bytes;
strings[i].size = nbytes;
}
@@ -444,10 +444,10 @@ ciedefgspace(i_ctx_t *i_ctx_p, ref *CIEDict, ulong dictkey)
procs = istate->colorspace[0].procs.cie;
if (pcs == NULL ) {
if ((code = dict_find_string(CIEDict, "Table", &ptref)) <= 0)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
check_read_type(*ptref, t_array);
if (r_size(ptref) != 5)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Stable memory due to current caching of color space */
code = gs_cspace_build_CIEDEFG(&pcs, NULL, mem->stable_memory);
if (code < 0)
@@ -544,10 +544,10 @@ ciedefspace(i_ctx_t *i_ctx_p, ref *CIEDict, ulong dictkey)
procs = istate->colorspace[0].procs.cie;
if (pcs == NULL ) {
if ((code = dict_find_string(CIEDict, "Table", &ptref)) <= 0)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
check_read_type(*ptref, t_array);
if (r_size(ptref) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Stable memory due to current caching of color space */
code = gs_cspace_build_CIEDEF(&pcs, NULL, mem->stable_memory);
if (code < 0)
diff --git a/gs/psi/zcolor.c b/gs/psi/zcolor.c
index 2206f6db5..424ef53c8 100644
--- a/gs/psi/zcolor.c
+++ b/gs/psi/zcolor.c
@@ -168,21 +168,21 @@ zcurrentcolorspace(i_ctx_t * i_ctx_p)
if (r_size(&namestr) == 10 && !memcmp(namestr.value.bytes, "DeviceGray", 10)) {
body = ialloc_string(32, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "systemdict /DeviceGray_array get", 32);
make_string(&stref, a_all | icurrent_space, 32, body);
} else {
if (r_size(&namestr) == 9 && !memcmp(namestr.value.bytes, "DeviceRGB", 9)) {
body = ialloc_string(31, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "systemdict /DeviceRGB_array get", 31);
make_string(&stref, a_all | icurrent_space, 31, body);
} else {
if (r_size(&namestr) == 10 && !memcmp(namestr.value.bytes, "DeviceCMYK", 10)) {
body = ialloc_string(32, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "systemdict /DeviceCMYK_array get", 32);
make_string(&stref, a_all | icurrent_space, 32, body);
} else {
@@ -480,7 +480,7 @@ zsetcolorspace(i_ctx_t * i_ctx_p)
/* Check its either a name (base space) or an array */
if (!r_has_type(op, t_name))
if (!r_is_array(op))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = validate_spaces(i_ctx_p, op, &depth);
if (code < 0)
@@ -545,7 +545,7 @@ setcolorspace_nosubst(i_ctx_t * i_ctx_p)
/* Check its either a name (base space) or an array */
if (!r_has_type(op, t_name))
if (!r_is_array(op))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = validate_spaces(i_ctx_p, op, &depth);
if (code < 0)
@@ -699,7 +699,7 @@ zcolor_remap_one_store(i_ctx_t *i_ctx_p, double min_value)
gx_transfer_map *pmap = r_ptr(esp, gx_transfer_map);
if (ref_stack_count(&o_stack) < transfer_map_size)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
for (i = 0; i < transfer_map_size; i++) {
double v;
int code =
@@ -762,7 +762,7 @@ zcolor_test(i_ctx_t *i_ctx_p)
os_ptr op = osp - (ncomp-1);
int i;
if (ref_stack_count(&o_stack) < ncomp)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
for (i = 0; i < ncomp; i++) {
if (r_has_type(op+i, t_real))
cv[i] = (gx_color_value)
@@ -771,7 +771,7 @@ zcolor_test(i_ctx_t *i_ctx_p)
cv[i] = (gx_color_value)
(op[i].value.intval * gx_max_color_value);
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
color = (*dev_proc(dev, encode_color)) (dev, cv);
(*dev_proc(dev, decode_color)) (dev, color, cv);
@@ -813,9 +813,9 @@ zcolor_test_all(i_ctx_t *i_ctx_p)
acceptable_error = gx_max_color_value / dev->color_info.max_color + 1;
if (ref_stack_count(&o_stack) < 1)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (!r_has_type(&osp[0], t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
steps = osp[0].value.intval;
for (i = 0; i < ncomp; i++) {
counter[i] = 0;
@@ -1130,14 +1130,14 @@ static int setgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
code = dict_find_string(systemdict, "NOSUBSTDEVICECOLORS", &nosubst);
if (code != 0) {
if (!r_has_type(nosubst, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (code != 0 && nosubst->value.boolval) {
*stage = 4;
*cont = 1;
body = ialloc_string(32, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "/DefaultGray ..nosubstdevicetest",32);
make_string(&stref, a_all | icurrent_space, 32, body);
r_set_attrs(&stref, a_executable);
@@ -1149,7 +1149,7 @@ static int setgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
*cont = 1;
body = ialloc_string(47, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "{/DefaultGray /ColorSpace findresource} stopped",47);
make_string(&stref, a_all | icurrent_space, 47, body);
r_set_attrs(&stref, a_executable);
@@ -1163,7 +1163,7 @@ static int setgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
case 1:
pcs = gs_cspace_new_DeviceGray(imemory);
if (pcs == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = gs_setcolorspace(igs, pcs);
if (code >= 0) {
gs_client_color *pcc = gs_currentcolor_inline(igs);
@@ -1179,7 +1179,7 @@ static int setgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
break;
case 2:
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (op->value.boolval) {
/* Failed to find the /DefaultGray CSA, so give up and
* just use DeviceGray
@@ -1211,7 +1211,7 @@ static int setgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
* to set DeviceGray. See gs_cspace.ps.
*/
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
pop(1);
*stage = 1;
*cont = 1;
@@ -1267,12 +1267,12 @@ static int graybasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, in
if (r_has_type(op, t_real)) {
Gray = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
Gray = (float)op->value.intval;
if (Gray < 0 || Gray > 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
switch (base) {
case 0:
@@ -1305,7 +1305,7 @@ static int graybasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, in
make_real(op, (float)1.0 - Gray);
break;
default:
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
return 0;
}
@@ -1314,10 +1314,10 @@ static int grayvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_com
os_ptr op = osp;
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (num_comps < 1)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (*values > 1.0)
*values = 1.0;
@@ -1354,14 +1354,14 @@ static int setrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
code = dict_find_string(systemdict, "NOSUBSTDEVICECOLORS", &nosubst);
if (code != 0) {
if (!r_has_type(nosubst, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (code != 0 && nosubst->value.boolval) {
*stage = 4;
*cont = 1;
body = ialloc_string(31, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "/DefaultRGB ..nosubstdevicetest",31);
make_string(&stref, a_all | icurrent_space, 31, body);
r_set_attrs(&stref, a_executable);
@@ -1373,7 +1373,7 @@ static int setrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
*cont = 1;
body = ialloc_string(46, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "{/DefaultRGB /ColorSpace findresource} stopped", 46);
make_string(&stref, a_all | icurrent_space, 46, body);
r_set_attrs(&stref, a_executable);
@@ -1386,7 +1386,7 @@ static int setrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
case 1:
pcs = gs_cspace_new_DeviceRGB(imemory);
if (pcs == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = gs_setcolorspace(igs, pcs);
if (code >= 0) {
gs_client_color *pcc = gs_currentcolor_inline(igs);
@@ -1404,7 +1404,7 @@ static int setrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
break;
case 2:
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (op->value.boolval) {
/* Failed to find the /DefaultRGB CSA, so give up and
* just use DeviceRGB
@@ -1435,7 +1435,7 @@ static int setrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
* to set DeviceGray. See gs-cspace.ps.
*/
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
pop(1);
*stage = 1;
*cont = 1;
@@ -1517,11 +1517,11 @@ static int rgbbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
if (r_has_type(op, t_real)) {
RGB[i] = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
RGB[i] = (float)op->value.intval;
if (RGB[i] < 0 || RGB[i] > 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
op++;
}
op = osp;
@@ -1582,7 +1582,7 @@ static int rgbbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
return o_push_estack;
break;
default:
- return_error(e_undefined);
+ return_error(gs_error_undefined);
break;
}
break;
@@ -1597,7 +1597,7 @@ static int rgbbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
if (r_has_type(op, t_real)) {
CMYK[i] = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
CMYK[i] = (float)op->value.intval;
op++;
@@ -1606,7 +1606,7 @@ static int rgbbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
if (r_has_type(op, t_real)) {
UCR = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
UCR = (float)op->value.intval;
for (i=0;i<3;i++) {
@@ -1634,7 +1634,7 @@ static int rgbbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
if (r_has_type(op, t_real)) {
BG = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
BG = (float)op->value.intval;
pop(1);
@@ -1654,12 +1654,12 @@ static int rgbvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comp
int i;
if (num_comps < 3)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 2;
for (i=0;i<3;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
@@ -1702,14 +1702,14 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
code = dict_find_string(systemdict, "NOSUBSTDEVICECOLORS", &nosubst);
if (code != 0) {
if (!r_has_type(nosubst, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (code != 0 && nosubst->value.boolval) {
*stage = 4;
*cont = 1;
body = ialloc_string(32, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "/DefaultCMYK ..nosubstdevicetest",32);
make_string(&stref, a_all | icurrent_space, 32, body);
r_set_attrs(&stref, a_executable);
@@ -1721,7 +1721,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
*cont = 1;
body = ialloc_string(47, "string");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(body, "{/DefaultCMYK /ColorSpace findresource} stopped", 47);
make_string(&stref, a_all | icurrent_space, 47, body);
r_set_attrs(&stref, a_executable);
@@ -1734,7 +1734,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
case 1:
pcs = gs_cspace_new_DeviceCMYK(imemory);
if (pcs == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = gs_setcolorspace(igs, pcs);
if (code >= 0) {
gs_client_color *pcc = gs_currentcolor_inline(igs);
@@ -1753,7 +1753,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
break;
case 2:
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (op->value.boolval) {
/* Failed to find the /DefaultCMYK CSA, so give up and
* just use DeviceCMYK
@@ -1784,7 +1784,7 @@ static int setcmykspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
* to set DeviceGray. See gs-cspace.ps.
*/
if (!r_has_type(op, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
pop(1);
*stage = 1;
*cont = 1;
@@ -1865,11 +1865,11 @@ static int cmykbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, in
if (r_has_type(op, t_real)) {
CMYK[i] = op->value.realval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
CMYK[i] = (float)op->value.intval;
if (CMYK[i] < 0 || CMYK[i] > 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
op++;
}
@@ -1911,7 +1911,7 @@ static int cmykbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, in
make_real(op, CMYK[3]);
break;
default:
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
return 0;
}
@@ -1921,12 +1921,12 @@ static int cmykvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_com
int i;
if (num_comps < 4)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 3;
for (i=0;i < 4;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
@@ -2075,9 +2075,9 @@ static int get_cie_param_array(const gs_memory_t *mem, const ref *src, int n, f
else if (r_has_type(&valref, t_real))
dst[i] = (float)valref.value.realval;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (dst[i] < -MAX_CIE_RANGE || dst[i] > MAX_CIE_RANGE)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
return code;
}
@@ -2094,12 +2094,12 @@ static int checkWhitePoint(i_ctx_t * i_ctx_p, ref *CIEdict)
return code;
if (code == 0 || r_has_type(tempref, t_null))
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 3, value);
if (code < 0)
@@ -2107,7 +2107,7 @@ static int checkWhitePoint(i_ctx_t * i_ctx_p, ref *CIEdict)
/* Xw and Zw must be positive and Yw must be 1 (3rd edition PLRM p230) */
if (value[0] < 0 || value[1] != 1 || value[2] < 0 )
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return 0;
}
@@ -2121,9 +2121,9 @@ static int checkBlackPoint(i_ctx_t * i_ctx_p, ref *CIEdict)
code = dict_find_string(CIEdict, "BlackPoint", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 3, value);
if (code < 0)
@@ -2141,14 +2141,14 @@ static int checkRangeLMN(i_ctx_t * i_ctx_p, ref *CIEdict)
code = dict_find_string(CIEdict, "RangeLMN", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 6, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
return 0;
}
@@ -2161,9 +2161,9 @@ static int checkDecodeLMN(i_ctx_t * i_ctx_p, ref *CIEdict)
code = dict_find_string(CIEdict, "DecodeLMN", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<3;i++) {
code = array_get(imemory, tempref, i, &valref);
@@ -2184,9 +2184,9 @@ static int checkMatrixLMN(i_ctx_t * i_ctx_p, ref *CIEdict)
code = dict_find_string(CIEdict, "MatrixLMN", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 9)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 9, value);
if (code < 0)
return code;
@@ -2202,12 +2202,12 @@ static int setcieaspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CI
ulong dictkey;
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_find_string(systemdict, "NOCIE", &nocie);
if (code > 0) {
if (!r_has_type(nocie, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (nocie->value.boolval)
return setgrayspace(i_ctx_p, r, stage, cont, 1);
}
@@ -2238,10 +2238,10 @@ static int validatecieaspace(i_ctx_t * i_ctx_p, ref **r)
ref CIEdict, *CIEspace = *r, *tempref;
if (!r_is_array(CIEspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(CIEspace) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, CIEspace, 1, &CIEdict);
if (code < 0)
@@ -2261,15 +2261,15 @@ static int validatecieaspace(i_ctx_t * i_ctx_p, ref **r)
if (code > 0 && !r_has_type(tempref, t_null)) {
/* Array of two numbers A0 < A1 */
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 2, value);
if (code < 0)
return code;
if (value[1] < value[0])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
code = dict_find_string(&CIEdict, "DecodeA", &tempref);
@@ -2280,9 +2280,9 @@ static int validatecieaspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "MatrixA", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 3, value);
if (code < 0)
return code;
@@ -2360,10 +2360,10 @@ static int cieavalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_com
os_ptr op = osp;
if (num_comps < 1)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return 0;
}
@@ -2405,12 +2405,12 @@ static int setcieabcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
ulong dictkey;
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_find_string(systemdict, "NOCIE", &nocie);
if (code > 0) {
if (!r_has_type(nocie, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (nocie->value.boolval)
return setrgbspace(i_ctx_p, r, stage, cont, 1);
}
@@ -2444,10 +2444,10 @@ static int validatecieabcspace(i_ctx_t * i_ctx_p, ref **r)
ref CIEdict, *CIEspace = *r, *tempref, valref;
if (!r_is_array(CIEspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(CIEspace) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, CIEspace, 1, &CIEdict);
if (code < 0)
@@ -2465,22 +2465,22 @@ static int validatecieabcspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "RangeABC", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 6, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
code = dict_find_string(&CIEdict, "DecodeABC", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<3;i++) {
code = array_get(imemory, tempref, i, &valref);
@@ -2493,9 +2493,9 @@ static int validatecieabcspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "MatrixABC", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 9)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 9, value);
if (code < 0)
return code;
@@ -2568,12 +2568,12 @@ static int cieabcvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_c
int i;
if (num_comps < 3)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 2;
for (i=0;i<3;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
@@ -2617,12 +2617,12 @@ static int setciedefspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
ulong dictkey;
if (i_ctx_p->language_level < 3)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_find_string(systemdict, "NOCIE", &nocie);
if (code > 0) {
if (!r_has_type(nocie, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (nocie->value.boolval)
return setrgbspace(i_ctx_p, r, stage, cont, 1);
}
@@ -2655,10 +2655,10 @@ static int validateciedefspace(i_ctx_t * i_ctx_p, ref **r)
ref CIEdict, *pref, *CIEspace = *r, tempref, valref;
if (!r_is_array(CIEspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(CIEspace) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, CIEspace, 1, &CIEdict);
if (code < 0)
@@ -2673,35 +2673,35 @@ static int validateciedefspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "Table", &pref);
if (code > 0) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, pref, 3, value);
if (code < 0)
return code;
if (value[0] <= 1 || value[1] <= 1 || value[2] <= 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, pref, 3, &valref);
if (code < 0)
return code;
if (!r_is_array(&valref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(&valref) != value[0])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<value[0];i++) {
code = array_get(imemory, &valref, i, &tempref);
if (code < 0)
return code;
if (!r_has_type(&tempref, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(&tempref) != (3 * value[1] * value[2]))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
} else {
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* Remaining parameters are optional, but we must validate
@@ -2710,22 +2710,22 @@ static int validateciedefspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "RangeDEF", &pref);
if (code > 0 && !r_has_type(&tempref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, pref, 6, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
code = dict_find_string(&CIEdict, "DecodeDEF", &pref);
if (code > 0 && !r_has_type(pref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<3;i++) {
code = array_get(imemory, pref, i, &valref);
@@ -2738,14 +2738,14 @@ static int validateciedefspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "RangeHIJ", &pref);
if (code > 0 && !r_has_type(pref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 6)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, pref, 6, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
*r = 0;
@@ -2799,12 +2799,12 @@ static int ciedefvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_c
int i;
if (num_comps < 3)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 2;
for (i=0;i<3;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
@@ -2856,12 +2856,12 @@ static int setciedefgspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
ulong dictkey;
if (i_ctx_p->language_level < 3)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_find_string(systemdict, "NOCIE", &nocie);
if (code > 0) {
if (!r_has_type(nocie, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (nocie->value.boolval)
return setcmykspace(i_ctx_p, r, stage, cont, 1);
}
@@ -2894,10 +2894,10 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
ref CIEdict, *CIEspace = *r, tempref, arrayref, valref, *pref = &tempref;
if (!r_is_array(CIEspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(CIEspace) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, CIEspace, 1, &CIEdict);
if (code < 0)
@@ -2911,9 +2911,9 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "Table", &pref);
if (code > 0) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 5)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<4;i++) {
code = array_get(imemory, pref, i, &valref);
@@ -2922,18 +2922,18 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
if (r_has_type(&valref, t_integer))
value[i] = (float)valref.value.intval;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (value[0] <= 1 || value[1] <= 1 || value[2] <= 1 || value[3] <= 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, pref, 4, &arrayref);
if (code < 0)
return code;
if (!r_is_array(&arrayref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(&arrayref) != value[0])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<value[0];i++) {
code = array_get(imemory, &arrayref, i, &tempref);
@@ -2944,14 +2944,14 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
if (code < 0)
return code;
if (!r_has_type(&valref, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(&valref) != (3 * value[2] * value[3]))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
} else {
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* Remaining parameters are optional, but we must validate
@@ -2960,22 +2960,22 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "RangeDEFG", &pref);
if (code > 0 && !r_has_type(pref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 8)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, pref, 8, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4] || value[7] < value[6])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
code = dict_find_string(&CIEdict, "DecodeDEFG", &pref);
if (code > 0 && !r_has_type(pref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<4;i++) {
code = array_get(imemory, pref, i, &valref);
@@ -2988,14 +2988,14 @@ static int validateciedefgspace(i_ctx_t * i_ctx_p, ref **r)
code = dict_find_string(&CIEdict, "RangeHIJK", &pref);
if (code > 0 && !r_has_type(pref, t_null)) {
if (!r_is_array(pref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pref) != 8)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, pref, 8, value);
if (code < 0)
return code;
if (value[1] < value[0] || value[3] < value[2] || value[5] < value[4] || value[7] < value[6])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
*r = 0;
@@ -3049,12 +3049,12 @@ static int ciedefgvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_
int i;
if (num_comps < 4)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 3;
for (i=0;i < 4;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
return 0;
@@ -3123,7 +3123,7 @@ static int ciebasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage, int
spacename = space;
/* Check that it really is a name */
if (!r_has_type(spacename, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Find the relevant color space object */
for (i=0;i<4;i++) {
@@ -3229,7 +3229,7 @@ static int setseparationspace(i_ctx_t * i_ctx_p, ref *sepspace, int *stage, int
gs_client_color cc;
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
*cont = 0;
if ((*stage) == 0) {
@@ -3322,10 +3322,10 @@ static int validateseparationspace(i_ctx_t * i_ctx_p, ref **space)
ref nameref, sref, sname, altspace, tref;
if (!r_is_array(sepspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(sepspace) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Check separation name is a string or name object */
code = array_get(imemory, sepspace, 1, &sname);
@@ -3333,7 +3333,7 @@ static int validateseparationspace(i_ctx_t * i_ctx_p, ref **space)
return code;
if (!r_has_type(&sname, t_name)) {
if (!r_has_type(&sname, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
else {
code = name_from_string(imemory, &sname, &sname);
if (code < 0)
@@ -3356,13 +3356,13 @@ static int validateseparationspace(i_ctx_t * i_ctx_p, ref **space)
else {
/* Make sure the alternate space is an array */
if (!r_is_array(&altspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* And has a name for its type */
code = array_get(imemory, &altspace, 0, &tref);
if (code < 0)
return code;
if (!r_has_type(&tref, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ref_assign(&nameref, &tref);
}
@@ -3371,15 +3371,15 @@ static int validateseparationspace(i_ctx_t * i_ctx_p, ref **space)
/* Check its not /Indexed or /Pattern or /DeviceN */
if (r_size(&sref) == 7) {
if (strncmp((const char *)sref.value.const_bytes, "Indexed", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (strncmp((const char *)sref.value.const_bytes, "Pattern", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (strncmp((const char *)sref.value.const_bytes, "DeviceN", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
/* and also not /Separation */
if (r_size(&sref) == 9 && strncmp((const char *)sref.value.const_bytes, "Separation", 9) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ref_assign(*space, &altspace);
return 0;
@@ -3500,10 +3500,10 @@ static int sepvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comp
os_ptr op = osp;
if (num_comps < 1)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (*values > 1.0)
*values = 1.0;
@@ -3650,7 +3650,7 @@ static int devicencolorants_cont(i_ctx_t *i_ctx_p)
sep_name = name_index(imemory, &space[0]);
break;
default:
- code = e_typecheck;
+ code = gs_error_typecheck;
}
}
make_int(pindex, ++index);
@@ -3678,7 +3678,7 @@ static int setdevicenspace(i_ctx_t * i_ctx_p, ref *devicenspace, int *stage, int
gs_client_color cc;
if (i_ctx_p->language_level < 3)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
*cont = 0;
if ((*stage) == 2) {
@@ -3781,7 +3781,7 @@ static int setdevicenspace(i_ctx_t * i_ctx_p, ref *devicenspace, int *stage, int
name_string_ref(imemory, &sname, &tname);
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
break;
}
if (strncmp((const char *)tname.value.const_bytes, "All", 3) == 0 && r_size(&tname) == 3) {
@@ -3853,7 +3853,7 @@ static int setdevicenspace(i_ctx_t * i_ctx_p, ref *devicenspace, int *stage, int
break;
default:
rc_decrement_cs(pcs, "setdevicenspace");
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
}
@@ -3893,19 +3893,19 @@ static int validatedevicenspace(i_ctx_t * i_ctx_p, ref **space)
/* Check enough arguments in the space */
if (r_size(devicenspace) < 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Check the names parameter is an array */
code = array_get(imemory, devicenspace, 1, &namesarray);
if (code < 0)
return code;
if (!r_is_array(&namesarray))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Ensure we have at least one ink */
if (r_size(&namesarray) < 1)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Make sure no more inks than we can cope with */
if (r_size(&namesarray) > MAX_COMPONENTS_IN_DEVN) /* MUST match psi/icremap.h int_remap_color_info_s */
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
/* Check the tint transform is a procedure */
code = array_get(imemory, devicenspace, 3, &proc);
if (code < 0)
@@ -3920,7 +3920,7 @@ static int validatedevicenspace(i_ctx_t * i_ctx_p, ref **space)
case t_name:
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
@@ -3933,28 +3933,28 @@ static int validatedevicenspace(i_ctx_t * i_ctx_p, ref **space)
else {
/* Make sure the alternate space is an array */
if (!r_is_array(&altspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* And has a name for its type */
code = array_get(imemory, &altspace, 0, &nameref);
if (code < 0)
return code;
if (!r_has_type(&nameref, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
/* Convert alternate space name to string */
name_string_ref(imemory, &nameref, &sref);
/* Check its not /Indexed, /Pattern, /DeviceN */
if (r_size(&sref) == 7) {
if (strncmp((const char *)sref.value.const_bytes, "Indexed", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (strncmp((const char *)sref.value.const_bytes, "Pattern", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (strncmp((const char *)sref.value.const_bytes, "DeviceN", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
/* and also not /Separation */
if (r_size(&sref) == 9 && strncmp((const char *)sref.value.const_bytes, "Separation", 9) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ref_assign(*space, &altspace);
return 0;
@@ -4033,7 +4033,7 @@ static int devicentransform(i_ctx_t *i_ctx_p, ref *devicenspace, int *usealterna
if (code < 0)
return code;
if (!r_is_array(&narray))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
for (i=0;i<r_size(&narray);i++) {
code = array_get(imemory, &narray, i, &sname);
@@ -4133,16 +4133,16 @@ static int devicenvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_
if (code < 0)
return code;
if (!r_is_array(&narray))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (num_comps < r_size(&narray))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= r_size(&narray) - 1;
for (i=0;i < r_size(&narray); i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (values[i] > 1.0)
values[i] = 1.0;
@@ -4263,7 +4263,7 @@ static int setindexedspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
gs_color_space_index base_type;
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
*cont = 0;
if (*stage == 1) {
@@ -4294,7 +4294,7 @@ static int setindexedspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
* these files without complaint, so we ignore the extra data.
*/
if (r_size(&lookup) < num_values)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* If we have a named color profile and the base space is DeviceN or
Separation use a different set of procedures to ensure the named
color remapping code is used */
@@ -4305,7 +4305,7 @@ static int setindexedspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
else
pcs = gs_cspace_alloc(imemory, &gs_color_space_type_Indexed);
if (!pcs) {
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
pcs->base_space = pcs_base;
rc_increment_cs(pcs_base);
@@ -4313,7 +4313,7 @@ static int setindexedspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
data_tmp = (byte *) (pcs->params.indexed.lookup.table.data = ialloc_string (lookup.tas.rsize, "setindexedspace"));
if (!data_tmp) {
rc_decrement(pcs, "setindexedspace");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
memcpy(data_tmp, lookup.value.const_bytes, lookup.tas.rsize);
@@ -4373,20 +4373,20 @@ static int validateindexedspace(i_ctx_t * i_ctx_p, ref **space)
ref nameref, sref, hival, lookup, altspace;
if (!r_is_array(r))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(r) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Check operand type(s) */
/* Make sure 'hival' is an integer */
code = array_get(imemory, r, 2, &hival);
if (code < 0)
return code;
if (!r_has_type(&hival, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Make sure 'hival' lies between 0 and 4096 */
if (hival.value.intval < 0 || hival.value.intval > 4096)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Ensure the 'lookup' is either a string or a procedure */
code = array_get(imemory, r, 3, &lookup);
if (code < 0)
@@ -4402,7 +4402,7 @@ static int validateindexedspace(i_ctx_t * i_ctx_p, ref **space)
ref_assign(&nameref, &altspace);
else {
if (!r_is_array(&altspace))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = array_get(imemory, &altspace, 0, &nameref);
if (code < 0)
return code;
@@ -4412,9 +4412,9 @@ static int validateindexedspace(i_ctx_t * i_ctx_p, ref **space)
/* Check its not /Indexed or /Pattern */
if (r_size(&sref) == 7) {
if (strncmp((const char *)sref.value.const_bytes, "Indexed", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (strncmp((const char *)sref.value.const_bytes, "Pattern", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
ref_assign(*space, &altspace);
return 0;
@@ -4494,7 +4494,7 @@ static int indexedbasecolor(i_ctx_t * i_ctx_p, ref *space, int base, int *stage,
/* We have a string, start by retrieving the index from the op stack */
/* Make sure its an integer! */
if (!r_has_type(op, t_integer))
- return_error (e_typecheck);
+ return_error (gs_error_typecheck);
index = op->value.intval;
/* And remove it from the stack. */
pop(1);
@@ -4535,10 +4535,10 @@ static int indexedvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_
os_ptr op = osp;
if (num_comps < 1)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = array_get(imemory, space, 2, &hival);
if (code < 0)
@@ -4567,7 +4567,7 @@ static int setpatternspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
int code = 0;
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
*cont = 0;
pcs_base = NULL;
@@ -4579,11 +4579,11 @@ static int setpatternspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
pcs_base = NULL;
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
case 2:
pcs_base = gs_currentcolorspace(igs);
if (cs_num_components(pcs_base) < 0) /* i.e., Pattern space */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
pcs = gs_cspace_alloc(imemory, &gs_color_space_type_Pattern);
@@ -4617,7 +4617,7 @@ static int validatepatternspace(i_ctx_t * i_ctx_p, ref **r)
} else
*r = 0;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
*r = 0;
return 0;
@@ -4637,7 +4637,7 @@ static int patternalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CI
} else
*r = 0;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
*r = 0;
return 0;
@@ -4670,7 +4670,7 @@ static int patterncomponent(i_ctx_t * i_ctx_p, ref *space, int *n)
} else
*n = 1;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return 0;
}
@@ -4735,7 +4735,7 @@ static int patternvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_
check_op(1);
if (!r_has_type(op, t_dictionary) && !r_has_type(op, t_null))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return 0;
}
@@ -4754,14 +4754,14 @@ static int setdevicepspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
* Preserve the old behaviour anyway.
*/
if (i_ctx_p->language_level < 2)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
*cont = 0;
code = array_get(imemory, r, 1, &bpp);
if (code < 0)
return code;
if (!r_has_type(&bpp, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = gs_cspace_new_DevicePixel(imemory, &pcs, (int)bpp.value.intval);
if (code < 0)
return code;
@@ -4777,20 +4777,20 @@ static int validatedevicepspace(i_ctx_t * i_ctx_p, ref **space)
ref *r = *space, bpp;
if (!r_is_array(r))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(r) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Make sure 'bits per pixel' is an integer */
code = array_get(imemory, r, 1, &bpp);
if (code < 0)
return code;
if (!r_has_type(&bpp, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Make sure 'bits per pixel' lies between 0 and 31 */
if (bpp.value.intval < 0 || bpp.value.intval > 31)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
*space = 0;
return code;
@@ -4847,7 +4847,7 @@ static int set_dev_space(i_ctx_t * i_ctx_p, int components)
code = setcmykspace(i_ctx_p, (ref *)0, &stage, &cont, 1);
break;
default:
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
break;
}
return code;
@@ -4865,9 +4865,9 @@ static int checkrangeab(i_ctx_t * i_ctx_p, ref *labdict)
code = dict_find_string(labdict, "Range", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<4;i++) {
code = array_get(imemory, tempref, i, &valref);
@@ -4878,10 +4878,10 @@ static int checkrangeab(i_ctx_t * i_ctx_p, ref *labdict)
else if (r_has_type(&valref, t_real))
value[i] = (float)valref.value.realval;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (value[1] < value[0] || value[3] < value[2] )
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
return 0;
}
@@ -4908,13 +4908,13 @@ static int setlabspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont,
dflt_range );
for (i = 0; i < 4 && range_buff[i + 1] >= range_buff[i]; i += 2);
if (i != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_floats_param( imemory, &labdict, "BlackPoint", 3, black,
dflt_black );
code = dict_floats_param( imemory, &labdict, "WhitePoint", 3, white,
dflt_white );
if (white[0] <= 0 || white[1] != 1.0 || white[2] <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = seticc_lab(i_ctx_p, white, black, range_buff);
if ( code < 0)
return gs_rethrow(code, "setting PDF lab color space");
@@ -4932,10 +4932,10 @@ static int validatelabspace(i_ctx_t * i_ctx_p, ref **r)
space = *r;
if (!r_is_array(space))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) < 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, space, 1, &labdict);
if (code < 0)
return code;
@@ -4977,7 +4977,7 @@ static int labrange(i_ctx_t * i_ctx_p, ref *space, float *ptr)
else if (r_has_type(&valref, t_real))
ptr[i] = (float)valref.value.realval;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
} else {
/* Default values for Lab */
@@ -5010,7 +5010,7 @@ static int labdomain(i_ctx_t * i_ctx_p, ref *space, float *ptr)
else if (r_has_type(&valref, t_real))
ptr[i] = (float)valref.value.realval;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
} else {
/* Default values for Lab */
@@ -5048,11 +5048,11 @@ static int labvalidate(i_ctx_t *i_ctx_p, ref *space, float *values, int num_comp
int i;
if (num_comps < 3)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
op -= 2;
for (i=0;i<3;i++) {
if (!r_has_type(op, t_integer) && !r_has_type(op, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
op++;
}
return 0;
@@ -5068,9 +5068,9 @@ static int checkCalMatrix(i_ctx_t * i_ctx_p, ref *CIEdict)
code = dict_find_string(CIEdict, "Matrix", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != 9)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_cie_param_array(imemory, tempref, 9, value);
if (code < 0)
return code;
@@ -5090,9 +5090,9 @@ static int checkGamma(i_ctx_t * i_ctx_p, ref *CIEdict, int numvalues)
if (numvalues > 1) {
/* Array of gammas (RGB) */
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) != numvalues)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<numvalues;i++) {
code = array_get(imemory, tempref, i, &valref);
if (code < 0)
@@ -5102,8 +5102,8 @@ static int checkGamma(i_ctx_t * i_ctx_p, ref *CIEdict, int numvalues)
else if (r_has_type(&valref, t_real))
value[i] = (float)valref.value.realval;
else
- return_error(e_typecheck);
- if (value[i] <= 0) return_error(e_rangecheck);
+ return_error(gs_error_typecheck);
+ if (value[i] <= 0) return_error(gs_error_rangecheck);
}
} else {
/* Single gamma (gray) */
@@ -5112,8 +5112,8 @@ static int checkGamma(i_ctx_t * i_ctx_p, ref *CIEdict, int numvalues)
else if (r_has_type(tempref, t_integer))
value[0] = (float)(tempref->value.intval);
else
- return_error(e_typecheck);
- if (value[0] <= 0) return_error(e_rangecheck);
+ return_error(gs_error_typecheck);
+ if (value[0] <= 0) return_error(gs_error_rangecheck);
}
}
return 0;
@@ -5136,7 +5136,7 @@ static int setcalgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
/* Get all the parts */
code = dict_float_param(&graydict, "Gamma",
dflt_gamma, &gamma);
- if (gamma <= 0 ) return_error(e_rangecheck);
+ if (gamma <= 0 ) return_error(gs_error_rangecheck);
code = dict_floats_param( imemory,
&graydict,
"BlackPoint",
@@ -5150,7 +5150,7 @@ static int setcalgrayspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
white,
dflt_white );
if (white[0] <= 0 || white[1] != 1.0 || white[2] <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = seticc_cal(i_ctx_p, white, black, &gamma, NULL, 1,
graydict.value.saveid);
if ( code < 0)
@@ -5168,10 +5168,10 @@ static int validatecalgrayspace(i_ctx_t * i_ctx_p, ref **r)
space = *r;
if (!r_is_array(space))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) < 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, space, 1, &calgraydict);
if (code < 0)
return code;
@@ -5218,7 +5218,7 @@ static int setcalrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
gamma,
dflt_gamma );
if (gamma[0] <= 0 || gamma[1] <= 0 || gamma[2] <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_floats_param( imemory,
&rgbdict,
"BlackPoint",
@@ -5232,7 +5232,7 @@ static int setcalrgbspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int
white,
dflt_white );
if (white[0] <= 0 || white[1] != 1.0 || white[2] <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_floats_param( imemory,
&rgbdict,
"Matrix",
@@ -5256,15 +5256,15 @@ static int validatecalrgbspace(i_ctx_t * i_ctx_p, ref **r)
space = *r;
if (!r_is_array(space))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) < 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, space, 1, &calrgbdict);
if (code < 0)
return code;
if (!r_has_type(&calrgbdict, t_dictionary))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Check the white point, which is required */
code = checkWhitePoint(i_ctx_p, &calrgbdict);
if (code != 0)
@@ -5297,7 +5297,7 @@ static int seticcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
code = dict_find_string(systemdict, "NOCIE", &nocie);
if (code > 0) {
if (!r_has_type(nocie, t_boolean))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
*cont = 0;
do {
@@ -5311,10 +5311,10 @@ static int seticcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
components = tempref->value.intval;
if (components > count_of(range)/2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Don't allow ICCBased spaces if NOCIE is true */
if (nocie && nocie->value.boolval) {
@@ -5345,7 +5345,7 @@ static int seticcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
return code;
code = dict_find_string(&ICCdict, "DataSource", &tempref);
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
/* Check for string based ICC and convert to a file */
if (r_has_type(tempref, t_string)){
uint n = r_size(tempref);
@@ -5396,7 +5396,7 @@ static int seticcspace(i_ctx_t * i_ctx_p, ref *r, int *stage, int *cont, int CIE
code = 0;
break;
default:
- return_error (e_rangecheck);
+ return_error (gs_error_rangecheck);
break;
}
}while(*stage);
@@ -5454,10 +5454,10 @@ static int validateiccspace(i_ctx_t * i_ctx_p, ref **r)
space = *r;
if (!r_is_array(space))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, space, 1, &ICCdict);
if (code < 0)
@@ -5469,35 +5469,35 @@ static int validateiccspace(i_ctx_t * i_ctx_p, ref **r)
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
if (!r_has_type(tempref, t_null)) {
if (!r_has_type(tempref, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
components = tempref->value.intval;
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = dict_find_string(&ICCdict, "DataSource", &tempref);
if (code <= 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (!r_has_type(tempref, t_null)) {
if (!r_has_type(tempref, t_string) && !r_has_type(tempref, t_file))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Following are optional entries */
code = dict_find_string(&ICCdict, "Range", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
if (!r_is_array(tempref))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(tempref) < (components * 2))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0;i<components * 2;i++) {
code = array_get(imemory, tempref, i, &valref);
if (code < 0)
return code;
if (!r_has_type(&valref, t_integer) && !r_has_type(&valref, t_real))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
code = dict_find_string(&ICCdict, "Alternate", &tempref);
@@ -5506,22 +5506,22 @@ static int validateiccspace(i_ctx_t * i_ctx_p, ref **r)
if (r_has_type(tempref, t_name)) {
name_string_ref(imemory, tempref, &sref);
if (sref.value.bytes && strncmp((const char *)sref.value.bytes, "Pattern", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else {
if (r_is_array(tempref)) {
code = array_get(imemory, tempref, 0, &valref);
if (code < 0)
return code;
if (!r_has_type(&valref, t_name) && !r_has_type(&valref, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_has_type(&valref, t_name))
name_string_ref(imemory, &valref, &sref);
else
sref.value.bytes = valref.value.bytes;
if (sref.value.bytes && strncmp((const char *)sref.value.bytes, "Pattern", 7) == 0)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
} else {
ref nameref;
@@ -5537,7 +5537,7 @@ static int validateiccspace(i_ctx_t * i_ctx_p, ref **r)
code = name_enter_string(imemory, "DeviceCMYK", &nameref);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* In case this space is the /ALternate for a previous ICCBased space
* insert the named space into the ICC dictionary. If we simply returned
@@ -5560,10 +5560,10 @@ static int iccalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CIESub
ref *tempref, ICCdict;
if (!r_is_array(space))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Validate parameters, check we have enough operands */
if (r_size(space) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = array_get(imemory, space, 1, &ICCdict);
if (code < 0)
@@ -5573,7 +5573,7 @@ static int iccalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CIESub
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
components = tempref->value.intval;
@@ -5592,7 +5592,7 @@ static int iccalternatespace(i_ctx_t * i_ctx_p, ref *space, ref **r, int *CIESub
code = name_enter_string(imemory, "DeviceCMYK", *r);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
*CIESubst = 1;
@@ -5611,7 +5611,7 @@ static int icccomponents(i_ctx_t * i_ctx_p, ref *space, int *n)
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
*n = tempref->value.intval;
return 0;
}
@@ -5627,7 +5627,7 @@ static int iccdomain(i_ctx_t * i_ctx_p, ref *space, float *ptr)
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
components = tempref->value.intval;
code = dict_find_string(&ICCdict, "Range", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
@@ -5660,7 +5660,7 @@ static int iccrange(i_ctx_t * i_ctx_p, ref *space, float *ptr)
if (code < 0)
return code;
if (code == 0)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
components = tempref->value.intval;
code = dict_find_string(&ICCdict, "Range", &tempref);
if (code > 0 && !r_has_type(tempref, t_null)) {
@@ -5775,7 +5775,7 @@ int get_space_object(i_ctx_t *i_ctx_p, ref *arr, PS_colour_space_t **obj)
/* Check that it really is a name */
if (!r_has_type(&spacename, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Find the relevant color space object */
for (i=0;i<nprocs;i++) {
@@ -5787,7 +5787,7 @@ int get_space_object(i_ctx_t *i_ctx_p, ref *arr, PS_colour_space_t **obj)
return 0;
}
}
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
/*
* This routine checks all the color spaces in an operand by
@@ -5861,7 +5861,7 @@ setcolor_cont(i_ctx_t *i_ctx_p)
if (i < (depth)) {
if (!obj->alternateproc) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = obj->alternateproc(i_ctx_p, parr, &parr, &CIESubst);
if (code < 0)
@@ -5936,7 +5936,7 @@ setcolorspace_cont(i_ctx_t *i_ctx_p)
if (i < (depth - 1)) {
if (!obj->alternateproc) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = obj->alternateproc(i_ctx_p, parr, &parr, &CIESubst);
if (code < 0)
@@ -6242,7 +6242,7 @@ currentbasecolor_cont(i_ctx_t *i_ctx_p)
if (i < (depth - 1)) {
if (!obj->alternateproc) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = obj->alternateproc(i_ctx_p, parr, &parr, &CIESubst);
if (code < 0)
diff --git a/gs/psi/zcontext.c b/gs/psi/zcontext.c
index 5c6669736..5b7d2bb18 100644
--- a/gs/psi/zcontext.c
+++ b/gs/psi/zcontext.c
@@ -438,7 +438,7 @@ ctx_reschedule(i_ctx_t **pi_ctx_p)
if (current != 0)
context_store(psched, current);
lprintf("No context to run!");
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
/* See above for an explanation of the following test. */
if (ready->state.memory.space_local->saved != 0 &&
@@ -518,7 +518,7 @@ zdetach(i_ctx_t *i_ctx_p)
if_debug2('\'', "[']detach %ld, status = %d\n",
pctx->index, pctx->status);
if (pctx->joiner_index != 0 || pctx->detach)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
switch (pctx->status) {
case cs_active:
pctx->detach = true;
@@ -552,7 +552,7 @@ zfork(i_ctx_t *i_ctx_p)
ref rnull;
if (mcount == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
make_null(&rnull);
return do_fork(i_ctx_p, op, &rnull, &rnull, mcount, false);
}
@@ -564,7 +564,7 @@ zlocalfork(i_ctx_t *i_ctx_p)
int code;
if (mcount == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
code = values_older_than(&o_stack, 1, mcount - 1, avm_local);
if (code < 0)
return code;
@@ -592,7 +592,7 @@ do_fork(i_ctx_t *i_ctx_p, os_ptr op, const ref * pstdin, const ref * pstdout,
check_proc(*op);
if (iimemory_local->save_level)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
if (r_has_type(pstdout, t_null)) {
code = zget_stdout(i_ctx_p, &s);
if (code < 0)
@@ -619,7 +619,7 @@ do_fork(i_ctx_t *i_ctx_p, os_ptr op, const ref * pstdin, const ref * pstdout,
if (dict_find_string(systemdict, "userdict", &puserdict) <= 0 ||
!r_has_type(puserdict, t_dictionary)
)
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
old_userdict = *puserdict;
userdict_size = dict_maxlength(&old_userdict);
lmem = ialloc_alloc_state(parent, iimemory_local->chunk_size);
@@ -627,7 +627,7 @@ do_fork(i_ctx_t *i_ctx_p, os_ptr op, const ref * pstdin, const ref * pstdout,
if (lmem == 0 || lmem_stable == 0) {
gs_free_object(parent, lmem_stable, "do_fork");
gs_free_object(parent, lmem, "do_fork");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
lmem->space = avm_local;
lmem_stable->space = avm_local;
@@ -759,7 +759,7 @@ values_older_than(const ref_stack_t * pstack, uint first, uint last,
for (i = first; i <= last; ++i)
if (r_space(ref_stack_index(pstack, (long)i)) >= next_space)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
return 0;
}
@@ -794,7 +794,7 @@ fork_done(i_ctx_t *i_ctx_p)
if (dict_find_string(systemdict, "restore", &prestore) <= 0) {
lprintf("restore not found in systemdict!");
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
if (pcur->detach) {
ref_stack_clear(&o_stack); /* help avoid invalidrestore */
@@ -866,7 +866,7 @@ zjoin(i_ctx_t *i_ctx_p)
current->state.memory.space_local ||
iimemory_local->save_level != 0
)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
switch (pctx->status) {
case cs_active:
/*
@@ -914,7 +914,7 @@ finish_join(i_ctx_t *i_ctx_p)
if_debug2('\'', "[']finish_join %ld, status = %d\n",
pctx->index, pctx->status);
if (pctx->joiner_index != current->index)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
pctx->joiner_index = 0;
return zjoin(i_ctx_p);
}
@@ -958,7 +958,7 @@ zcondition(i_ctx_t *i_ctx_p)
ialloc_struct(gs_condition_t, &st_condition, "zcondition");
if (pcond == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
pcond->waiting.head_index = pcond->waiting.tail_index = 0;
push(1);
make_istruct(op, a_all, pcond);
@@ -973,7 +973,7 @@ zlock(i_ctx_t *i_ctx_p)
gs_lock_t *plock = ialloc_struct(gs_lock_t, &st_lock, "zlock");
if (plock == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
plock->holder_index = 0;
plock->waiting.head_index = plock->waiting.tail_index = 0;
push(1);
@@ -1002,7 +1002,7 @@ zmonitor(i_ctx_t *i_ctx_p)
pctx->state.memory.space_local ==
current->state.memory.space_local)
)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
}
/*
* We push on the e-stack:
@@ -1089,7 +1089,7 @@ zwait(i_ctx_t *i_ctx_p)
(iimemory_local->save_level != 0 &&
(r_space(op - 1) == avm_local || r_space(op) == avm_local))
)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
check_estack(1);
lock_release(op - 1);
add_last(psched, &pcond->waiting, pctx);
@@ -1177,7 +1177,7 @@ context_create(gs_scheduler_t * psched, gs_context_t ** ppctx,
pctx = gs_alloc_struct(mem, gs_context_t, &st_context, "context_create");
if (pctx == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (copy_state) {
pctx->state = *i_ctx_p;
} else {
@@ -1221,7 +1221,7 @@ context_param(const gs_scheduler_t * psched, os_ptr op, gs_context_t ** ppctx)
check_type(*op, t_integer);
pctx = index_context(psched, op->value.intval);
if (pctx == 0)
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
*ppctx = pctx;
return 0;
}
@@ -1283,7 +1283,7 @@ lock_acquire(os_ptr op, gs_context_t * pctx)
return o_reschedule;
}
-/* Release a lock. Return 0 if OK, e_invalidcontext if not. */
+/* Release a lock. Return 0 if OK, gs_error_invalidcontext if not. */
static int
lock_release(ref * op)
{
@@ -1296,7 +1296,7 @@ lock_release(ref * op)
activate_waiting(psched, &plock->waiting);
return 0;
}
- return_error(e_invalidcontext);
+ return_error(gs_error_invalidcontext);
}
/* ------ Initialization procedure ------ */
diff --git a/gs/psi/zcontrol.c b/gs/psi/zcontrol.c
index 4bfe49480..5509fe7d7 100644
--- a/gs/psi/zcontrol.c
+++ b/gs/psi/zcontrol.c
@@ -48,7 +48,7 @@ zcond(i_ctx_t *i_ctx_p)
return_op_typecheck(op);
check_execute(*op);
if ((r_size(op) & 1) != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (r_size(op) == 0)
return zpop(i_ctx_p);
check_estack(3);
@@ -142,7 +142,7 @@ zexecn(i_ctx_t *i_ctx_p)
r_has_attr(rp, a_executable)
) {
esp = esp_orig;
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
}
/* Executable nulls have a special meaning on the e-stack, */
@@ -482,7 +482,7 @@ zrepeat(i_ctx_t *i_ctx_p)
check_proc(*op);
check_type(op[-1], t_integer);
if (op[-1].value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_estack(5);
/* Push a mark, the count, and the procedure, and invoke */
/* the continuation operator. */
@@ -558,7 +558,7 @@ zexit(i_ctx_t *i_ctx_p)
pop_estack(i_ctx_p, scanned + (used - count + 1));
return o_pop_estack;
case es_stopped:
- return_error(e_invalidexit); /* not a loop */
+ return_error(gs_error_invalidexit); /* not a loop */
}
scanned += used;
} while (ref_stack_enum_next(&rsenum));
@@ -754,7 +754,7 @@ push_execstack(i_ctx_t *i_ctx_p, os_ptr op1, bool include_marks,
size = r_size(op1);
depth = count_exec_stack(i_ctx_p, include_marks);
if (depth > size)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_write(*op1);
{
int code = ref_stack_store_check(&e_stack, op1, size, 0);
@@ -853,7 +853,7 @@ execstack2_continue(i_ctx_t *i_ctx_p)
static int
zneedinput(i_ctx_t *i_ctx_p)
{
- return e_NeedInput; /* interpreter will exit to caller */
+ return gs_error_NeedInput; /* interpreter will exit to caller */
}
/* <obj> <int> .quit - */
@@ -864,7 +864,7 @@ zquit(i_ctx_t *i_ctx_p)
check_op(2);
check_type(*op, t_integer);
- return_error(e_Quit); /* Interpreter will do the exit */
+ return_error(gs_error_Quit); /* Interpreter will do the exit */
}
/* - currentfile <file> */
@@ -987,7 +987,7 @@ check_for_exec(const_os_ptr op)
ref_type_uses_access(r_type(op)) &&
(r_has_attr(op, a_executable) || !r_has_type(op, t_dictionary))
) {
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
return 0;
}
@@ -1081,6 +1081,6 @@ static int
unmatched_exit(os_ptr op, op_proc_t opproc)
{
make_oper(op - 1, 0, opproc);
- make_int(op, e_invalidexit);
- return_error(e_Quit);
+ make_int(op, gs_error_invalidexit);
+ return_error(gs_error_Quit);
}
diff --git a/gs/psi/zcrd.c b/gs/psi/zcrd.c
index 087844a54..8e6a5b9d3 100644
--- a/gs/psi/zcrd.c
+++ b/gs/psi/zcrd.c
@@ -180,7 +180,7 @@ zcrd1_proc_params(const gs_memory_t *mem,
if (code < 0)
return code;
if (code == 1)
- return gs_note_error(e_undefined);
+ return gs_note_error(gs_error_undefined);
if (dict_find_string(op, "RenderTable", &pRT) > 0) {
const ref *prte;
int size;
@@ -189,7 +189,7 @@ zcrd1_proc_params(const gs_memory_t *mem,
check_read_type(*pRT, t_array);
size = r_size(pRT);
if (size < 5)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
prte = pRT->value.const_refs;
for (i = 5; i < size; i++)
check_proc_only(prte[i]);
@@ -235,11 +235,11 @@ zcrd1_params(os_ptr op, gs_cie_render * pcrd,
/* Finish unpacking and checking the RenderTable parameter. */
check_type_only(prte[4], t_integer);
if (!(prte[4].value.intval == 3 || prte[4].value.intval == 4))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
prtl->n = 3;
prtl->m = prte[4].value.intval;
if (r_size(pRT) != prtl->m + 5)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = cie_table_param(pRT, prtl, mem);
if (code < 0)
return code;
@@ -275,7 +275,7 @@ cie_cache_joint(i_ctx_t *i_ctx_p, const ref_cie_render_procs * pcrprocs,
if (pcrd == 0) /* cache is not set up yet */
return 0;
if (pjc == 0) /* must already be allocated */
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (r_has_type(&pcrprocs->TransformPQR, t_null)) {
/*
* This CRD came from a driver, not from a PostScript dictionary.
@@ -344,7 +344,7 @@ cie_post_exec_tpqr(i_ctx_t *i_ctx_p)
ref vref;
if (count < 2)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
vref = *op;
ref_stack_pop(&o_stack, count - 1);
*osp = vref;
@@ -398,7 +398,7 @@ ztpqr_scale_wb_common(i_ctx_t *i_ctx_p, int idx)
}
if (a[0] == a[1])
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
result = a[3] + (a[2] - a[3]) * (Ps - a[1]) / (a[0] - a[1]);
make_real(op - 4, result);
pop(4);
diff --git a/gs/psi/zdevice.c b/gs/psi/zdevice.c
index 23adf09de..34cc697dd 100644
--- a/gs/psi/zdevice.c
+++ b/gs/psi/zdevice.c
@@ -148,7 +148,7 @@ zgetbitsrect(i_ctx_t *i_ctx_p)
else if (op[-2].value.intval == 1)
options |= GB_ALPHA_LAST;
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (r_has_type(op - 1, t_null)) {
options |= GB_COLORS_NATIVE;
depth = dev->color_info.depth;
@@ -164,19 +164,19 @@ zgetbitsrect(i_ctx_t *i_ctx_p)
std_depth = (int)op[-1].value.intval;
depth_option = depths[std_depth];
if (depth_option == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
options |= depth_option | GB_COLORS_NATIVE;
depth = (dev->color_info.num_components +
(options & GB_ALPHA_NONE ? 0 : 1)) * std_depth;
}
if (w == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
raster = (w * depth + 7) >> 3;
check_write_type(*op, t_string);
num_rows = r_size(op) / raster;
h = min(h, num_rows);
if (h == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
rect.q.x = rect.p.x + w;
rect.q.y = rect.p.y + h;
params.options = options;
@@ -200,10 +200,10 @@ zgetdevice(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval != (int)(op->value.intval))
- return_error(e_rangecheck); /* won't fit in an int */
+ return_error(gs_error_rangecheck); /* won't fit in an int */
dev = gs_getdevice((int)(op->value.intval));
if (dev == 0) /* index out of range */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Device prototypes are read-only; */
/* the cast is logically unnecessary. */
make_tav(op, t_device, avm_foreign | a_readonly, pdevice,
@@ -220,7 +220,7 @@ zgetdefaultdevice(i_ctx_t *i_ctx_p)
dev = gs_getdefaultlibdevice(imemory);
if (dev == 0) /* couldn't find a default device */
- return_error(e_unknownerror);
+ return_error(gs_error_unknownerror);
push(1);
make_tav(op, t_device, avm_foreign | a_readonly, pdevice,
(gx_device *) dev);
@@ -297,13 +297,13 @@ zmakewordimagedevice(i_ctx_t *i_ctx_p)
if (op1->value.intval != 16 && op1->value.intval != 24 &&
op1->value.intval != 32
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
colors = 0;
colors_size = -op1->value.intval;
} else {
check_type(*op1, t_string); /* palette */
if (r_size(op1) > 3 * 256)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
colors = op1->value.bytes;
colors_size = r_size(op1);
}
@@ -403,12 +403,12 @@ zputdeviceparams(i_ctx_t *i_ctx_p)
int i, dest;
if (count == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
prequire_all = ref_stack_index(&o_stack, count);
ppolicy = ref_stack_index(&o_stack, count + 1);
pdev = ref_stack_index(&o_stack, count + 2);
if (pdev == 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type_only(*prequire_all, t_boolean);
check_write_type_only(*pdev, t_device);
dev = pdev->value.pdevice;
@@ -469,7 +469,7 @@ zsetdevice(i_ctx_t *i_ctx_p)
check_write_type(*op, t_device);
if (dev->LockSafetyParams) { /* do additional checking if locked */
if(op->value.pdevice != dev) /* don't allow a different device */
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
dev->ShowpageCount = 0;
#ifndef PSI_INCLUDED
@@ -533,7 +533,7 @@ zspec_op(i_ctx_t *i_ctx_p)
/* At the very minimum we need a name object telling us which sepc_op to perform */
check_op(1);
if (!r_has_type(op, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ref_assign(&opname, op);
@@ -549,7 +549,7 @@ zspec_op(i_ctx_t *i_ctx_p)
}
if (proc < 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
pop(1); /* We don't need the name of the spec_op any more */
op = osp;
@@ -565,14 +565,14 @@ zspec_op(i_ctx_t *i_ctx_p)
*/
check_op(1);
if (!r_has_type(op, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ref_assign(&opname, op);
name_string_ref(imemory, &opname, &namestr);
data = (char *)gs_alloc_bytes(imemory, r_size(&namestr) + 1, "temporary special_op string");
if (data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memset(data, 0x00, r_size(&namestr) + 1);
memcpy(data, namestr.value.bytes, r_size(&namestr));
@@ -608,7 +608,7 @@ zspec_op(i_ctx_t *i_ctx_p)
* containing the names should mirror the entries in this switch. If we
* found a name there should be a matching case here.
*/
- return_error(e_undefined);
+ return_error(gs_error_undefined);
break;
}
return 0;
diff --git a/gs/psi/zdevice2.c b/gs/psi/zdevice2.c
index f391da15d..28a925520 100644
--- a/gs/psi/zdevice2.c
+++ b/gs/psi/zdevice2.c
@@ -100,7 +100,7 @@ zsetpagedevice(i_ctx_t *i_ctx_p)
/******
if ( igs->in_cachedevice )
- return_error(e_undefined);
+ return_error(gs_error_undefined);
******/
if (r_has_type(op, t_dictionary)) {
check_dict_read(*op);
@@ -110,7 +110,7 @@ zsetpagedevice(i_ctx_t *i_ctx_p)
* the dictionary must be allocated in local VM.
*/
if (!(r_is_local(op)))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
#endif /****************/
/* Make the dictionary read-only. */
code = zreadonly(i_ctx_p);
@@ -175,7 +175,7 @@ zcallendpage(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code > 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} else {
code = (op->value.intval == 2 ? 0 : 1);
}
diff --git a/gs/psi/zdict.c b/gs/psi/zdict.c
index c888ce964..4ffa49509 100644
--- a/gs/psi/zdict.c
+++ b/gs/psi/zdict.c
@@ -34,7 +34,7 @@ zdict(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return dict_create((uint) op->value.intval, op);
}
@@ -62,7 +62,7 @@ zbegin(i_ctx_t *i_ctx_p)
int code = ref_stack_extend(&d_stack, 1);
if ( code < 0 ) {
- if (code == e_dictstackoverflow) {
+ if (code == gs_error_dictstackoverflow) {
/* Adobe doesn't restore the operand that caused stack */
/* overflow. We do the same to match CET 20-02-02 */
pop(1);
@@ -83,7 +83,7 @@ zend(i_ctx_t *i_ctx_p)
{
if (ref_stack_count_inline(&d_stack) == min_dstack_size) {
/* We would underflow the d-stack. */
- return_error(e_dictstackunderflow);
+ return_error(gs_error_dictstackunderflow);
}
while (dsp == dsbot) {
/* We would underflow the current block. */
@@ -120,9 +120,9 @@ zop_def(i_ctx_t *i_ctx_p)
break; /* handle all slower cases */
}
case t_null:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
}
/*
* Combine the check for a writable top dictionary with
@@ -134,7 +134,7 @@ zop_def(i_ctx_t *i_ctx_p)
* If the dictionary is writable, the problem must be
* an invalid store.
*/
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
/*
* Save a level of procedure call in the common (redefinition)
@@ -172,13 +172,13 @@ zload(i_ctx_t *i_ctx_p)
case t_name:
/* Use the fast lookup. */
if ((pvalue = dict_find_name(op)) == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
ref_assign(op, pvalue);
return 0;
case t_null:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default: {
/* Use an explicit loop. */
uint size = ref_stack_count(&d_stack);
@@ -193,7 +193,7 @@ zload(i_ctx_t *i_ctx_p)
return 0;
}
}
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
}
}
@@ -215,7 +215,7 @@ zundef(i_ctx_t *i_ctx_p)
if (i_ctx_p->in_superexec == 0)
check_dict_write(*op1);
code = idict_undef(op1, op);
- if (code < 0 && code != e_undefined) /* ignore undefined error */
+ if (code < 0 && code != gs_error_undefined) /* ignore undefined error */
return code;
pop(2);
return 0;
@@ -234,7 +234,7 @@ zknown(i_ctx_t *i_ctx_p)
check_dict_read(*op1);
code = dict_find(op1, op, &pvalue);
switch (code) {
- case e_dictfull:
+ case gs_error_dictfull:
code = 0;
case 0: case 1:
break;
@@ -265,7 +265,7 @@ zwhere(i_ctx_t *i_ctx_p)
while (pdref-- > bot) {
check_dict_read(*pdref);
code = dict_find(pdref, op, &pvalue);
- if (code < 0 && code != e_dictfull)
+ if (code < 0 && code != gs_error_dictfull)
return code;
if (code > 0) {
push(1);
@@ -294,7 +294,7 @@ zcopy_dict(i_ctx_t *i_ctx_p)
if (!imemory->gs_lib_ctx->dict_auto_expand &&
(dict_length(op) != 0 || dict_maxlength(op) < dict_length(op1))
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = idict_copy(op1, op);
if (code < 0)
return code;
@@ -347,9 +347,9 @@ zdictstack(i_ctx_t *i_ctx_p)
if (!r_is_array(op))
return_op_typecheck(op);
if (r_size(op) < count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (!r_has_type_attrs(op, t_array, a_write))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
return ref_stack_store(&d_stack, op, count, 0, 0, true, idmemory,
"dictstack");
}
@@ -376,10 +376,10 @@ zdicttomark(i_ctx_t *i_ctx_p)
uint idx;
if (count2 == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
count2--;
if ((count2 & 1) != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_create(count2 >> 1, &rdict);
if (code < 0)
return code;
@@ -430,7 +430,7 @@ zforcecopynew(i_ctx_t *i_ctx_p)
/*check_dict_write(*op);*/ /* see above */
/* This is only recognized in Level 2 mode. */
if (!imemory->gs_lib_ctx->dict_auto_expand)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = idict_copy_new(op1, op);
if (code < 0)
return code;
@@ -508,10 +508,10 @@ zsetmaxlength(i_ctx_t *i_ctx_p)
check_dict_write(*op1);
check_type(*op, t_integer);
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
new_size = (uint) op->value.intval;
if (dict_length(op - 1) > new_size)
- return_error(e_dictfull);
+ return_error(gs_error_dictfull);
code = idict_resize(op - 1, new_size);
if (code >= 0)
pop(2);
diff --git a/gs/psi/zdouble.c b/gs/psi/zdouble.c
index 303af1cd5..20736fa5e 100644
--- a/gs/psi/zdouble.c
+++ b/gs/psi/zdouble.c
@@ -72,7 +72,7 @@ zddiv(i_ctx_t *i_ctx_p)
{
dbegin_binary();
if (num[1] == 0.0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
return double_result(i_ctx_p, 2, num[0] / num[1]);
}
@@ -137,7 +137,7 @@ zdsqrt(i_ctx_t *i_ctx_p)
{
dbegin_unary();
if (num < 0.0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return double_result(i_ctx_p, 1, sqrt(num));
}
@@ -179,7 +179,7 @@ zdatan(i_ctx_t *i_ctx_p)
dbegin_binary();
if (num[0] == 0) { /* on X-axis, special case */
if (num[1] == 0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
result = (num[1] < 0 ? 180 : 0);
} else {
result = atan2(num[0], num[1]) * radians_to_degrees;
@@ -204,9 +204,9 @@ zdexp(i_ctx_t *i_ctx_p)
dbegin_binary();
if (num[0] == 0.0 && num[1] == 0.0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
if (num[0] < 0.0 && modf(num[1], &ipart) != 0.0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
return double_result(i_ctx_p, 2, pow(num[0], num[1]));
}
@@ -215,7 +215,7 @@ dlog(i_ctx_t *i_ctx_p, double (*lfunc)(double))
{
dbegin_unary();
if (num <= 0.0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return double_result(i_ctx_p, 1, (*lfunc)(num));
}
/* <dposnum> <dresult> .dln <dresult> */
@@ -322,7 +322,7 @@ zcvsd(i_ctx_t *i_ctx_p)
check_read_type(op[-1], t_string);
len = r_size(op - 1);
if (len > MAX_CHARS)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
gs_sprintf(buf, "%f", 1.5);
dot = buf[1]; /* locale-dependent */
memcpy(str, op[-1].value.bytes, len);
@@ -338,7 +338,7 @@ zcvsd(i_ctx_t *i_ctx_p)
--len;
str[len] = 0;
if (strspn(str, "0123456789+-.dDeE") != len)
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
strcat(str, "$");
if (dot != '.') {
char *pdot = strchr(str, '.');
@@ -346,7 +346,7 @@ zcvsd(i_ctx_t *i_ctx_p)
*pdot = dot;
}
if (sscanf(str, "%lf%c", &num, &end) != 2 || end != '$')
- return_error(e_syntaxerror);
+ return_error(gs_error_syntaxerror);
return double_result(i_ctx_p, 1, num);
}
@@ -366,7 +366,7 @@ zdcvi(i_ctx_t *i_ctx_p)
return code;
if (num < min_int_real || num > max_int_real)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_int(op, (long)num); /* truncates toward 0 */
return 0;
}
@@ -388,7 +388,7 @@ zdcvr(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (num < min_real || num > max_real)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_real(op, (float)num);
return 0;
}
@@ -427,7 +427,7 @@ zdcvs(i_ctx_t *i_ctx_p)
}
len = strlen(str);
if (len > r_size(op))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Juggling locales isn't thread-safe. Posix me harder. */
if (dot != '.') {
char *pdot = strchr(str, dot);
@@ -505,14 +505,14 @@ double_params(os_ptr op, int count, double *pval)
if (!r_has_attr(op, a_read) ||
r_size(op) != sizeof(double)
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
--pval;
memcpy(pval, op->value.bytes, sizeof(double));
break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
op--;
}
@@ -525,7 +525,7 @@ double_params_result(os_ptr op, int count, double *pval)
{
check_write_type(*op, t_string);
if (r_size(op) != sizeof(double))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return double_params(op - 1, count, pval);
}
diff --git a/gs/psi/zdpnext.c b/gs/psi/zdpnext.c
index eea69ba39..310e9c0c6 100644
--- a/gs/psi/zdpnext.c
+++ b/gs/psi/zdpnext.c
@@ -207,7 +207,7 @@ zdissolve(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (delta < 0 || delta > 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
params.op = composite_Dissolve;
params.delta = delta;
return composite_image(i_ctx_p, &params);
diff --git a/gs/psi/zdps.c b/gs/psi/zdps.c
index 7d49df7ca..fa1d6e93e 100644
--- a/gs/psi/zdps.c
+++ b/gs/psi/zdps.c
@@ -53,7 +53,7 @@ zsetscreenphase(i_ctx_t *i_ctx_p)
if (op[-2].value.intval < -1 ||
op[-2].value.intval >= gs_color_select_count
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = gs_setscreenphase(igs, x, y,
(gs_color_select_t) op[-2].value.intval);
if (code >= 0)
@@ -73,7 +73,7 @@ zcurrentscreenphase(i_ctx_t *i_ctx_p)
if (op->value.intval < -1 ||
op->value.intval >= gs_color_select_count
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = gs_currentscreenphase(igs, &phase,
(gs_color_select_t)op->value.intval);
if (code < 0)
@@ -116,7 +116,7 @@ zimage2(i_ctx_t *i_ctx_p)
(code = dict_bool_param(op, "PixelCopy", false,
&image.PixelCopy)) < 0
)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
check_stype(*pDataSource, st_igstate_obj);
image.DataSource = igstate_ptr(pDataSource);
{
@@ -127,7 +127,7 @@ zimage2(i_ctx_t *i_ctx_p)
image.UnpaintedPath = gx_path_alloc(imemory,
".image2 UnpaintedPath");
if (image.UnpaintedPath == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
} else
image.UnpaintedPath = 0;
}
@@ -213,7 +213,7 @@ zdefineusername(i_ctx_t *i_ctx_p)
goto ret;
/* falls through */
default:
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
} else { /* Expand the array. */
ref new_array;
diff --git a/gs/psi/zdps1.c b/gs/psi/zdps1.c
index bdddb288b..71a7baa0d 100644
--- a/gs/psi/zdps1.c
+++ b/gs/psi/zdps1.c
@@ -99,7 +99,7 @@ gstate_check_space(i_ctx_t *i_ctx_p, int_gstate *isp, uint space)
*/
#if 1 /* ****** WORKAROUND ****** */
if (space != avm_local && imemory_save_level(iimemory) > 0)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
#endif /* ****** END ****** */
#define gsref_check(p) store_check_space(space, p)
int_gstate_map_refs(isp, gsref_check);
@@ -122,11 +122,11 @@ zgstate(i_ctx_t *i_ctx_p)
return code;
pigo = ialloc_struct(igstate_obj, &st_igstate_obj, "gstate");
if (pigo == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
pnew = gs_state_copy(igs, imemory);
if (pnew == 0) {
ifree_object(pigo, "gstate");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
isp = gs_int_gstate(pnew);
int_gstate_map_refs(isp, ref_mark_new);
@@ -364,7 +364,7 @@ rect_get(local_rects_t * plr, os_ptr op, gs_memory_t *mem)
format = code;
count = num_array_size(op, format);
if (count % 4)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
count /= 4;
break;
default: /* better be 4 numbers */
@@ -384,7 +384,7 @@ rect_get(local_rects_t * plr, os_ptr op, gs_memory_t *mem)
pr = (gs_rect *)gs_alloc_byte_array(mem, count, sizeof(gs_rect),
"rect_get");
if (pr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
plr->pr = pr;
for (n = 0; n < count; n++, pr++) {
@@ -479,7 +479,7 @@ gstate_unshare(i_ctx_t *i_ctx_p)
/* Copy the gstate. */
pnew = gs_gstate(pgs);
if (pnew == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
isp = gs_int_gstate(pnew);
int_gstate_map_refs(isp, ref_mark_new);
ref_do_save(op, pgsref, "gstate_unshare");
diff --git a/gs/psi/zdscpars.c b/gs/psi/zdscpars.c
index 71033f320..c05e15418 100644
--- a/gs/psi/zdscpars.c
+++ b/gs/psi/zdscpars.c
@@ -156,13 +156,13 @@ zinitialize_dsc_parser(i_ctx_t *i_ctx_p)
gs_alloc_struct(mem, dsc_data_t, &st_dsc_data_t, "DSC parser init");
if (!data)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
data->document_level = 0;
data->dsc_data_ptr = dsc_init_with_alloc((void *) "Ghostscript DSC parsing",
zDSC_memalloc, zDSC_memfree, (void *)mem->non_gc_memory);
if (!data->dsc_data_ptr)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
dsc_set_error_function(data->dsc_data_ptr, dsc_error_handler);
make_astruct(&local_ref, a_readonly | r_space(op), (byte *) data);
code = idict_put_string(op, dsc_dict_name, &local_ref);
diff --git a/gs/psi/zfaes.c b/gs/psi/zfaes.c
index cb629fdb5..ef97957e5 100644
--- a/gs/psi/zfaes.c
+++ b/gs/psi/zfaes.c
@@ -44,13 +44,13 @@ z_aes_d(i_ctx_t * i_ctx_p)
check_type(*op, t_dictionary);
check_dict_read(*op);
if (dict_find_string(op, "Key", &sop) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
s_aes_set_key(&state, sop->value.const_bytes, r_size(sop));
/* extract the padding flag, which defaults to true for compatibility */
if (dict_bool_param(op, "Padding", 1, &use_padding) < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
s_aes_set_padding(&state, use_padding);
diff --git a/gs/psi/zfapi.c b/gs/psi/zfapi.c
index 6f26ffe92..d606e6435 100644
--- a/gs/psi/zfapi.c
+++ b/gs/psi/zfapi.c
@@ -99,7 +99,7 @@ sfnts_next_elem(sfnts_reader *r)
do {
r->index++;
code = array_get(r->memory, r->sfnts, r->index, &s);
- if (code == e_rangecheck) {
+ if (code == gs_error_rangecheck) {
r->error |= 2;
}
else if (code < 0) {
@@ -1311,7 +1311,7 @@ FAPI_get_xlatmap(i_ctx_t *i_ctx_p, char **xlatmap)
if ((code = dict_find_string(systemdict, ".xlatmap", &pref)) < 0)
return code;
if (r_type(pref) != t_string)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
*xlatmap = (char *)pref->value.bytes;
/* Note : this supposes that xlatmap doesn't move in virtual memory.
Garbager must not be called while plugin executes get_scaled_font, get_decodingID.
@@ -1328,7 +1328,7 @@ renderer_retcode(gs_memory_t *mem, gs_fapi_server *I, gs_fapi_retcode rc)
emprintf2(mem,
"Error: Font Renderer Plugin ( %s ) return code = %d\n",
I->ig.d->subtype, rc);
- return rc < 0 ? rc : e_invalidfont;
+ return rc < 0 ? rc : gs_error_invalidfont;
}
/* <server name>/<null> object .FAPIavailable bool */
@@ -1345,7 +1345,7 @@ zFAPIavailable(i_ctx_t *i_ctx_p)
serv_name =
(char *) ref_to_string(&name_ref, imemory, "zFAPIavailable");
if (!serv_name) {
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
}
@@ -1410,7 +1410,7 @@ FAPI_refine_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font *pfont,
if (dict_find_string(op, "FontBBox", &v) > 0) {
if (!r_has_type(v, t_array) && !r_has_type(v, t_shortarray)
&& !r_has_type(v, t_mixedarray))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
make_real(&mat[0], pbfont->FontBBox.p.x);
make_real(&mat[1], pbfont->FontBBox.p.y);
make_real(&mat[2], pbfont->FontBBox.q.x);
@@ -1459,11 +1459,11 @@ FAPI_refine_font(i_ctx_t *i_ctx_p, os_ptr op, gs_font *pfont,
if (dict_find_string(pdr, "CIDSystemInfo", &CIDSystemInfo) <= 0
|| !r_has_type(CIDSystemInfo, t_dictionary))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (dict_find_string(CIDSystemInfo, "Ordering", &Ordering) <= 0
|| !r_has_type(Ordering, t_string)) {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
ordering_length =
@@ -1533,7 +1533,7 @@ zFAPIrebuildfont(i_ctx_t *i_ctx_p)
if (pbfont->FAPI == NULL) {
if (dict_find_string(op - 1, "FAPI", &v) <= 0
|| !r_has_type(v, t_name))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
obj_string_data(imemory, v, &pchars, &len);
len = min(len, sizeof(FAPI_ID) - 1);
strncpy((char *)FAPI_ID, (const char *)pchars, len);
@@ -1547,7 +1547,7 @@ zFAPIrebuildfont(i_ctx_t *i_ctx_p)
(gs_fapi_get_server_param_callback)
ps_get_server_param);
if (!pbfont->FAPI || code < 0) {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
@@ -1779,7 +1779,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
return code;
}
else {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
else {
@@ -1795,7 +1795,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
* been constructed using the extended name....
*/
if (!r_has_type(&char_name, t_name))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
name_string_ref(imemory, &char_name, &cname_str);
enc_char_name->data = cname_str.value.bytes;
enc_char_name->size = r_size(&cname_str);
@@ -1813,10 +1813,10 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
if (dict_find_string(pdr, "Decoding", &Decoding) <= 0
|| !r_has_type(Decoding, t_dictionary))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (dict_find_string(pdr, "SubstNWP", &SubstNWP) <= 0
|| !r_has_type(SubstNWP, t_array))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (dict_find_string(pdr, "TT_cmap", &TT_cmap) <= 0
|| !r_has_type(TT_cmap, t_dictionary)) {
ref *DecodingArray, char_code, char_code1, ih;
@@ -1827,7 +1827,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
if (dict_find(Decoding, &ih, &DecodingArray) <= 0
|| !r_has_type(DecodingArray, t_array)
|| array_get(imemory, DecodingArray, i, &char_code) < 0) {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
/* Check the Decoding entry */
@@ -1840,13 +1840,13 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
n = r_size(DecodingArray);
}
else {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
for (; n--; i++) {
if (array_get(imemory, DecodingArray, i, &char_code1) < 0
|| !r_has_type(&char_code1, t_integer)) {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
c = char_code1.value.intval;
@@ -1973,7 +1973,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
if (dict_find_string(pdr, "CharStrings", &CharStrings) <= 0
|| !r_has_type(CharStrings, t_dictionary))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if ((dict_find(CharStrings, &char_name, &glyph_index) < 0)
|| r_has_type(glyph_index, t_null)) {
#ifdef DEBUG
@@ -2025,7 +2025,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
ref_assign(esp, glyph_index);
return o_push_estack;
#else
- return (e_invalidfont);
+ return (gs_error_invalidfont);
#endif
}
cr->is_glyph_index = true;
@@ -2058,7 +2058,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
(uint) array_find(imemory, Encoding, &glyph);
}
else
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
else { /* a non-embedded font, i.e. a disk font */
@@ -2101,14 +2101,14 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
cr->char_codes_count = r_size(char_code);
if (cr->char_codes_count > count_of(cr->char_codes))
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
if (code >= 0) {
for (i = 0; i < cr->char_codes_count; i++) {
code = array_get(imemory, char_code, i, &v);
if (code < 0)
break;
if (!r_has_type(char_code, t_integer)) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
break;
}
cr->char_codes[i] = v.value.intval;
@@ -2116,7 +2116,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
}
}
else {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
}
if (code < 0) {
char buf[16];
@@ -2130,7 +2130,7 @@ ps_get_glyphname_or_cid(gs_font_base *pbfont, gs_string *charstring,
emprintf1(imemory,
"Wrong decoding entry for the character '%s'.\n",
buf);
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
}
@@ -2209,11 +2209,11 @@ FAPI_char(i_ctx_t *i_ctx_p, bool bBuildGlyph, ref *charstring)
* here, the out of range CID is handled later
*/
if ((dict_find_string(op - 1, "CharStrings", &chstrs)) <= 0) {
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
if ((dict_find_string(chstrs, ".notdef", &chs)) <= 0) {
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
ref_assign_inline(op, chs);
}
@@ -2266,7 +2266,7 @@ FAPI_char(i_ctx_t *i_ctx_p, bool bBuildGlyph, ref *charstring)
return (zchar_exec_char_proc(i_ctx_p));
}
else {
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
}
@@ -2303,10 +2303,10 @@ zFAPIBuildGlyph9(i_ctx_t *i_ctx_p)
font_index = op[0].value.intval;
if (dict_find_string(&font9, "FDArray", &rFDArray) <= 0
|| r_type(rFDArray) != t_array)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if (array_get(imemory, rFDArray, font_index, &f) < 0
|| r_type(&f) != t_dictionary)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
op[0] = op[-2];
op[-2] = op[-1]; /* Keep the charstring on ostack for the garbager. */
diff --git a/gs/psi/zfarc4.c b/gs/psi/zfarc4.c
index bf4b6f1b2..05832cd5c 100644
--- a/gs/psi/zfarc4.c
+++ b/gs/psi/zfarc4.c
@@ -44,9 +44,9 @@ z_arcfour_d(i_ctx_t * i_ctx_p)
check_type(*op, t_dictionary);
check_dict_read(*op);
if (dict_find_string(op, "Key", &sop) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (!r_has_type(sop, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop));
/* we pass npop=0, since we've no arguments left to consume */
@@ -69,9 +69,9 @@ z_arcfour_e(i_ctx_t * i_ctx_p)
check_type(*op, t_dictionary);
check_dict_read(*op);
if (dict_find_string(op, "Key", &sop) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (!r_has_type(sop, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
s_arcfour_set_key(&state, sop->value.const_bytes, r_size(sop));
diff --git a/gs/psi/zfcid.c b/gs/psi/zfcid.c
index d3ff274ad..ce583af30 100644
--- a/gs/psi/zfcid.c
+++ b/gs/psi/zfcid.c
@@ -33,7 +33,7 @@ cid_font_system_info_param(gs_cid_system_info_t *pcidsi, const ref *prfont)
ref *prcidsi;
if (dict_find_string(prfont, "CIDSystemInfo", &prcidsi) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return cid_system_info_param(pcidsi, prcidsi);
}
@@ -87,6 +87,6 @@ cid_font_data_param(os_ptr op, gs_font_cid_data *pdata, ref *pGlyphDirectory)
return code;
} else {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
diff --git a/gs/psi/zfcid0.c b/gs/psi/zfcid0.c
index 155dbb7c5..ff6910871 100644
--- a/gs/psi/zfcid0.c
+++ b/gs/psi/zfcid0.c
@@ -55,7 +55,7 @@ get_index(gs_glyph_data_t *pgd, int count, ulong *pval)
int i;
if (pgd->bits.size < count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
*pval = 0;
for (i = 0; i < count; ++i)
*pval = (*pval << 8) + pgd->bits.data[i];
@@ -76,7 +76,7 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
/* Check for overflow. */
if (base != (long)base || base > base + count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (r_has_type(&pfdata->u.cid0.DataSource, t_null)) {
/* Get the bytes from GlyphData (a string or array of strings). */
const ref *pgdata = &pfdata->u.cid0.GlyphData;
@@ -85,7 +85,7 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
uint size = r_size(pgdata);
if (base >= size || count > size - base)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
data = pgdata->value.bytes + base;
} else { /* array of strings */
/*
@@ -106,7 +106,7 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
if (code < 0)
return code;
if (!r_has_type(&rstr, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
size = r_size(&rstr);
if (skip < size)
break;
@@ -119,7 +119,7 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
data = gs_alloc_string(pfont->memory, count,
"cid0_read_bytes");
if (data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
gdfont = (gs_font *)pfont; /* newly allocated */
}
memcpy(data, rstr.value.bytes + skip, size);
@@ -130,7 +130,7 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
if (code < 0)
goto err;
if (!r_has_type(&rstr, t_string)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto err;
}
size = r_size(&rstr);
@@ -149,15 +149,15 @@ cid0_read_bytes(gs_font_cid0 *pfont, ulong base, uint count, byte *buf,
check_read_known_file(i_ctx_p, s, &pfdata->u.cid0.DataSource, return_error);
if (sseek(s, base) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
if (data == 0) { /* no buffer provided */
data = gs_alloc_string(pfont->memory, count, "cid0_read_bytes");
if (data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
gdfont = (gs_font *)pfont; /* newly allocated */
}
if (sgets(s, data, count, &nread) < 0 || nread != count) {
- code = gs_note_error(e_ioerror);
+ code = gs_note_error(gs_error_ioerror);
goto err;
}
}
@@ -192,12 +192,12 @@ z9_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *pgd,
return code;
/* Get the definition from GlyphDirectory. */
if (!gdata.bits.data)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = get_index(&gdata, pfont->cidata.FDBytes, &fidx);
if (code < 0)
return code;
if (fidx >= pfont->cidata.FDArray_size)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (pgd)
*pgd = gdata;
*pfidx = (int)fidx;
@@ -208,7 +208,7 @@ z9_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *pgd,
*pfidx = 0;
if (pgd)
gs_glyph_data_from_null(pgd);
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
{
byte fd_gd[(MAX_FDBytes + MAX_GDBytes) * 2];
@@ -239,10 +239,10 @@ z9_glyph_data(gs_font_base *pbfont, gs_glyph glyph, gs_glyph_data_t *pgd,
*pfidx = 0;
if (pgd)
gs_glyph_data_from_null(pgd);
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
if (fidx >= pfont->cidata.FDArray_size)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
*pfidx = (int)fidx;
if (pgd == 0)
return 0;
@@ -291,13 +291,13 @@ static int
z9_FDArray_glyph_data(gs_font_type1 * pfont, gs_glyph glyph,
gs_glyph_data_t *pgd)
{
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
static int
z9_FDArray_seac_data(gs_font_type1 *pfont, int ccode, gs_glyph *pglyph,
gs_const_string *gstr, gs_glyph_data_t *pgd)
{
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
/* ------ Defining ------ */
@@ -349,7 +349,7 @@ fd_array_element(i_ctx_t *i_ctx_p, gs_font_type1 **ppfont, ref *prfd)
"%Type2BuildChar", "%Type2BuildGlyph");
break;
default: /* can't happen */
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
if (code < 0)
return code;
@@ -441,7 +441,7 @@ zbuildfont9(i_ctx_t *i_ctx_p)
DataSource = *pds;
} else {
if (!r_has_type(&GlyphData, t_string) && !r_is_array(&GlyphData))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
make_null(&DataSource);
}
} else {
@@ -450,15 +450,15 @@ zbuildfont9(i_ctx_t *i_ctx_p)
CIDMapOffset = 0;
}
if (!r_is_array(prfda))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
FDArray_size = r_size(prfda);
if (FDArray_size == 0)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
FDArray = ialloc_struct_array(FDArray_size, gs_font_type1 *,
&st_gs_font_type1_ptr_element,
"buildfont9(FDarray)");
if (FDArray == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memset(FDArray, 0, sizeof(gs_font_type1 *) * FDArray_size);
for (i = 0; i < FDArray_size; ++i) {
ref rfd;
@@ -533,7 +533,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (pfont->FontType != ft_CID_encrypted)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
check_type(*op, t_integer);
pfcid = (gs_font_cid0 *)pfont;
gdata.memory = pfont->memory;
@@ -557,7 +557,7 @@ ztype9mapcid(i_ctx_t *i_ctx_p)
if (code < 0) {
if_debug1m('J', imemory, "[J]ztype9cidmap() could not load default glyph (CID %" PRIpsint ")\n", op->value.intval);
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
diff --git a/gs/psi/zfcid1.c b/gs/psi/zfcid1.c
index fd9c191a8..be8cf618a 100644
--- a/gs/psi/zfcid1.c
+++ b/gs/psi/zfcid1.c
@@ -84,7 +84,7 @@ z11_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph)
switch (r_type(pcidmap)) {
case t_string:
if (cid >= r_size(pcidmap) / gdbytes)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
data = pcidmap->value.const_bytes + cid * gdbytes;
break;
case t_integer:
@@ -93,9 +93,9 @@ z11_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph)
make_int(&rcid, cid);
code = dict_find(pcidmap, &rcid, &prgnum);
if (code <= 0)
- return (code < 0 ? code : gs_note_error(e_undefined));
+ return (code < 0 ? code : gs_note_error(gs_error_undefined));
if (!r_has_type(prgnum, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return prgnum->value.intval;
default: /* array type */
code = string_array_access_proc(pfont->memory, pcidmap, 1, cid * gdbytes,
@@ -104,12 +104,12 @@ z11_CIDMap_proc(gs_font_cid2 *pfont, gs_glyph glyph)
if (code < 0)
return code;
if ( code > 0 )
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
for (i = 0; i < gdbytes; ++i)
gnum = (gnum << 8) + data[i];
if (gnum >= pfont->data.trueNumGlyphs)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
return gnum;
}
@@ -218,7 +218,7 @@ z11_enumerate_glyph(gs_font *font, int *pindex,
int code;
if(*pindex > pfont->cidata.common.CIDCount)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (;;) {
code = z11_CIDMap_proc(pfont, GS_MIN_CID_GLYPH + *pindex);
@@ -268,11 +268,11 @@ get_subst_CID_on_WMode(gs_subst_CID_on_WMode_t *subst, ref *t, int WMode)
s = (uint *)gs_alloc_byte_array(subst->rc.memory, n, sizeof(int), "zbuildfont11");
if (s == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
for (i = 0; i < n; i++) {
array_get(subst->rc.memory, a, (long)i, &e);
if (r_type(&e) != t_integer)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
s[i] = e.value.intval;
}
subst->data[WMode] = s;
@@ -359,9 +359,9 @@ zbuildfont11(i_ctx_t *i_ctx_p)
*/
CIDFontName = *pCIDFontName;
if (MetricsCount & 1) /* only allowable values are 0, 2, 4 */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_find_string(op, "File", &pfile);
- if (code < 0 && code != e_undefined)
+ if (code < 0 && code != gs_error_undefined)
return code;
if (code > 0) {
ref *file_table_pos, *a, v;
@@ -376,15 +376,15 @@ zbuildfont11(i_ctx_t *i_ctx_p)
check_read_type(file, t_file);
code = dict_find_string(op, "file_table_pos", &file_table_pos);
if (code <= 0 || r_type(file_table_pos) != t_dictionary)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
for (i = 0; i < 2; i++) {
code = dict_find_string(file_table_pos, name[i], &a);
if (code <= 0 || r_type(a) != t_array)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
for (j = 0; j < 2; j++) {
code = array_get(imemory, a, j, &v);
if (code < 0 || r_type(&v) != t_integer)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
loca_glyph_pos[i][j] = v.value.intval;
}
}
@@ -396,11 +396,11 @@ zbuildfont11(i_ctx_t *i_ctx_p)
gdb:
/* GDBytes is required for indexing a string or string array. */
if (common.GDBytes == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
break;
default:
return code;
- case e_typecheck:
+ case gs_error_typecheck:
switch (r_type(&rcidmap)) {
case t_string: /* in PLRM3 */
goto gdb;
@@ -428,7 +428,7 @@ zbuildfont11(i_ctx_t *i_ctx_p)
gs_font *font;
if (dict_find_string(t, "Ordering", &o) <= 0 || r_type(o) != t_string)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
for (font = ifont_dir->orig_fonts; font != NULL; font = font->next) {
if (font->FontType == ft_CID_TrueType) {
gs_font_cid2 *pfcid1 = (gs_font_cid2 *)font;
@@ -448,7 +448,7 @@ zbuildfont11(i_ctx_t *i_ctx_p)
if (subst == NULL) {
rc_alloc_struct_1(subst, gs_subst_CID_on_WMode_t, &st_subst_CID_on_WMode,
- pfcid->memory, return_error(e_VMerror), "zbuildfont11");
+ pfcid->memory, return_error(gs_error_VMerror), "zbuildfont11");
subst->data[0] = subst->data[1] = 0;
pfcid->subst_CID_on_WMode = subst;
code = get_subst_CID_on_WMode(subst, t, 0);
@@ -519,13 +519,13 @@ ztype11mapcid(i_ctx_t *i_ctx_p)
if (op->value.intval < 0 ||
op->value.intval >= ((gs_font_type42 *)pfont)->data.numGlyphs
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = (int)op->value.intval;
} else
#endif
{
if (pfont->FontType != ft_CID_TrueType)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
code = z11_CIDMap_proc((gs_font_cid2 *)pfont,
(gs_glyph)(gs_min_cid_glyph + op->value.intval));
}
diff --git a/gs/psi/zfcmap.c b/gs/psi/zfcmap.c
index 36392a4f4..c4777f565 100644
--- a/gs/psi/zfcmap.c
+++ b/gs/psi/zfcmap.c
@@ -72,25 +72,25 @@ acquire_code_ranges(gs_cmap_adobe1_t *cmap, const ref *pref, gs_memory_t *mem)
ref elem;
if (!r_is_array(pref))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0; i < r_size(pref); i++) {
int code = array_get(mem, pref, i, &elem);
if (code < 0)
return code;
elem_sz = r_size(&elem);
if (elem_sz & 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
num_ranges += elem_sz;
}
if (num_ranges == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
num_ranges >>= 1;
ranges = (gx_code_space_range_t *)
gs_alloc_byte_array(mem, num_ranges, sizeof(gx_code_space_range_t),
"acquire_code_ranges");
if (ranges == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
cmap->code_space.ranges = ranges;
cmap->code_space.num_ranges = num_ranges;
@@ -108,7 +108,7 @@ acquire_code_ranges(gs_cmap_adobe1_t *cmap, const ref *pref, gs_memory_t *mem)
(size = r_size(&rfirst)) == 0 || size > MAX_CMAP_CODE_SIZE ||
r_size(&rlast) != size ||
memcmp(rfirst.value.bytes, rlast.value.bytes, size) > 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
memcpy(ranges->first, rfirst.value.bytes, size);
memcpy(ranges->last, rlast.value.bytes, size);
ranges->size = size;
@@ -130,14 +130,14 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
uint elem_sz;
if (!r_is_array(pref))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i=0; i < r_size(pref); i++) {
int code = array_get(mem, pref, i, &elem);
if (code < 0)
return code;
elem_sz = r_size(&elem);
if (elem_sz % 5 != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
num_lookup += elem_sz;
}
num_lookup /= 5;
@@ -145,7 +145,7 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
&st_cmap_lookup_range_element,
"acquire_code_map(lookup ranges)");
if (pclr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memset(pclr, 0, sizeof(*pclr) * num_lookup);
pcmap->lookup = pclr;
pcmap->num_lookup = num_lookup;
@@ -169,13 +169,13 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
!(r_has_type(&rvalues, t_string) || r_is_array(&rvalues)) ||
!r_has_type(&rfxs, t_integer)
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(&rmisc) != 4 ||
rmisc.value.bytes[0] > MAX_CMAP_CODE_SIZE - r_size(&rprefix) ||
rmisc.value.bytes[1] > 1 ||
rmisc.value.bytes[2] > CODE_VALUE_MAX ||
rmisc.value.bytes[3] == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclr->cmap = root;
pclr->key_size = rmisc.value.bytes[0];
pclr->key_prefix_size = r_size(&rprefix);
@@ -184,13 +184,13 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
if (pclr->key_size == 0) {
/* This is a single entry consisting only of the prefix. */
if (r_size(&rkeys) != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclr->num_entries = 1;
} else {
int step = pclr->key_size * (pclr->key_is_range ? 2 : 1);
if (r_size(&rkeys) % step != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclr->num_entries = r_size(&rkeys) / step;
}
pclr->keys.data = rkeys.value.bytes,
@@ -199,10 +199,10 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
pclr->value_size = rmisc.value.bytes[3];
if (r_has_type(&rvalues, t_string)) {
if (pclr->value_type == CODE_VALUE_GLYPH)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (r_size(&rvalues) % pclr->num_entries != 0 ||
r_size(&rvalues) / pclr->num_entries != pclr->value_size)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclr->values.data = rvalues.value.bytes,
pclr->values.size = r_size(&rvalues);
} else {
@@ -213,11 +213,11 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
if (pclr->value_type != CODE_VALUE_GLYPH ||
r_size(&rvalues) != pclr->num_entries ||
pclr->value_size > sizeof(gs_glyph))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
pclr->values.data = gs_alloc_string(mem, values_size,
"acquire_code_map(values)");
if (pclr->values.data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
pclr->values.size = values_size;
pvalue = pclr->values.data;
for (k = 0; k < pclr->num_entries; ++k) {
@@ -227,7 +227,7 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
array_get(mem, &rvalues, k, &rvalue);
if (!r_has_type(&rvalue, t_name))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
value = name_index(mem, &rvalue);
/*
* We need a special check here because some CPUs cannot
@@ -236,7 +236,7 @@ acquire_code_map(gx_code_map_t *pcmap, const ref *pref, gs_cmap_adobe1_t *root,
if (pclr->value_size < sizeof(value) &&
(value >> (pclr->value_size * 8)) != 0
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i = pclr->value_size; --i >= 0; )
*pvalue++ = (byte)(value >> (i * 8));
}
@@ -267,7 +267,7 @@ acquire_cid_system_info(ref *psia, const ref *op)
return 0;
}
if (!r_is_array(prcidsi))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
*psia = *prcidsi;
return 0;
}
@@ -334,7 +334,7 @@ ztype0_get_cmap(const gs_cmap_t **ppcmap, const ref *pfdepvector,
!r_is_struct(pcodemap) ||
gs_object_size(imem, r_ptr(pcodemap, gs_cmap_t)) < sizeof(gs_cmap_t)
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
pcmap = r_ptr(pcodemap, gs_cmap_t);
num_fonts = r_size(pfdepvector);
for (i = 0; i < num_fonts; ++i) {
@@ -346,7 +346,7 @@ ztype0_get_cmap(const gs_cmap_t **ppcmap, const ref *pfdepvector,
return code;
if (code == 0) {
if (r_size(&rfsi) != 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
#ifdef CHECK_CID_SYSTEM_INFO_COMPATIBILITY
{
gs_cid_system_info_t cidsi;
@@ -355,7 +355,7 @@ ztype0_get_cmap(const gs_cmap_t **ppcmap, const ref *pfdepvector,
if (!cid_system_info_is_null(&cidsi) &&
!cid_system_info_compatible(&cidsi,
pcmap->CIDSystemInfo + i))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
#endif
}
@@ -405,11 +405,11 @@ zbuildcmap(i_ctx_t *i_ctx_p)
check_type(*op, t_dictionary);
check_dict_write(*op);
if ((code = dict_find_string(op, "CMapName", &pcmapname)) <= 0) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
if (!r_has_type(pcmapname, t_name)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto fail;
}
name_string_ref(imemory, pcmapname, &rname);
@@ -419,7 +419,7 @@ zbuildcmap(i_ctx_t *i_ctx_p)
dict_find_string(op, "CodeMap", &pcodemap) <= 0 ||
!r_has_type(pcodemap, t_null)
) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
if ((code = acquire_cid_system_info(&rcidsi, op)) < 0)
@@ -436,7 +436,7 @@ zbuildcmap(i_ctx_t *i_ctx_p)
goto fail;
if (dict_find_string(op, "UIDOffset", &puidoffset) > 0) {
if (!r_has_type(puidoffset, t_integer)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto fail;
}
pcmap->UIDOffset = puidoffset->value.intval; /* long, not int */
diff --git a/gs/psi/zfdctd.c b/gs/psi/zfdctd.c
index 0a0f2c674..f69465d0b 100644
--- a/gs/psi/zfdctd.c
+++ b/gs/psi/zfdctd.c
@@ -72,7 +72,7 @@ zDCTD(i_ctx_t *i_ctx_p)
jddp = gs_alloc_struct_immovable(mem,jpeg_decompress_data,
&st_jpeg_decompress_data, "zDCTD");
if (jddp == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (s_DCTD_template.set_defaults)
(*s_DCTD_template.set_defaults) ((stream_state *) & state);
state.data.decompress = jddp;
diff --git a/gs/psi/zfdcte.c b/gs/psi/zfdcte.c
index 987f64d56..704e54f2e 100644
--- a/gs/psi/zfdcte.c
+++ b/gs/psi/zfdcte.c
@@ -54,7 +54,7 @@ zDCTE(i_ctx_t *i_ctx_p)
jcdp = gs_alloc_struct_immovable(mem, jpeg_compress_data,
&st_jpeg_compress_data, "zDCTE");
if (jcdp == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
state.memory = mem;
if (s_DCTE_template.set_defaults)
(*s_DCTE_template.set_defaults) ((stream_state *) & state);
@@ -116,7 +116,7 @@ zdcteparams(i_ctx_t *i_ctx_p)
check_type(op[-2], t_dictionary);
/* The DCT filters copy the template.... */
if (s->state->templat->process != s_DCTE_template.process)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_param_list_write(&list, op - 2, NULL, iimemory);
if (code < 0)
return code;
diff --git a/gs/psi/zfdecode.c b/gs/psi/zfdecode.c
index 5182aed59..828e6fd13 100644
--- a/gs/psi/zfdecode.c
+++ b/gs/psi/zfdecode.c
@@ -142,7 +142,7 @@ filter_read_predictor(i_ctx_t *i_ctx_p, int npop,
code = zpp_setup(op, &pps);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if (code < 0)
return code;
@@ -264,7 +264,7 @@ zpd_setup(os_ptr op, stream_PDiff_state * ppds)
(code = dict_int_param(op, "Columns", 1, max_int, 1,
&ppds->Columns)) < 0
)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
ppds->BitsPerComponent = bpc;
return 0;
}
@@ -315,7 +315,7 @@ zpp_setup(os_ptr op, stream_PNGP_state * ppps)
(code = dict_int_param(op, "Predictor", 10, 15, 15,
&ppps->Predictor)) < 0
)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
ppps->BitsPerComponent = bpc;
return 0;
}
diff --git a/gs/psi/zfile.c b/gs/psi/zfile.c
index 93fd78cc2..6591047d1 100644
--- a/gs/psi/zfile.c
+++ b/gs/psi/zfile.c
@@ -180,7 +180,7 @@ check_file_permissions_reduced(i_ctx_t *i_ctx_p, const char *fname, int len,
return 0; /* success */
}
/* not found */
- return e_invalidfileaccess;
+ return gs_error_invalidfileaccess;
}
/* Check a file name for permission by stringmatch on one of the */
@@ -193,7 +193,7 @@ check_file_permissions(i_ctx_t *i_ctx_p, const char *fname, int len,
uint rlen = sizeof(fname_reduced);
if (gp_file_name_reduce(fname, len, fname_reduced, &rlen) != gp_combine_success)
- return e_invalidaccess; /* fail if we couldn't reduce */
+ return gs_error_invalidaccess; /* fail if we couldn't reduce */
return check_file_permissions_reduced(i_ctx_p, fname_reduced, rlen, permitgroup);
}
@@ -221,14 +221,14 @@ zfile(i_ctx_t *i_ctx_p)
bool statement = (strcmp(pname.iodev->dname, "%statementedit%") == 0);
bool lineedit = (strcmp(pname.iodev->dname, "%lineedit%") == 0);
if (pname.fname)
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (statement || lineedit) {
/* These need special code to support callouts */
gx_io_device *indev = gs_findiodevice(imemory,
(const byte *)"%stdin", 6);
stream *ins;
if (strcmp(file_access, "r"))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
indev->state = i_ctx_p;
code = (indev->procs.open_device)(indev, file_access, &ins, imemory);
indev->state = 0;
@@ -256,7 +256,7 @@ zfile(i_ctx_t *i_ctx_p)
code = ssetfilename(s, op[-1].value.const_bytes, r_size(op - 1));
if (code < 0) {
sclose(s);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
make_stream_file(op - 1, s, file_access);
pop(1);
@@ -343,7 +343,7 @@ zfilenameforall(i_ctx_t *i_ctx_p)
pfen = iodev->procs.enumerate_files(iodev, (const char *)pname.fname,
pname.len, imemory);
if (pfen == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
push_mark_estack(es_for, file_cleanup);
++esp;
make_istruct(esp, 0, iodev);
@@ -370,7 +370,7 @@ file_continue(i_ctx_t *i_ctx_p)
uint code;
if (len < devlen)
- return_error(e_rangecheck); /* not even room for device len */
+ return_error(gs_error_rangecheck); /* not even room for device len */
memcpy((char *)pscratch->value.bytes, iodev->dname, devlen);
code = iodev->procs.enumerate_next(pfen, (char *)pscratch->value.bytes + devlen,
len - devlen);
@@ -378,7 +378,7 @@ file_continue(i_ctx_t *i_ctx_p)
esp -= 5; /* pop proc, pfen, devlen, iodev , mark */
return o_pop_estack;
} else if (code > len) /* overran string */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
else {
push(1);
ref_assign(op, pscratch);
@@ -434,7 +434,7 @@ zrenamefile(i_ctx_t *i_ctx_p)
"PermitFileControl") < 0 ||
check_file_permissions(i_ctx_p, pname2.fname, pname2.len,
"PermitFileWriting") < 0 )))) {
- code = gs_note_error(e_invalidfileaccess);
+ code = gs_note_error(gs_error_invalidfileaccess);
} else {
code = (*pname1.iodev->procs.rename_file)(pname1.iodev,
pname1.fname, pname2.fname);
@@ -471,7 +471,7 @@ zstatus(i_ctx_t *i_ctx_p)
int code = parse_file_name(op, &pname,
i_ctx_p->LockFilePermissions, imemory);
if (code < 0) {
- if (code == e_undefinedfilename) {
+ if (code == gs_error_undefinedfilename) {
make_bool(op, 0);
code = 0;
}
@@ -506,12 +506,12 @@ zstatus(i_ctx_t *i_ctx_p)
(double)op[-3].value.intval !=
(double)fstat.st_size
)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
make_int(op - 2, fstat.st_mtime);
make_int(op - 1, fstat.st_ctime);
make_bool(op, 1);
break;
- case e_undefinedfilename:
+ case gs_error_undefinedfilename:
make_bool(op, 0);
code = 0;
}
@@ -576,7 +576,7 @@ zfilenamesplit(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
/****** NOT IMPLEMENTED YET ******/
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
/* <string> .libfile <file> true */
@@ -605,7 +605,7 @@ zlibfile(i_ctx_t *i_ctx_p)
code = ssetfilename(s, op->value.const_bytes, r_size(op));
if (code < 0) {
sclose(s);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
}
if (code < 0) {
@@ -624,11 +624,11 @@ zlibfile(i_ctx_t *i_ctx_p)
code = ssetfilename(s, cname, clen);
if (code < 0) {
sclose(s);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
}
if (code < 0) {
- if (code == e_VMerror || code == e_invalidfileaccess)
+ if (code == gs_error_VMerror || code == gs_error_invalidfileaccess)
return code;
push(1);
make_false(op);
@@ -690,7 +690,7 @@ ztempfile(i_ctx_t *i_ctx_p)
check_read_type(op[-1], t_string);
psize = r_size(op - 1);
if (psize >= gp_file_name_sizeof) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto done;
}
memcpy(prefix, op[-1].value.const_bytes, psize);
@@ -701,36 +701,36 @@ ztempfile(i_ctx_t *i_ctx_p)
if (gp_file_name_is_absolute(pstr, strlen(pstr))) {
if (check_file_permissions(i_ctx_p, pstr, strlen(pstr),
"PermitFileWriting") < 0) {
- code = gs_note_error(e_invalidfileaccess);
+ code = gs_note_error(gs_error_invalidfileaccess);
goto done;
}
} else if (!prefix_is_simple(pstr)) {
- code = gs_note_error(e_invalidfileaccess);
+ code = gs_note_error(gs_error_invalidfileaccess);
goto done;
}
s = file_alloc_stream(imemory, "ztempfile(stream)");
if (s == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto done;
}
buf = gs_alloc_bytes(imemory, file_default_buffer_size,
"ztempfile(buffer)");
if (buf == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto done;
}
sfile = gp_open_scratch_file(imemory, pstr, fname, fmode);
if (sfile == 0) {
gs_free_object(imemory, buf, "ztempfile(buffer)");
- code = gs_note_error(e_invalidfileaccess);
+ code = gs_note_error(gs_error_invalidfileaccess);
goto done;
}
fnlen = strlen(fname);
sbody = ialloc_string(fnlen, ".tempfile(fname)");
if (sbody == 0) {
gs_free_object(imemory, buf, "ztempfile(buffer)");
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto done;
}
memcpy(sbody, fname, fnlen);
@@ -741,7 +741,7 @@ ztempfile(i_ctx_t *i_ctx_p)
sclose(s);
iodev_dflt->procs.delete_file(iodev_dflt, fname);
ifree_string(sbody, fnlen, ".tempfile(fname)");
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto done;
}
make_string(op - 1, a_readonly | icurrent_space, fnlen, sbody);
@@ -797,7 +797,7 @@ parse_file_name(const ref * op, gs_parsed_file_name_t * pfn, bool safemode,
* for now it is simply disallowed.
*/
if (pfn->iodev && safemode && strcmp(pfn->iodev->dname, "%pipe%") == 0)
- return e_invalidfileaccess;
+ return gs_error_invalidfileaccess;
return code;
}
@@ -824,7 +824,7 @@ parse_file_access_string(const ref *op, char file_access[4])
switch (r_size(op)) {
case 2:
if (astr[1] != '+')
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
file_access[1] = '+';
file_access[2] = 0;
break;
@@ -832,7 +832,7 @@ parse_file_access_string(const ref *op, char file_access[4])
file_access[1] = 0;
break;
default:
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
}
switch (astr[0]) {
case 'r':
@@ -840,7 +840,7 @@ parse_file_access_string(const ref *op, char file_access[4])
case 'a':
break;
default:
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
}
file_access[0] = astr[0];
return 0;
@@ -918,7 +918,7 @@ check_file_permissions_aux(i_ctx_t *i_ctx_p, char *fname, uint flen)
if (i_ctx_p == NULL)
return 0;
if (check_file_permissions_reduced(i_ctx_p, fname, flen, "PermitFileReading") < 0)
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
return 0;
}
@@ -944,7 +944,7 @@ lib_file_open_search_with_no_combine(gs_file_path_ptr lib_path, const gs_memory
return 0;
}
}
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
}
skip:;
return 1;
@@ -978,7 +978,7 @@ lib_file_open_search_with_combine(gs_file_path_ptr lib_path, const gs_memory_t
if (code < 0)
continue;
if (blen < max(pname.len, plen) + flen)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
memcpy(buffer, pname.fname, pname.len);
memcpy(buffer+pname.len, fname, flen);
code = pname.iodev->procs.open_file(pname.iodev, buffer, pname.len + flen, fmode,
@@ -1005,7 +1005,7 @@ lib_file_open_search_with_combine(gs_file_path_ptr lib_path, const gs_memory_t
return 0;
}
sclose(s);
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
}
}
}
@@ -1073,7 +1073,7 @@ lib_file_open(gs_file_path_ptr lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx
return code;
}
}
- return_error(e_undefinedfilename);
+ return_error(gs_error_undefinedfilename);
}
/* The startup code calls this to open @-files. */
@@ -1106,7 +1106,7 @@ file_read_string(const byte *str, uint len, ref *pfile, gs_ref_memory_t *imem)
stream *s = file_alloc_stream((gs_memory_t *)imem, "file_read_string");
if (s == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
sread_string(s, str, len);
s->foreign = 1;
s->write_id = 0;
@@ -1141,7 +1141,7 @@ filter_open(const char *file_access, uint buffer_size, ref * pfile,
if (templat->stype != &st_stream_state) {
sst = s_alloc_state(mem, templat->stype, "filter_open(stream_state)");
if (sst == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
code = file_open_stream((char *)0, 0, file_access, buffer_size, &s,
(gx_io_device *)0, (iodev_proc_fopen_t)0, mem);
@@ -1185,7 +1185,7 @@ file_close(ref * pfile)
if (file_is_valid(s, pfile)) { /* closing a closed file is a no-op */
if (sclose(s))
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
return 0;
}
diff --git a/gs/psi/zfile1.c b/gs/psi/zfile1.c
index 4467c835d..7fa354311 100644
--- a/gs/psi/zfile1.c
+++ b/gs/psi/zfile1.c
@@ -47,7 +47,7 @@ zfile_name_combine(i_ctx_t *i_ctx_p)
blen = blen0 = plen + flen + 2; /* Inserts separator and ending zero byte. */
buffer = ialloc_string(blen, "zfile_name_combine");
if (buffer == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
prefix = op[-2].value.const_bytes;
fname = op[-1].value.const_bytes;
no_sibling = op[0].value.boolval;
@@ -58,7 +58,7 @@ zfile_name_combine(i_ctx_t *i_ctx_p)
} else {
buffer = iresize_string(buffer, blen0, blen, "zfile_name_combine");
if (buffer == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_string(op - 2, a_all | icurrent_space, blen, buffer);
make_bool(op - 1, true);
pop(1);
diff --git a/gs/psi/zfileio.c b/gs/psi/zfileio.c
index fee13682a..7de28f747 100644
--- a/gs/psi/zfileio.c
+++ b/gs/psi/zfileio.c
@@ -188,7 +188,7 @@ zreadhexstring_continue(i_ctx_t *i_ctx_p)
odd = (char)(op->value.intval >> 24);
if (length > r_size(op - 1) || odd < -1 || odd > 0xF)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_write_type(op[-1], t_string);
code = zreadhexstring_at(i_ctx_p, op - 1, (uint)length, odd);
if (code >= 0)
@@ -232,7 +232,7 @@ zwritehexstring_at(i_ctx_t *i_ctx_p, os_ptr op, uint odd)
status = write_string(&rbuf, s);
switch (status) {
default:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
case 0:
len -= len1;
odd = 0;
@@ -268,7 +268,7 @@ zwritehexstring_continue(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if ((op->value.intval & ~1) != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = zwritehexstring_at(i_ctx_p, op - 1, (uint) op->value.intval);
if (code >= 0)
pop(1);
@@ -305,7 +305,7 @@ zreadstring_at(i_ctx_t *i_ctx_p, os_ptr op, uint start)
* len is zero, sgets will return 0 immediately with rlen = 0.
*/
if (len == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
r_set_size(op, rlen);
op[-1] = *op;
make_bool(op, (rlen == len ? 1 : 0));
@@ -328,7 +328,7 @@ zreadstring_continue(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0 || op->value.intval > r_size(op - 1))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = zreadstring_at(i_ctx_p, op - 1, (uint) op->value.intval);
if (code >= 0)
pop(1);
@@ -384,7 +384,7 @@ zreadline_at(i_ctx_t *i_ctx_p, os_ptr op, uint count, bool in_eol)
case EOFC:
break;
case 1:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
default:
if (count == 0 && !in_eol)
return handle_read_status(i_ctx_p, status, op - 1, NULL,
@@ -422,7 +422,7 @@ zreadline_continue(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0 || op->value.intval > size)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
start = (uint) op->value.intval;
code = (start == 0 ? zreadline_at(i_ctx_p, op - 1, size, true) :
zreadline_at(i_ctx_p, op - 1, start, false));
@@ -459,7 +459,7 @@ zbytesavailable(i_ctx_t *i_ctx_p)
check_read_file(i_ctx_p, s, op);
switch (savailable(s, &avail)) {
default:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
case EOFC:
avail = -1;
case 0:
@@ -510,7 +510,7 @@ zflushfile(i_ctx_t *i_ctx_p)
*/
if (file_is_invalid(s, op)) {
if (r_has_attr(op, a_write))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
pop(1);
return 0;
}
@@ -598,7 +598,7 @@ zfileposition(i_ctx_t *i_ctx_p)
* streams.
*/
if (!s_can_seek(s))
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
make_int(op, stell(s));
return 0;
}
@@ -628,7 +628,7 @@ zsetfileposition(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
check_file(s, op - 1);
if (sseek(s, (gs_offset_t)op->value.intval) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
pop(2);
return 0;
}
@@ -653,7 +653,7 @@ zfilename(i_ctx_t *i_ctx_p)
check_ostack(1);
str = ialloc_string(fname.size, "filename");
if (str == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(str, fname.data, fname.size);
push(1); /* can't fail */
make_const_string( op - 1 ,
@@ -702,7 +702,7 @@ zpeekstring(i_ctx_t *i_ctx_p)
* which allocator to use and how it should interact with restore.
*/
if (len >= s->bsize)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
s_process_read_buf(s);
continue;
default:
@@ -733,9 +733,9 @@ zunread(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
ch = op->value.intval;
if (ch > 0xff)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (sungetc(s, (byte) ch) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
pop(2);
return 0;
}
@@ -756,10 +756,10 @@ zwritecvp_at(i_ctx_t *i_ctx_p, os_ptr op, uint start, bool first)
check_type(*op, t_integer);
code = obj_cvp(op - 1, str, sizeof(str), &len, (int)op->value.intval,
start, imemory, true);
- if (code == e_rangecheck) {
+ if (code == gs_error_rangecheck) {
code = obj_string_data(imemory, op - 1, &data, &len);
if (len < start)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
data += start;
len -= start;
}
@@ -770,7 +770,7 @@ zwritecvp_at(i_ctx_t *i_ctx_p, os_ptr op, uint start, bool first)
status = write_string(&rstr, s);
switch (status) {
default:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
case 0:
break;
case INTC:
@@ -810,7 +810,7 @@ zwritecvp_continue(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval != (uint) op->value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return zwritecvp_at(i_ctx_p, op - 1, (uint) op->value.intval, false);
}
@@ -863,9 +863,9 @@ file_switch_to_read(const ref * op)
stream *s = fptr(op);
if (s->write_id != r_size(op) || s->file == 0) /* not valid */
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
if (sswitch(s, false) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
s->read_id = s->write_id; /* enable reading */
s->write_id = 0; /* disable writing */
return 0;
@@ -879,9 +879,9 @@ file_switch_to_write(const ref * op)
stream *s = fptr(op);
if (s->read_id != r_size(op) || s->file == 0) /* not valid */
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
if (sswitch(s, true) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
s->write_id = s->read_id; /* enable writing */
s->read_id = 0; /* disable reading */
return 0;
@@ -928,7 +928,7 @@ copy_error_string(i_ctx_t *i_ctx_p, const ref *fop)
return code;
s->state->error_string[0] = 0; /* just do it once */
}
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
/* Handle an exceptional status return from a read stream. */
diff --git a/gs/psi/zfilter.c b/gs/psi/zfilter.c
index 307ce864e..5fd33ad36 100644
--- a/gs/psi/zfilter.c
+++ b/gs/psi/zfilter.c
@@ -153,13 +153,13 @@ zSFD(i_ctx_t *i_ctx_p)
if ((code = dict_int_param(op, "EODCount", 0, max_int, 0, &count)) < 0)
return code;
if (dict_find_string(op, "EODString", &sop) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
state.count = count;
npop = 0;
} else {
check_type(sop[-1], t_integer);
if (sop[-1].value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
state.count = sop[-1].value.intval;
npop = 2;
}
@@ -209,7 +209,7 @@ filter_read(i_ctx_t *i_ctx_p, int npop, const stream_template * templat,
ialloc_set_space(idmemory, use_space);
sstrm = file_alloc_stream(imemory, "filter_read(string stream)");
if (sstrm == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto out;
}
sread_string(sstrm, sop->value.bytes, r_size(sop));
@@ -289,7 +289,7 @@ filter_write(i_ctx_t *i_ctx_p, int npop, const stream_template * templat,
ialloc_set_space(idmemory, use_space);
sstrm = file_alloc_stream(imemory, "filter_write(string)");
if (sstrm == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto out;
}
swrite_string(sstrm, sop->value.bytes, r_size(sop));
@@ -396,7 +396,7 @@ filter_ensure_buf(stream ** ps, uint min_buf_size, gs_ref_memory_t *imem,
"filter_ensure_buf");
if (buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
s->cbuf = buf;
s->srptr = s->srlimit = s->swptr = buf - 1;
s->swlimit = buf - 1 + len;
diff --git a/gs/psi/zfilter2.c b/gs/psi/zfilter2.c
index 9fa5d3bde..fd3040c50 100644
--- a/gs/psi/zfilter2.c
+++ b/gs/psi/zfilter2.c
@@ -83,7 +83,7 @@ filter_write_predictor(i_ctx_t *i_ctx_p, int npop,
code = zpp_setup(op, &pps);
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if (code < 0)
return code;
diff --git a/gs/psi/zfilterx.c b/gs/psi/zfilterx.c
index 296543a07..32b3c7b37 100644
--- a/gs/psi/zfilterx.c
+++ b/gs/psi/zfilterx.c
@@ -51,10 +51,10 @@ zcomputecodes(i_ctx_t *i_ctx_p)
check_write_type(*op1, t_array);
asize = r_size(op1);
if (op->value.intval < 1 || op->value.intval > max_hc_length)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
def.num_counts = op->value.intval;
if (asize < def.num_counts + 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
def.num_values = asize - (def.num_counts + 1);
data = (ushort *) gs_alloc_byte_array(imemory, asize, sizeof(ushort),
"zcomputecodes");
@@ -63,7 +63,7 @@ zcomputecodes(i_ctx_t *i_ctx_p)
"zcomputecodes(freqs)");
if (data == 0 || freqs == 0)
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
else {
uint i;
@@ -73,7 +73,7 @@ zcomputecodes(i_ctx_t *i_ctx_p)
const ref *pf = op1->value.const_refs + i + def.num_counts + 1;
if (!r_has_type(pf, t_integer)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
break;
}
freqs[i] = pf->value.intval;
@@ -104,7 +104,7 @@ bt_setup(os_ptr op, stream_BT_state * pbts)
{
check_read_type(*op, t_string);
if (r_size(op) != 256)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
memcpy(pbts->table, op->value.const_bytes, 256);
return 0;
}
diff --git a/gs/psi/zfimscale.c b/gs/psi/zfimscale.c
index fe8228fcc..db86fe2b5 100644
--- a/gs/psi/zfimscale.c
+++ b/gs/psi/zfimscale.c
@@ -45,9 +45,9 @@ z_imscale_d(i_ctx_t * i_ctx_p)
check_type(*op, t_dictionary);
check_dict_read(*op);
if (dict_int_param(op, "Width", 0, 1<<24, -1, &width) < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (dict_int_param(op, "Height", 0, 1<<24, -1, &height) < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
state.params.spp_decode = 1;
state.params.spp_interp = 1;
diff --git a/gs/psi/zfjbig2.c b/gs/psi/zfjbig2.c
index 88add3ab5..4e325146a 100644
--- a/gs/psi/zfjbig2.c
+++ b/gs/psi/zfjbig2.c
@@ -106,13 +106,13 @@ z_jbig2makeglobalctx(i_ctx_t * i_ctx_p)
&global);
if (size > 0 && global == NULL) {
dmlprintf(imemory, "failed to create parsed JBIG2GLOBALS object.");
- return_error(e_unknownerror);
+ return_error(gs_error_unknownerror);
}
st = ialloc_struct(s_jbig2_global_data_t,
&st_jbig2_global_data_t,
"jbig2decode parsed global context");
- if (st == NULL) return_error(e_VMerror);
+ if (st == NULL) return_error(gs_error_VMerror);
st->data = global;
make_astruct(op, a_readonly | icurrent_space, (byte*)st);
diff --git a/gs/psi/zfont.c b/gs/psi/zfont.c
index 085f0732c..eb401a167 100644
--- a/gs/psi/zfont.c
+++ b/gs/psi/zfont.c
@@ -260,13 +260,13 @@ font_param(const ref * pfdict, gs_font ** ppfont)
if (dict_find_string(pfdict, "FID", &pid) <= 0 ||
!r_has_type(pid, t_fontID)
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
pfont = r_ptr(pid, gs_font);
if (pfont == 0)
- return_error(e_invalidfont); /* unregistered font */
+ return_error(gs_error_invalidfont); /* unregistered font */
pdata = pfont->client_data;
if (!obj_eq(pfont->memory, &pdata->dict, pfdict))
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
*ppfont = pfont;
return 0;
}
@@ -306,7 +306,7 @@ make_font(i_ctx_t *i_ctx_p, const gs_matrix * pmat)
if (dict_find_string(fp, "Encoding", &pencoding) > 0 &&
!r_is_array(pencoding)
)
- code = gs_note_error(e_invalidfont);
+ code = gs_note_error(gs_error_invalidfont);
else {
/*
* Temporarily substitute the new dictionary
@@ -332,7 +332,7 @@ make_font(i_ctx_t *i_ctx_p, const gs_matrix * pmat)
!obj_eq(imemory, pencoding, &pfont_data(newfont)->Encoding)
) {
if (newfont->FontType == ft_composite)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* We should really do validity checking here.... */
ref_assign(&pfont_data(newfont)->Encoding, pencoding);
lookup_gs_simple_font_encoding((gs_font_base *) newfont);
@@ -378,7 +378,7 @@ zdefault_make_font(gs_font_dir * pdir, const gs_font * oldfont,
if ((pdata = gs_alloc_struct(mem, font_data, &st_font_data,
"make_font(font_data)")) == 0
)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
/*
* This dictionary is newly created: it's safe to pass NULL as the
* dstack pointer to dict_copy and dict_put_string.
@@ -646,7 +646,7 @@ setup_unicode_decoder(i_ctx_t *i_ctx_p, ref *Decoding)
gs_unicode_decoder *pud = gs_alloc_struct(imemory, gs_unicode_decoder,
&st_unicode_decoder, "setup_unicode_decoder");
if (pud == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
ref_assign_new(&pud->data, Decoding);
ifont_dir->glyph_to_unicode_table = pud;
return 0;
diff --git a/gs/psi/zfont0.c b/gs/psi/zfont0.c
index f1407204d..6db3b84f8 100644
--- a/gs/psi/zfont0.c
+++ b/gs/psi/zfont0.c
@@ -76,7 +76,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
dict_find_string(op, "FDepVector", &pfdepvector) <= 0 ||
!r_is_array(pfdepvector)
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
data.FMapType = (fmap_type) pfmaptype->value.intval;
/*
* Adding elements below could cause the font dictionary to be
@@ -110,7 +110,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
!(data.FMapType == fmap_escape ||
data.FMapType == fmap_double_escape))
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
}
}
switch (data.FMapType) {
@@ -134,7 +134,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
(data.subs_width = (int)*psubsvector->value.bytes + 1) > 4 ||
(svsize - 1) % data.subs_width != 0
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
data.subs_size = (svsize - 1) / data.subs_width;
data.SubsVector.data = psubsvector->value.bytes + 1;
data.SubsVector.size = svsize - 1;
@@ -201,7 +201,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
*/
if (data.FMapType == fmap_SubsVector) {
if (data.subs_size >= r_size(&pdata->Encoding)) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
}
@@ -209,7 +209,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
(uint *) ialloc_byte_array(data.encoding_size, sizeof(uint),
"buildfont0(Encoding)");
if (data.Encoding == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
/* Fill in the encoding vector, checking to make sure that */
@@ -219,11 +219,11 @@ zbuildfont0(i_ctx_t *i_ctx_p)
array_get(imemory, &pdata->Encoding, i, &enc);
if (!r_has_type(&enc, t_integer)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto fail;
}
if ((ulong) enc.value.intval >= data.fdep_size) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
data.Encoding[i] = (uint) enc.value.intval;
@@ -233,7 +233,7 @@ zbuildfont0(i_ctx_t *i_ctx_p)
&st_gs_font_ptr_element,
"buildfont0(FDepVector)");
if (data.FDepVector == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
for (i = 0; i < data.fdep_size; i++) {
diff --git a/gs/psi/zfont1.c b/gs/psi/zfont1.c
index ed91a0da5..bb12b161f 100644
--- a/gs/psi/zfont1.c
+++ b/gs/psi/zfont1.c
@@ -74,16 +74,16 @@ charstring_font_get_refs(const_os_ptr op, charstring_font_refs_t *pfr)
if (dict_find_string(op, "Private", &pfr->Private) <= 0 ||
!r_has_type(pfr->Private, t_dictionary)
)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
make_empty_array(&pfr->no_subrs, 0);
if (dict_find_string(pfr->Private, "OtherSubrs", &pfr->OtherSubrs) > 0) {
if (!r_is_array(pfr->OtherSubrs))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
pfr->OtherSubrs = &pfr->no_subrs;
if (dict_find_string(pfr->Private, "Subrs", &pfr->Subrs) > 0) {
if (!r_is_array(pfr->Subrs))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else
pfr->Subrs = &pfr->no_subrs;
pfr->GlobalSubrs = &pfr->no_subrs;
@@ -136,10 +136,10 @@ charstring_font_params(const gs_memory_t *mem,
if ((code = dict_bool_param(pprivate, "RndStemUp", true, &pdata1->RndStemUp)) < 0)
return code;
if ((code = pdata1->StdHW.count = dict_float_array_check_param(mem, pprivate, "StdHW",
- 1, &pdata1->StdHW.values[0], NULL, 0, e_rangecheck)) < 0)
+ 1, &pdata1->StdHW.values[0], NULL, 0, gs_error_rangecheck)) < 0)
return code;
if ((code = pdata1->StdVW.count = dict_float_array_check_param(mem, pprivate, "StdVW",
- 1, &pdata1->StdVW.values[0], NULL, 0, e_rangecheck)) < 0)
+ 1, &pdata1->StdVW.values[0], NULL, 0, gs_error_rangecheck)) < 0)
return code;
if ((code = pdata1->StemSnapH.count = dict_float_array_param(mem, pprivate, "StemSnapH",
max_StemSnap, &pdata1->StemSnapH.values[0], NULL)) < 0)
diff --git a/gs/psi/zfont2.c b/gs/psi/zfont2.c
index 547a034f1..7be41a82a 100644
--- a/gs/psi/zfont2.c
+++ b/gs/psi/zfont2.c
@@ -61,7 +61,7 @@ type2_font_params(const_os_ptr op, charstring_font_refs_t *pfr,
/* Get information specific to Type 2 fonts. */
if (dict_find_string(pfr->Private, "GlobalSubrs", &temp) > 0) {
if (!r_is_array(temp))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
pfr->GlobalSubrs = temp;
}
pdata1->gsubrNumberBias = subr_bias(pfr->GlobalSubrs);
@@ -82,7 +82,7 @@ type2_font_params(const_os_ptr op, charstring_font_refs_t *pfr,
if (dict_find_string(pfr->Private, "initialRandomSeed", &pirs) <= 0)
pdata1->initialRandomSeed = 0;
else if (!r_has_type(pirs, t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
else
pdata1->initialRandomSeed = pirs->value.intval;
}
@@ -1303,7 +1303,7 @@ static int
card8(unsigned int *u, const cff_data_t *o, unsigned p, unsigned pe)
{
if (pe > o->length || p > pe - 1)
- return_error(e_rangecheck); /* out of range access */
+ return_error(gs_error_rangecheck); /* out of range access */
*u = o->blk_ref[p >> o->shift].value.bytes[p & o->mask];
return 0;
}
@@ -1312,7 +1312,7 @@ static int
card16(unsigned int *u, const cff_data_t *o, unsigned p, unsigned pe)
{
if (pe > o->length || p > pe - 2)
- return_error(e_rangecheck); /* out of range access */
+ return_error(gs_error_rangecheck); /* out of range access */
*u = (o->blk_ref[ p >> o->shift].value.bytes[ p & o->mask]) << 8 |
o->blk_ref[(p + 1) >> o->shift].value.bytes[(p + 1) & o->mask];
return 0;
@@ -1322,7 +1322,7 @@ static int
card24(unsigned int *u, const cff_data_t *o, unsigned p, unsigned pe)
{
if (pe > o->length || p > pe - 3)
- return_error(e_rangecheck); /* out of range access */
+ return_error(gs_error_rangecheck); /* out of range access */
*u = (o->blk_ref[ p >> o->shift].value.bytes[ p & o->mask]) << 16 |
(o->blk_ref[(p + 1) >> o->shift].value.bytes[(p + 1) & o->mask]) << 8 |
o->blk_ref[(p + 2) >> o->shift].value.bytes[(p + 2) & o->mask];
@@ -1332,7 +1332,7 @@ static int
card32(unsigned int *u, const cff_data_t *o, unsigned p, unsigned pe)
{
if (pe > o->length || p > pe - 4)
- return_error(e_rangecheck); /* out of range access */
+ return_error(gs_error_rangecheck); /* out of range access */
*u = (o->blk_ref[ p >> o->shift].value.bytes[ p & o->mask]) << 24 |
(o->blk_ref[(p + 1) >> o->shift].value.bytes[(p + 1) & o->mask]) << 16 |
(o->blk_ref[(p + 2) >> o->shift].value.bytes[(p + 2) & o->mask]) << 8 |
@@ -1348,7 +1348,7 @@ static int
get_cff_string(unsigned char *dst, const cff_data_t *o, unsigned p, unsigned len)
{
if (p + len > o->length)
- return_error(e_rangecheck); /* out of range access */
+ return_error(gs_error_rangecheck); /* out of range access */
while (len) {
unsigned chunk_len = o->mask + 1 - (p & o->mask);
unsigned char *pos = o->blk_ref[p >> o->shift].value.bytes + (p & o->mask);
@@ -1384,7 +1384,7 @@ parse_index(cff_index_t *x, const cff_data_t *data, unsigned p, unsigned pe)
x->data = 0;
x->end = p + 3;
} else if( x->offsize > 4) {
- return_error(e_rangecheck); /* Invalid offest size */
+ return_error(gs_error_rangecheck); /* Invalid offest size */
} else {
x->data = p + 2 + x->offsize*(x->count+1);
code = (*offset_procs[x->offsize])(&eod, data, p + 3 + x->offsize*x->count, pe);
@@ -1407,15 +1407,15 @@ peek_index(unsigned *pp, unsigned int *len, const cff_index_t *x, const cff_data
unsigned int off1, off2;
if (i >= x->count)
- return_error(e_rangecheck); /* wrong index */
+ return_error(gs_error_rangecheck); /* wrong index */
if((code = (*offset_procs[x->offsize])(&off1, data, x->start + 3 + x->offsize*i, x->end)) < 0)
return code;
if((code = (*offset_procs[x->offsize])(&off2, data, x->start + 3 + x->offsize*(i + 1), x->end)) < 0)
return code;
if (off2 < off1)
- return_error(e_rangecheck); /* Decreasing offsets */
+ return_error(gs_error_rangecheck); /* Decreasing offsets */
if (x->data + off2 > x->end)
- return_error(e_rangecheck); /* Element exceeds index size */
+ return_error(gs_error_rangecheck); /* Element exceeds index size */
*len = off2 - off1;
*pp = x->data + off1;
return 0;
@@ -1445,7 +1445,7 @@ get_int(int *v, const cff_data_t *data, unsigned p, unsigned pe)
return 5;
}
if (c < 32)
- return_error(e_rangecheck); /* out of range */
+ return_error(gs_error_rangecheck); /* out of range */
if (c < 247) {
*v = ((int)c - 139);
return 1;
@@ -1462,7 +1462,7 @@ get_int(int *v, const cff_data_t *data, unsigned p, unsigned pe)
*v = -((int)c - 251)*256 - (int)u - 108;
return 2;
}
- return_error(e_rangecheck); /* out of range */
+ return_error(gs_error_rangecheck); /* out of range */
}
static int
@@ -1545,7 +1545,7 @@ idict_undef_c_name(i_ctx_t *i_ctx_p, ref *dst, const char *c_name, unsigned int
if ((code = name_ref(imemory, (const unsigned char *)c_name, len, &ps_name, 0)) < 0)
return code;
code = idict_undef(dst, &ps_name);
- if (code < 0 && code != e_undefined) /* ignore undefined error */
+ if (code < 0 && code != gs_error_undefined) /* ignore undefined error */
return code;
return 0;
}
@@ -1578,9 +1578,9 @@ make_string_from_index(i_ctx_t *i_ctx_p, ref *dst, const cff_index_t *index, con
if ((code = peek_index(&doff, &len, index, data, id)) < 0)
return code;
if (len + fdoff> 65535)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((sbody = ialloc_string(len + fdoff, "make_string_from_index")) == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_string(dst, icurrent_space | a_readonly, len + fdoff, sbody);
if ((code = get_cff_string(sbody + fdoff, data, doff, len)) < 0)
return code;
@@ -1614,7 +1614,7 @@ make_name_from_sid(i_ctx_t *i_ctx_p, ref *dst, const cff_index_t *strings, const
if ((code = peek_index(&off, &len, strings, data, sid - count_of(standard_strings))) < 0)
return code;
if (len > sizeof(buf))
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = get_cff_string(buf, data, off, len)) < 0)
return code;
return name_ref(imemory, buf, len, dst, 1);
@@ -1660,7 +1660,7 @@ iso_adobe_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned
if (i < 228)
return i + 1;
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1669,7 +1669,7 @@ expert_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned i)
if (i < sizeof(expert_charset)/sizeof(*expert_charset))
return expert_charset[i];
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1678,7 +1678,7 @@ expert_subset_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsi
if (i < sizeof(expert_subset_charset)/sizeof(*expert_subset_charset))
return expert_subset_charset[i];
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1711,7 +1711,7 @@ format1_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned i
p += 3;
cid += count;
}
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1734,7 +1734,7 @@ format2_charset_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned i
p += 4;
cid += count;
}
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1772,7 +1772,7 @@ format3_fdselect_proc(const cff_data_t *data, unsigned p, unsigned pe, unsigned
}
p += 3;
}
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
static int
@@ -1790,7 +1790,7 @@ find_font_dict(i_ctx_t *i_ctx_p, ref *topdict, ref **fontdict, const char *key)
if ((code = idict_put_c_name(i_ctx_p, topdict, key, strlen(key), &val)) < 0)
return code;
if ((code = dict_find_string(topdict, key, fontdict)) == 0)
- return_error(e_undefined); /* can't happen */
+ return_error(gs_error_undefined); /* can't happen */
return code;
}
@@ -2076,7 +2076,7 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
break;
case 12:
if (p >= pe)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = card8(&c, data, p++, pe)) < 0)
return code;
switch(c) {
@@ -2152,7 +2152,7 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
ref ros;
if ((op_i -= 3) < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if ((code = dict_create(3, &ros)) < 0)
return code;
check_type(ops[op_i], t_integer);
@@ -2189,14 +2189,14 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
case 36: /* FDArray 12 36 number -, Font DICT (FD) INDEX offset (0) */
control = 0;
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->fdarray_off = ops[op_i].value.intval;
continue;
case 37: /* FDSelect 12 37 number -, FDSelect offset (0) */
control = 0;
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->fdselect_off = ops[op_i].value.intval;
continue;
@@ -2215,25 +2215,25 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
break;
case 15: /* charset 15 number 0, charset offset (0) */
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->charset_off = ops[op_i].value.intval;
continue;
case 16: /* Encoding 16 number 0, encoding offset (0) */
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->encoding_off = ops[op_i].value.intval;
continue;
case 17: /* CharStrings 17 number -, CharStrings offset (0) */
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->charstrings_off = ops[op_i].value.intval;
continue;
case 18: /* Private 18 number, number -, Private DICT size and offset (0)*/
if ((op_i -= 2) < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
check_type(ops[op_i + 1], t_integer);
offsets->private_size = ops[op_i].value.intval;
@@ -2241,7 +2241,7 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
continue;
case 19: /* Local Subrs 19 number -, Offset (self) to local subrs */
if (--op_i < 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
check_type(ops[op_i], t_integer);
offsets->local_subrs_off = ops[op_i].value.intval;
continue;
@@ -2255,7 +2255,7 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
continue;
case 30: { /* float operand */
if (op_i >= MAXOP)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = get_float(&ops[op_i], data, p, pe)) < 0)
return code;
@@ -2270,7 +2270,7 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
{ int n; /* int operand */
if (op_i >= MAXOP)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = get_int(&n, data, p - 1, pe)) < 0)
return code;
make_int(&ops[op_i], n);
@@ -2287,13 +2287,13 @@ parse_dict(i_ctx_t *i_ctx_p, ref *topdict, font_offsets_t *offsets,
if (n_op == 0)
n_op = op_i;
else if (op_i < n_op)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (control & k_delta)
undelta(ops + op_i - n_op, n_op);
op_i -= n_op;
if (control & (k_sid | k_int | k_bool)) {
if (!r_has_type(&ops[op_i], t_integer))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
if (control & k_bool)
make_bool(&arg, !!ops[op_i].value.intval);
@@ -2369,7 +2369,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
return code;
}
if (offsets.charstrings_off <= 0)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if ((code = parse_index(&charstrings_index, data, p_all + offsets.charstrings_off, pe_all)) < 0)
return code;
@@ -2399,7 +2399,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
peek_charset_proc = format2_charset_proc;
break;
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
}
@@ -2415,7 +2415,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
bool top_has_FontMatrix;
if (offsets.fdarray_off == 0 || fdselect_off == 0)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
if ((code = parse_index(&fdarray, data, p_all + offsets.fdarray_off, pe_all)) < 0)
return code;
if ((code = ialloc_ref_array(&fdarray_ref, a_readonly, fdarray.count, "parsecff.fdarray")) < 0)
@@ -2504,7 +2504,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
else if (fdselect_code == 3)
fdselect_proc = format3_fdselect_proc;
else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_int(&int_ref, 0);
for (i = 0; i < charstrings_index.count; i++) {
@@ -2654,7 +2654,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
memset(gid2char + k, 0, sizeof(gid2char) - k);
supp_enc_offset = p_all + offsets.encoding_off + 2*n_ranges + 2;
} else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if ((code = idict_put_c_name(i_ctx_p, topdict, STR2MEM("Encoding"), &encoding)) < 0)
return code;
@@ -2731,11 +2731,11 @@ zparsecff(i_ctx_t *i_ctx_p)
check_read_type(data.blk_ref[i], t_string);
len = r_size(&data.blk_ref[i]);
if (len > blk_sz || (len < blk_sz && i < blk_cnt - 1))
- return_error(e_rangecheck); /* last block can be smaller */
+ return_error(gs_error_rangecheck); /* last block can be smaller */
data.length += len;
}
if (data.length == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (blk_cnt == 1) {
data.mask = 0xffff; /* stub */
@@ -2747,7 +2747,7 @@ zparsecff(i_ctx_t *i_ctx_p)
};
data.mask = blk_sz - 1;
if (data.mask & blk_sz)
- return_error(e_rangecheck); /* not a power of 2 */
+ return_error(gs_error_rangecheck); /* not a power of 2 */
data.shift = mod2shift[blk_sz % 37];
}
} else if (r_has_type(op, t_string)) {
@@ -2757,7 +2757,7 @@ zparsecff(i_ctx_t *i_ctx_p)
data.mask = 0xffff; /* stub */
data.shift = 16; /* stub */
} else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_type(op[-1], t_boolean);
force_cidfont = op[-1].value.boolval;
@@ -2765,11 +2765,11 @@ zparsecff(i_ctx_t *i_ctx_p)
pe = p + data.length;
if (pe < 8) /* arbitrary, to avoid underflow in pe - 4 */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = card8(&hdr_ver, &data, p, pe)) < 0)
return code;
if (hdr_ver != 1)
- return_error(e_rangecheck); /* Unsupported version. */
+ return_error(gs_error_rangecheck); /* Unsupported version. */
if ((code = card8(&hdr_size, &data, p + 2, pe)) < 0)
return code;
if ((code = card8(&off_size, &data, p + 3, pe)) < 0)
@@ -2788,7 +2788,7 @@ zparsecff(i_ctx_t *i_ctx_p)
return code;
}
if (names.count >= 65535)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = dict_create(names.count, &fontset)) < 0)
return code;
@@ -2806,7 +2806,7 @@ zparsecff(i_ctx_t *i_ctx_p)
if (name_len == 0) /* deleted entry */
continue;
if (name_len > sizeof(buf))
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = get_cff_string(buf, &data, name_data, name_len)) < 0)
return code;
if (buf[0] == 0) /* deleted entry */
diff --git a/gs/psi/zfont42.c b/gs/psi/zfont42.c
index 4b4ccc673..21d518f60 100644
--- a/gs/psi/zfont42.c
+++ b/gs/psi/zfont42.c
@@ -133,7 +133,7 @@ font_string_array_param(const gs_memory_t *mem, os_ptr op, const char *kstr, ref
int code;
if (dict_find_string(op, kstr, &pvsa) <= 0)
- return_error(e_invalidfont);
+ return_error(gs_error_invalidfont);
*psa = *pvsa;
/*
* We only check the first element of the array now, as a sanity test;
@@ -142,7 +142,7 @@ font_string_array_param(const gs_memory_t *mem, os_ptr op, const char *kstr, ref
if ((code = array_get(mem, pvsa, 0L, &rstr0)) < 0)
return code;
if (!r_has_type(&rstr0, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return 0;
}
@@ -158,7 +158,7 @@ font_GlyphDirectory_param(os_ptr op, ref *pGlyphDirectory)
if (dict_find_string(op, "GlyphDirectory", &pgdir) <= 0)
make_null(pGlyphDirectory);
else if (!r_has_type(pgdir, t_dictionary) && !r_is_array(pgdir))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
else
*pGlyphDirectory = *pgdir;
return 0;
@@ -209,7 +209,7 @@ string_array_access_proc(const gs_memory_t *mem,
if (code < 0)
return code;
if (!r_has_type(&rstr, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/*
* NOTE: According to the Adobe documentation, each sfnts
* string should have even length. If the length is odd,
@@ -303,7 +303,7 @@ font_gdir_get_outline(const gs_memory_t *mem,
if (code < 0) {
gs_glyph_data_from_null(pgd);
} else if (!r_has_type(pgdef, t_string)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
} else {
gs_glyph_data_from_string(pgd, pgdef->value.const_bytes, r_size(pgdef),
NULL);
diff --git a/gs/psi/zfontenum.c b/gs/psi/zfontenum.c
index 5e2f01ada..52c9078b3 100644
--- a/gs/psi/zfontenum.c
+++ b/gs/psi/zfontenum.c
@@ -66,7 +66,7 @@ z_fontenum(i_ctx_t *i_ctx_p)
while((code = gp_enumerate_fonts_next(enum_state, &fontname, &path )) > 0) {
if (fontname == NULL || path == NULL) {
gp_enumerate_fonts_free(enum_state);
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
length = strlen(fontname) + 1;
@@ -95,14 +95,14 @@ z_fontenum(i_ctx_t *i_ctx_p)
length = strlen(r->fontname);
string = ialloc_string(length, "native font name");
if (string == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(string, r->fontname, length);
make_string(&(mapping.value.refs[0]), a_all | icurrent_space, length, string);
length = strlen(r->path);
string = ialloc_string(length, "native font path");
if (string == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(string, r->path, length);
make_string(&(mapping.value.refs[1]), a_all | icurrent_space, length, string);
diff --git a/gs/psi/zform.c b/gs/psi/zform.c
index 39101dc56..618b81c45 100644
--- a/gs/psi/zform.c
+++ b/gs/psi/zform.c
@@ -55,7 +55,7 @@ static int zbeginform(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
tmplate.FormID = -1;
tmplate.BBox.p.x = BBox[0];
tmplate.BBox.p.y = BBox[1];
@@ -66,7 +66,7 @@ static int zbeginform(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
tmplate.form_matrix.xx = Matrix[0];
tmplate.form_matrix.xy = Matrix[1];
@@ -166,7 +166,7 @@ static int zrepeatform(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
tmplate.BBox.p.x = BBox[0];
tmplate.BBox.p.y = BBox[1];
@@ -175,7 +175,7 @@ static int zrepeatform(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
tmplate.form_matrix.xx = Matrix[0];
tmplate.form_matrix.xy = Matrix[1];
diff --git a/gs/psi/zfproc.c b/gs/psi/zfproc.c
index ae04b7bfd..b12d13b03 100644
--- a/gs/psi/zfproc.c
+++ b/gs/psi/zfproc.c
@@ -72,7 +72,7 @@ s_proc_init(ref * sop, stream ** psstrm, uint mode,
if (sstrm == 0 || state == 0) {
gs_free_object(mem, state, "s_proc_init(state)");
/*gs_free_object(mem, sstrm, "s_proc_init(stream)"); *//* just leave it on the file list */
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
s_std_init(sstrm, NULL, 0, procs, mode);
sstrm->procs.process = temp->process;
@@ -101,7 +101,7 @@ s_handle_intc(i_ctx_t *i_ctx_p, const ref *pstate, int nstate,
memcpy(esp + 2, pstate, nstate * sizeof(ref));
#if 0 /* **************** */
{
- int code = gs_interpret_error(e_interrupt, (ref *) (esp + npush));
+ int code = gs_interpret_error(gs_error_interrupt, (ref *) (esp + npush));
if (code < 0)
return code;
@@ -193,7 +193,7 @@ s_handle_read_exception(i_ctx_t *i_ctx_p, int status, const ref * fop,
case CALLC:
break;
default:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
/* Find the stream whose buffer needs refilling. */
for (ps = fptr(fop); ps->strm != 0;)
@@ -315,7 +315,7 @@ s_handle_write_exception(i_ctx_t *i_ctx_p, int status, const ref * fop,
case CALLC:
break;
default:
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
/* Find the stream whose buffer needs emptying. */
for (ps = fptr(fop); ps->strm != 0;)
diff --git a/gs/psi/zfrsd.c b/gs/psi/zfrsd.c
index fb4bce99d..69aa0cc95 100644
--- a/gs/psi/zfrsd.c
+++ b/gs/psi/zfrsd.c
@@ -58,7 +58,7 @@ zrsdparams(i_ctx_t *i_ctx_p)
if (dict_find_string(op, "Filter", &pFilter) > 0) {
if (!r_is_array(pFilter)) {
if (!r_has_type(pFilter, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
make_array(&filter1_array, a_readonly, 1, pFilter);
pFilter = &filter1_array;
}
@@ -72,9 +72,9 @@ zrsdparams(i_ctx_t *i_ctx_p)
make_array(&parms1_array, a_readonly, 1, pDecodeParms);
pDecodeParms = &parms1_array;
} else if (!r_is_array(pDecodeParms))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
else if (r_size(pFilter) != r_size(pDecodeParms))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} else
pDecodeParms = 0;
for (i = 0; i < r_size(pFilter); ++i) {
@@ -82,20 +82,20 @@ zrsdparams(i_ctx_t *i_ctx_p)
array_get(imemory, pFilter, (long)i, &f);
if (!r_has_type(&f, t_name))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
name_string_ref(imemory, &f, &fname);
if (r_size(&fname) < 6 ||
memcmp(fname.value.bytes + r_size(&fname) - 6, "Decode", 6)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (pDecodeParms) {
array_get(imemory, pDecodeParms, (long)i, &dp);
if (!(r_has_type(&dp, t_dictionary) || r_has_type(&dp, t_null)))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
code = dict_int_param(op, "Intent", 0, 3, 0, &Intent);
- if (code < 0 && code != e_rangecheck) /* out-of-range int is ok, use 0 */
+ if (code < 0 && code != gs_error_rangecheck) /* out-of-range int is ok, use 0 */
return code;
if ((code = dict_bool_param(op, "AsyncRead", false, &AsyncRead)) < 0
)
@@ -148,7 +148,7 @@ zreusablestream(i_ctx_t *i_ctx_p)
uint size = gs_object_size(imemory, source_op->value.pstruct);
if (gs_object_type(imemory, source_op->value.pstruct) != &st_bytes)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_read(*source_op);
code = make_rss(i_ctx_p, source_op,
(const byte *)source_op->value.pstruct, size,
@@ -169,7 +169,7 @@ zreusablestream(i_ctx_t *i_ctx_p)
check_read_type(blk_ref[i], t_string);
len = r_size(&blk_ref[i]);
if (len > blk_sz || (len < blk_sz && i < blk_cnt - 1))
- return_error(e_rangecheck); /* last block can be smaller */
+ return_error(gs_error_rangecheck); /* last block can be smaller */
filelen += len;
}
}
@@ -198,7 +198,7 @@ rs:
offset, min(avail, length), false);
} else if (s->file != 0) { /* file stream */
if (~s->modes & (s_mode_read | s_mode_seek))
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
code = make_rfs(i_ctx_p, source_op, s, offset + stell(s), length);
} else if (s->state->templat == &s_SFD_template) {
/* SubFileDecode filter */
@@ -206,7 +206,7 @@ rs:
(const stream_SFD_state *)s->state;
if (sfd_state->eod.size != 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
offset += sfd_state->skip_count - sbufavailable(s);
if (sfd_state->count != 0) {
long left = max(sfd_state->count, 0) + sbufavailable(s);
@@ -218,7 +218,7 @@ rs:
goto rs;
}
else /* some other kind of stream */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (close_source) {
stream *rs = fptr(source_op);
@@ -244,7 +244,7 @@ make_rss(i_ctx_t *i_ctx_p, os_ptr op, const byte * data, uint size,
s = file_alloc_stream(imemory, "make_rss");
ialloc_set_space(idmemory, save_space);
if (s == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
sread_string_reusable(s, data + offset, max(left, 0));
if (is_bytestring)
s->cbuf_string.data = 0; /* byte array, not string */
@@ -264,13 +264,13 @@ make_rfs(i_ctx_t *i_ctx_p, os_ptr op, stream *fs, long offset, long length)
int code;
if (sfilename(fs, &fname) < 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
code = gs_parse_file_name(&pname, (const char *)fname.data, fname.size,
imemory);
if (code < 0)
return code;
if (pname.len == 0) /* %stdin% etc. won't have a filename */
- return_error(e_invalidfileaccess); /* can't reopen */
+ return_error(gs_error_invalidfileaccess); /* can't reopen */
if (pname.iodev == NULL)
pname.iodev = iodev_default(imemory);
/* Open the file again, to be independent of the source. */
@@ -281,7 +281,7 @@ make_rfs(i_ctx_t *i_ctx_p, os_ptr op, stream *fs, long offset, long length)
return code;
if (sread_subfile(s, offset, length) < 0) {
sclose(s);
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
s->close_at_eod = false;
make_stream_file(op, s, "r");
@@ -358,7 +358,7 @@ make_aos(i_ctx_t *i_ctx_p, os_ptr op, int blk_sz, int blk_sz_last, uint file_sz)
gs_free_object(imemory, ss, "st_aos_state");
gs_free_object(imemory, s, "aos_stream");
ialloc_set_space(idmemory, save_space);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
ialloc_set_space(idmemory, save_space);
ss->templat = &s_aos_template;
diff --git a/gs/psi/zfsample.c b/gs/psi/zfsample.c
index e9b1b6614..d2aeeed47 100644
--- a/gs/psi/zfsample.c
+++ b/gs/psi/zfsample.c
@@ -106,7 +106,7 @@ zbuildsampledfunction(i_ctx_t *i_ctx_p)
* Check procedure to be sampled.
*/
if (dict_find_string(pdict, "Function", &pfunc) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_proc(*pfunc);
/*
* Set up the hyper cube function data structure.
@@ -163,7 +163,7 @@ valid_cube_size(int num_inputs, int num_outputs, int sample_size, const int Size
*
* We do check to see if the data will fit using our initial guess. If not
* then we decrement the size of each edge until it fits. We will return a
- * e_rangecheck error if the cube can not fit into the maximum size.
+ * gs_error_rangecheck error if the cube can not fit into the maximum size.
* On exit the Size array contains the cube size (if a valid size was found).
*/
static int
@@ -301,7 +301,7 @@ cube_build_func0(const ref * pdict, gs_function_Sd_params_t * params,
params->n >>= 1;
if (params->m == 0 || params->n == 0 ||
params->m > MAX_NUM_INPUTS || params->n > MAX_NUM_OUTPUTS) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
/*
@@ -313,7 +313,7 @@ cube_build_func0(const ref * pdict, gs_function_Sd_params_t * params,
gs_alloc_byte_array(mem, params->m, sizeof(int), "Size");
if (ptr == NULL) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
params->Size = ptr;
@@ -333,7 +333,7 @@ cube_build_func0(const ref * pdict, gs_function_Sd_params_t * params,
else { /* Size array specified - verify valid */
if (code != params->m || !valid_cube_size(params->m, params->n,
params->BitsPerSample, params->Size))
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
}
@@ -348,7 +348,7 @@ cube_build_func0(const ref * pdict, gs_function_Sd_params_t * params,
*/
bytes = gs_alloc_byte_array(mem, total_size, 1, "cube_build_func0(bytes)");
if (!bytes) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
data_source_init_bytes(&params->DataSource,
@@ -358,7 +358,7 @@ cube_build_func0(const ref * pdict, gs_function_Sd_params_t * params,
fail:
gs_function_Sd_free_params(params, mem);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
/*
@@ -407,7 +407,7 @@ sampled_data_setup(i_ctx_t *i_ctx_p, gs_function_t *pfn,
*/
penum = gs_sampled_data_enum_alloc(imemory, "zbuildsampledfuntion(params)");
if (penum == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
/* Initialize data in the enumeration structure */
@@ -506,7 +506,7 @@ sampled_data_continue(i_ctx_t *i_ctx_p)
push(-stack_depth_adjust);
ifree_object(penum->pfn, "sampled_data_continue(pfn)");
ifree_object(penum, "sampled_data_continue((enum)");
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
}
}
@@ -606,7 +606,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
if (code < 0)
return code;
if (!space->alternateproc)
- return e_typecheck;
+ return gs_error_typecheck;
code = space->alternateproc(i_ctx_p, arr, &palternatespace, &CIESubst);
if (code < 0)
return code;
@@ -624,7 +624,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
return code;
fptr = (float *)gs_alloc_byte_array(imemory, num_components * 2, sizeof(float), "make_sampled_function(Domain)");
if (!fptr)
- return e_VMerror;
+ return gs_error_VMerror;
code = space->domain(i_ctx_p, arr, fptr);
if (code < 0) {
gs_free_const_object(imemory, fptr, "make_sampled_function(Domain)");
@@ -641,7 +641,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
fptr = (float *)gs_alloc_byte_array(imemory, num_components * 2, sizeof(float), "make_sampled_function(Range)");
if (!fptr) {
gs_free_const_object(imemory, params.Domain, "make_sampled_function(Domain)");
- return e_VMerror;
+ return gs_error_VMerror;
}
code = altspace->range(i_ctx_p, palternatespace, fptr);
if (code < 0) {
@@ -658,7 +658,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
*/
ptr = (int *)gs_alloc_byte_array(imemory, params.m, sizeof(int), "Size");
if (ptr == NULL) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
params.Size = ptr;
@@ -681,7 +681,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
*/
bytes = gs_alloc_byte_array(imemory, total_size, 1, "cube_build_func0(bytes)");
if (!bytes) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
data_source_init_bytes(&params.DataSource,
@@ -705,7 +705,7 @@ int make_sampled_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t
fail:
gs_function_Sd_free_params(&params, imemory);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
/* ------ Initialization procedure ------ */
diff --git a/gs/psi/zfunc.c b/gs/psi/zfunc.c
index 9053562da..bb22e6f39 100644
--- a/gs/psi/zfunc.c
+++ b/gs/psi/zfunc.c
@@ -107,14 +107,14 @@ zscalefunction(i_ctx_t *i_ctx_p)
check_proc(op[-1]);
pfn = ref_function(op - 1);
if (pfn == 0 || !r_is_array(op))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(op) != 2 * pfn->params.n)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ranges = (gs_range_t *)
gs_alloc_byte_array(imemory, pfn->params.n, sizeof(gs_range_t),
"zscalefunction");
if (ranges == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
for (i = 0; i < pfn->params.n; ++i) {
ref rval[2];
float val[2];
@@ -158,7 +158,7 @@ zexecfunction(i_ctx_t *i_ctx_p)
if (!r_is_struct(op) ||
!r_has_masked_attrs(op, a_executable | a_execute, a_executable | a_all)
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
{
gs_function_t *pfn = (gs_function_t *) op->value.pstruct;
int m = pfn->params.m, n = pfn->params.n;
@@ -178,7 +178,7 @@ zexecfunction(i_ctx_t *i_ctx_p)
in = (float *)ialloc_byte_array(m + n, sizeof(float),
"%execfunction(in/out)");
if (in == 0)
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
}
out = in + m;
if (code < 0 ||
@@ -240,7 +240,7 @@ fn_build_sub_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
gs_function_params_t params;
if (depth > MAX_SUB_FUNCTION_DEPTH)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
check_type(*op, t_dictionary);
code = dict_int_param(op, "FunctionType", 0, max_int, -1, &type);
if (code < 0)
@@ -249,7 +249,7 @@ fn_build_sub_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
if (build_function_type_table[i].type == type)
break;
if (i == build_function_type_table_count)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* Collect parameters common to all function types. */
params.Domain = 0;
params.Range = 0;
@@ -261,7 +261,7 @@ fn_build_sub_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
params.m = code >> 1;
for (j = 0; j < params.m << 1; j += 2) {
if (params.Domain[j] >= params.Domain[j + 1]) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
gs_errorinfo_put_pair_from_dict(i_ctx_p, op, "Domain");
goto fail;
}
@@ -272,12 +272,12 @@ fn_build_sub_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
* here because Adobe checks Domain before checking other parameters.
*/
if (num_inputs != params.m)
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
for (j = 0; j < 2*num_inputs && code >= 0; j += 2) {
if (params.Domain[j] > shading_domain[j] ||
params.Domain[j+1] < shading_domain[j+1]
) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
}
}
if (code < 0) {
@@ -314,22 +314,22 @@ fn_build_float_array(const ref * op, const char *kstr, bool required,
*pparray = 0;
if (dict_find_string(op, kstr, &par) <= 0)
- return (required ? gs_note_error(e_rangecheck) : 0);
+ return (required ? gs_note_error(gs_error_rangecheck) : 0);
if (!r_is_array(par))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
{
uint size = r_size(par);
float *ptr = (float *)
gs_alloc_byte_array(mem, size, sizeof(float), kstr);
if (ptr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = dict_float_array_check_param(mem, op, kstr, size,
ptr, NULL,
- 0, e_rangecheck);
+ 0, gs_error_rangecheck);
if (code < 0 || (even && (code & 1) != 0)) {
gs_free_object(mem, ptr, kstr);
- return(code < 0 ? code : gs_note_error(e_rangecheck));
+ return(code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
*pparray = ptr;
}
@@ -352,22 +352,22 @@ fn_build_float_array_forced(const ref * op, const char *kstr, bool required,
*pparray = 0;
if (dict_find_string(op, kstr, &par) <= 0)
- return (required ? gs_note_error(e_rangecheck) : 0);
+ return (required ? gs_note_error(gs_error_rangecheck) : 0);
if( r_is_array(par) )
size = r_size(par);
else if(r_type(par) == t_integer || r_type(par) == t_real)
size = 1;
else
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ptr = (float *)gs_alloc_byte_array(mem, size, sizeof(float), kstr);
if (ptr == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if(r_is_array(par) )
code = dict_float_array_check_param(mem, op, kstr,
size, ptr, NULL,
- 0, e_rangecheck);
+ 0, gs_error_rangecheck);
else {
code = dict_float_param(op, kstr, 0., ptr); /* defailt cannot happen */
if( code == 0 )
diff --git a/gs/psi/zfunc0.c b/gs/psi/zfunc0.c
index ea174ad13..15fda3248 100644
--- a/gs/psi/zfunc0.c
+++ b/gs/psi/zfunc0.c
@@ -45,7 +45,7 @@ gs_build_function_0(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
params.pole = NULL;
params.Size = params.array_step = params.stream_step = NULL;
if ((code = dict_find_string(op, "DataSource", &pDataSource)) <= 0)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
switch (r_type(pDataSource)) {
case t_string:
data_source_init_string2(&params.DataSource,
@@ -56,14 +56,14 @@ gs_build_function_0(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
stream *s;
check_read_known_file_else(s, pDataSource, return_error,
- return_error(e_invalidfileaccess));
+ return_error(gs_error_invalidfileaccess));
if (!(s->modes & s_mode_seek))
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
data_source_init_stream(&params.DataSource, s);
break;
}
default:
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
if ((code = dict_int_param(op, "Order", 1, 3, 1, &params.Order)) < 0 ||
(code = dict_int_param(op, "BitsPerSample", 1, 32, 0,
@@ -77,7 +77,7 @@ gs_build_function_0(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
gs_alloc_byte_array(mem, params.m, sizeof(int), "Size");
if (ptr == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
params.Size = ptr;
@@ -90,5 +90,5 @@ gs_build_function_0(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
return 0;
fail:
gs_function_Sd_free_params(&params, mem);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
diff --git a/gs/psi/zfunc3.c b/gs/psi/zfunc3.c
index 00ecde458..59de11a07 100644
--- a/gs/psi/zfunc3.c
+++ b/gs/psi/zfunc3.c
@@ -62,7 +62,7 @@ gs_build_function_2(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
return 0;
fail:
gs_function_ElIn_free_params(&params, mem);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
/* Finish building a FunctionType 3 (1-Input Stitching) function. */
@@ -83,7 +83,7 @@ gs_build_function_3(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
int i;
if ((code = dict_find_string(op, "Functions", &pFunctions)) <= 0)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
check_array_only(*pFunctions);
params.k = r_size(pFunctions);
code = alloc_function_array(params.k, &ptr, mem);
@@ -111,15 +111,15 @@ gs_build_function_3(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
params.Encode = p;
if (p == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
if (dict_find_string(op, "Encode", &encode) <= 0) {
- code = gs_note_error(e_undefined);
+ code = gs_note_error(gs_error_undefined);
goto fail;
}
if (!r_is_array(encode)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto fail;
}
sz = min(k2, r_size(encode));
@@ -137,5 +137,5 @@ gs_build_function_3(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
return 0;
fail:
gs_function_1ItSg_free_params(&params, mem);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
diff --git a/gs/psi/zfunc4.c b/gs/psi/zfunc4.c
index 9c6cd1b56..a5fbca5df 100644
--- a/gs/psi/zfunc4.c
+++ b/gs/psi/zfunc4.c
@@ -332,7 +332,7 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
break;
case t_name:
if (!r_has_attr(&elt, a_executable))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
name_string_ref(imemory, &elt, &elt);
if (!bytes_compare(elt.value.bytes, r_size(&elt),
(const byte *)"true", 4)) {
@@ -348,11 +348,11 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
}
/* Check if the name is a valid operator in systemdict */
if (dict_find(systemdict, &elt, &delp) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (r_btype(delp) != t_operator)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (!r_has_attr(delp, a_executable))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
elt = *delp;
/* Fall into the operator case */
case t_operator: {
@@ -364,13 +364,13 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
++*psize;
goto next;
}
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
default: {
if (!r_is_proc(&elt))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (depth == MAX_PSC_FUNCTION_NESTING)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if ((code = array_get(imemory, pref, ++i, &elt2)) < 0)
return code;
*psize += 3;
@@ -380,7 +380,7 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
/* Check for { proc } repeat | {proc} if | {proc1} {proc2} ifelse */
if (resolves_to_oper(i_ctx_p, &elt2, zrepeat)) {
if (!AllowRepeat)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (ops) {
*p = PtCr_repeat;
psc_fixup(p, ops + *psize);
@@ -394,7 +394,7 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
psc_fixup(p, ops + *psize);
}
} else if (!r_is_proc(&elt2))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
else if ((code = array_get(imemory, pref, ++i, &elt3)) < 0)
return code;
else if (resolves_to_oper(i_ctx_p, &elt3, zifelse)) {
@@ -411,7 +411,7 @@ check_psc_function(i_ctx_t *i_ctx_p, const ref *pref, int depth, byte *ops, int
if (ops)
psc_fixup(p, ops + *psize);
} else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
} /* end 'default' */
}
next:
@@ -440,11 +440,11 @@ gs_build_function_4(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
params.ops.data = 0; /* in case of failure */
params.ops.size = 0; /* ditto */
if (dict_find_string(op, "Function", &proc) <= 0) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto fail;
}
if (!r_is_proc(proc)) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
goto fail;
}
size = 0;
@@ -479,7 +479,7 @@ gs_build_function_4(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
goto fail;
ops = gs_alloc_string(mem, size + 1, "gs_build_function_4(ops)");
if (ops == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
size = 0;
@@ -493,7 +493,7 @@ gs_build_function_4(i_ctx_t *i_ctx_p, const ref *op, const gs_function_params_t
/* free_params will free the ops string */
fail:
gs_function_PtCr_free_params(&params, mem);
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
int make_type4_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t **func)
@@ -510,7 +510,7 @@ int make_type4_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t *
if (code < 0)
return code;
if (!space->alternateproc)
- return e_typecheck;
+ return gs_error_typecheck;
code = space->alternateproc(i_ctx_p, arr, &palternatespace, &CIESubst);
if (code < 0)
return code;
@@ -523,7 +523,7 @@ int make_type4_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t *
return code;
ptr = (float *)gs_alloc_byte_array(imemory, num_components * 2, sizeof(float), "make_type4_function(Domain)");
if (!ptr)
- return e_VMerror;
+ return gs_error_VMerror;
code = space->domain(i_ctx_p, arr, ptr);
if (code < 0) {
gs_free_const_object(imemory, ptr, "make_type4_function(Domain)");
@@ -540,7 +540,7 @@ int make_type4_function(i_ctx_t * i_ctx_p, ref *arr, ref *pproc, gs_function_t *
ptr = (float *)gs_alloc_byte_array(imemory, num_components * 2, sizeof(float), "make_type4_function(Range)");
if (!ptr) {
gs_free_const_object(imemory, params.Domain, "make_type4_function(Domain)");
- return e_VMerror;
+ return gs_error_VMerror;
}
code = altspace->range(i_ctx_p, &alternatespace, ptr);
if (code < 0) {
diff --git a/gs/psi/zgeneric.c b/gs/psi/zgeneric.c
index 983139c2b..359aebcfa 100644
--- a/gs/psi/zgeneric.c
+++ b/gs/psi/zgeneric.c
@@ -77,9 +77,9 @@ zcopy_integer(i_ctx_t *i_ctx_p)
/* There might be enough elements in other blocks. */
check_type(*op, t_integer);
if (op->value.intval >= (int)ref_stack_count(&o_stack))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
check_int_ltu(*op, ref_stack_count(&o_stack));
count = op->value.intval;
} else if (op1 + (count = op->value.intval) <= ostop) {
@@ -141,7 +141,7 @@ zlength(i_ctx_t *i_ctx_p)
}
case t_astruct:
if (gs_object_type(imemory, op->value.pstruct) != &st_bytes)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_read(*op);
make_int(op, gs_object_size(imemory, op->value.pstruct));
return 0;
@@ -164,7 +164,7 @@ zget(i_ctx_t *i_ctx_p)
case t_dictionary:
check_dict_read(*op1);
if (dict_find(op1, op, &pvalue) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
op[-1] = *pvalue;
break;
case t_string:
@@ -182,9 +182,9 @@ zget(i_ctx_t *i_ctx_p)
return code;
break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
pop(1);
return 0;
@@ -225,7 +225,7 @@ zput(i_ctx_t *i_ctx_p)
break;
case t_mixedarray: /* packed arrays are read-only */
case t_shortarray:
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
case t_string:
sdata = op2->value.bytes;
ssize = r_size(op2);
@@ -236,7 +236,7 @@ str: check_write(*op2);
break;
case t_astruct:
if (gs_object_type(imemory, op2->value.pstruct) != &st_bytes)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
sdata = r_ptr(op2, byte);
ssize = gs_object_size(imemory, op2->value.pstruct);
goto str;
@@ -270,7 +270,7 @@ zforceput(i_ctx_t *i_ctx_p)
check_int_ltu(*op1, r_size(op2));
if (r_space(op2) > r_space(op)) {
if (imemory_save_level(iimemory))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
{
ref *eltp = op2->value.refs + (uint) op1->value.intval;
@@ -293,7 +293,7 @@ zforceput(i_ctx_t *i_ctx_p)
return code;
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
pop(3);
return 0;
@@ -359,15 +359,15 @@ zputinterval(i_ctx_t *i_ctx_p)
switch (r_type(opto)) {
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
case t__invalid:
if (r_type(op) != t_array && r_type(op) != t_string && r_type(op) != t__invalid)
- return_error(e_typecheck); /* to match Distiller */
+ return_error(gs_error_typecheck); /* to match Distiller */
else
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
case t_mixedarray:
case t_shortarray:
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
case t_array:
case t_string:
check_write(*opto);
@@ -380,14 +380,14 @@ zputinterval(i_ctx_t *i_ctx_p)
check_write(*opto);
if (gs_object_type(imemory, opto->value.pstruct) != &st_bytes)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
dsize = gs_object_size(imemory, opto->value.pstruct);
check_int_leu(*opindex, dsize);
index = (uint)opindex->value.intval;
check_read_type(*op, t_string);
ssize = r_size(op);
if (ssize > dsize - index)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
memcpy(r_ptr(opto, byte) + index, op->value.const_bytes, ssize);
code = 0;
break;
@@ -585,7 +585,7 @@ copy_interval(i_ctx_t *i_ctx_p /* for ref_assign_old */, os_ptr prto,
check_read(*prfrom);
check_write(*prto);
if (fromsize > r_size(prto) - index)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
switch (fromtype) {
case t_array:
{ /* We have to worry about aliasing, */
diff --git a/gs/psi/zgstate.c b/gs/psi/zgstate.c
index 70db2d98b..bb9693169 100644
--- a/gs/psi/zgstate.c
+++ b/gs/psi/zgstate.c
@@ -311,7 +311,7 @@ zsetdash(i_ctx_t *i_ctx_p)
(float *)gs_alloc_byte_array(mem, n, sizeof(float), "setdash");
if (pattern == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
for (i = 0, code = 0; i < n && code >= 0; ++i) {
ref element;
@@ -383,7 +383,7 @@ zsetcurvejoin(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < -1 || op->value.intval > max_int)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = gs_setcurvejoin(igs, (int)op->value.intval);
if (code < 0)
return code;
diff --git a/gs/psi/zht.c b/gs/psi/zht.c
index 43ea074f7..e57fb0797 100644
--- a/gs/psi/zht.c
+++ b/gs/psi/zht.c
@@ -161,7 +161,7 @@ zscreen_enum_init(i_ctx_t *i_ctx_p, const gx_ht_order * porder,
check_estack(snumpush + 1);
penum = gs_screen_enum_alloc(mem, "setscreen");
if (penum == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_struct(esp + snumpush, space_index << r_space_shift, penum); /* do early for screen_cleanup in case of error */
code = gs_screen_enum_init_memory(penum, porder, igs, psp, mem);
if (code < 0) {
diff --git a/gs/psi/zht1.c b/gs/psi/zht1.c
index 6106d99a9..699edbd57 100644
--- a/gs/psi/zht1.c
+++ b/gs/psi/zht1.c
@@ -70,7 +70,7 @@ zsetcolorscreen(i_ctx_t *i_ctx_p)
rc_alloc_struct_0(pdht, gx_device_halftone, &st_device_halftone,
mem, pdht = 0, "setcolorscreen(device halftone)");
if (pht == 0 || pdht == 0)
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
else {
pht->type = ht_type_colorscreen;
pht->params.colorscreen = cscreen;
diff --git a/gs/psi/zht2.c b/gs/psi/zht2.c
index 24e92b130..dc31f50d2 100644
--- a/gs/psi/zht2.c
+++ b/gs/psi/zht2.c
@@ -140,7 +140,7 @@ zsethalftone5(i_ctx_t *i_ctx_p)
else if (colorant_number == GX_DEVICE_COLOR_MAX_COMPONENTS) {
/* If here then we have the "Default" component */
if (have_default)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
have_default = true;
}
@@ -150,12 +150,12 @@ zsethalftone5(i_ctx_t *i_ctx_p)
* components.
*/
if (count > GS_CLIENT_COLOR_MAX_COMPONENTS + 1) {
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
break;
}
}
if (count == 0 || (halftonetype == ht_type_multiple && ! have_default))
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
if (code >= 0) {
check_estack(5); /* for sampling Type 1 screens */
@@ -172,7 +172,7 @@ zsethalftone5(i_ctx_t *i_ctx_p)
j = 0; /* Quiet the compiler:
gs_note_error isn't necessarily identity,
so j could be left ununitialized. */
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
}
}
if (code >= 0) {
@@ -207,12 +207,12 @@ zsethalftone5(i_ctx_t *i_ctx_p)
/* Now process the component dictionary */
check_dict_read(rvalue[1]);
if (dict_int_param(&rvalue[1], "HalftoneType", 1, 7, 0, &type) < 0) {
- code = gs_note_error(e_typecheck);
+ code = gs_note_error(gs_error_typecheck);
break;
}
switch (type) {
default:
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
break;
case 1:
code = dict_spot_params(&rvalue[1], &pc->params.spot,
@@ -422,7 +422,7 @@ dict_spot_params(const ref * pdict, gs_spot_halftone * psp,
&psp->accurate_screens)) < 0 ||
(code = dict_proc_param(pdict, "TransferFunction", ptproc, false)) < 0
)
- return (code < 0 ? code : e_undefined);
+ return (code < 0 ? code : gs_error_undefined);
psp->transfer = (code > 0 ? (gs_mapping_proc) 0 : gs_mapped_transfer);
psp->transfer_closure.proc = 0;
psp->transfer_closure.data = 0;
@@ -474,7 +474,7 @@ dict_threshold_common_params(const ref * pdict,
(code = dict_find_string(pdict, "Thresholds", pptstring)) <= 0 ||
(code = dict_proc_param(pdict, "TransferFunction", ptproc, false)) < 0
)
- return (code < 0 ? code : e_undefined);
+ return (code < 0 ? code : gs_error_undefined);
ptp->transfer_closure.proc = 0;
ptp->transfer_closure.data = 0;
return code;
@@ -495,7 +495,7 @@ dict_threshold_params(const ref * pdict, gs_threshold_halftone * ptp,
return code;
check_read_type_only(*tstring, t_string);
if (r_size(tstring) != (long)ptp->width * ptp->height)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ptp->thresholds.data = tstring->value.const_bytes;
ptp->thresholds.size = r_size(tstring);
ptp->transfer = (code > 0 ? (gs_mapping_proc) 0 : gs_mapped_transfer);
@@ -528,7 +528,7 @@ dict_threshold2_params(const ref * pdict, gs_threshold2_halftone * ptp,
if ((bps != 8 && bps != 16) || cw2 != ch2 ||
(!cw2 && (ptp->width2 == 0 || ptp->height2 == 0))
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ptp->bytes_per_sample = bps / 8;
switch (r_type(tstring)) {
case t_string:
@@ -538,17 +538,17 @@ dict_threshold2_params(const ref * pdict, gs_threshold2_halftone * ptp,
break;
case t_astruct:
if (gs_object_type(mem, tstring->value.pstruct) != &st_bytes)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
size = gs_object_size(mem, tstring->value.pstruct);
gs_bytestring_from_bytes(&ptp->thresholds, r_ptr(tstring, byte),
0, size);
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
check_read(*tstring);
if (size != (ptp->width * ptp->height + ptp->width2 * ptp->height2) *
ptp->bytes_per_sample)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return 0;
}
diff --git a/gs/psi/zicc.c b/gs/psi/zicc.c
index 1e9e5d4d2..00e97b268 100644
--- a/gs/psi/zicc.c
+++ b/gs/psi/zicc.c
@@ -63,7 +63,7 @@ int seticc(i_ctx_t * i_ctx_p, int ncomps, ref *ICCdict, float *range_buff)
/* verify the DataSource entry */
if (dict_find_string(ICCdict, "DataSource", &pstrmval) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
check_read_file(i_ctx_p, s, pstrmval);
/* build the color space object */
@@ -144,7 +144,7 @@ int seticc(i_ctx_t * i_ctx_p, int ncomps, ref *ICCdict, float *range_buff)
if (!expected || ncomps != expected) {
rc_decrement(picc_profile,"seticc");
rc_decrement(pcs,"seticc");
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* Lets go ahead and get the hash code and check if we match one of the default spaces */
@@ -263,7 +263,7 @@ zset_outputintent(i_ctx_t * i_ctx_p)
/* verify the DataSource entry. Creat profile from stream */
if (dict_find_string(op, "DataSource", &pstrmval) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
check_read_file(i_ctx_p, s, pstrmval);
picc_profile = gsicc_profile_new(s, gs_state_memory(igs), NULL, 0);
@@ -301,7 +301,7 @@ zset_outputintent(i_ctx_t * i_ctx_p)
}
if (expected && ncomps != expected) {
rc_decrement(picc_profile,"zset_outputintent");
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
gsicc_init_hash_cs(picc_profile, pis);
@@ -428,10 +428,10 @@ zseticcspace(i_ctx_t * i_ctx_p)
return code;
ncomps = pnval->value.intval;
if (2*ncomps > sizeof(range_buff)/sizeof(range_buff[0]))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/* verify the DataSource entry */
if (dict_find_string(op, "DataSource", &pstrmval) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
check_read_file(i_ctx_p, s, pstrmval);
/*
* Verify that the current color space can be a alternative color space.
@@ -441,7 +441,7 @@ zseticcspace(i_ctx_t * i_ctx_p)
palt_cs = gs_currentcolorspace(igs);
if ( !palt_cs->type->can_be_alt_space ||
gs_color_space_get_index(palt_cs) == gs_color_space_index_ICC )
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
/*
* Fetch and verify the Range array.
*
@@ -467,7 +467,7 @@ zseticcspace(i_ctx_t * i_ctx_p)
for (i = 0; i < 2 * ncomps && range_buff[i + 1] >= range_buff[i]; i += 2)
;
if (i != 2 * ncomps)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
return seticc(i_ctx_p, ncomps, op, range_buff);
}
diff --git a/gs/psi/zimage.c b/gs/psi/zimage.c
index 918e64025..c886f5711 100644
--- a/gs/psi/zimage.c
+++ b/gs/psi/zimage.c
@@ -96,7 +96,7 @@ data_image_params(const gs_memory_t *mem,
if (code < 0) {
/* Try for all three pairs. Ignore more than 6 elements */
code = dict_float_array_check_param(mem, op, "Decode", 6,
- &pim->Decode[0], NULL, e_rangecheck, 0); /* over_error = 0 */
+ &pim->Decode[0], NULL, gs_error_rangecheck, 0); /* over_error = 0 */
} else {
/* Set the range on the L */
pim->Decode[0] = 0;
@@ -107,7 +107,7 @@ data_image_params(const gs_memory_t *mem,
} else {
/* more elements than we need is OK */
code = dict_float_array_check_param(mem, op, "Decode", 2 * num_components,
- &pim->Decode[0], NULL, e_rangecheck, 0); /* over_error = 0 */
+ &pim->Decode[0], NULL, gs_error_rangecheck, 0); /* over_error = 0 */
if (code < 0)
return code;
}
@@ -115,16 +115,16 @@ data_image_params(const gs_memory_t *mem,
/* Extract and check the data sources. */
if ((code = dict_find_string(op, "DataSource", &pds)) <= 0) {
if (require_DataSource)
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
return 1; /* no data source */
}
if (pip->MultipleDataSources) {
ref *ds = pip->DataSource;
long i, n = num_components + (has_alpha ? 1 : 0);
if (!r_is_array(pds))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (r_size(pds) != n)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
for (i = 0; i < n; ++i)
array_get(mem, pds, i, &ds[i]);
if (r_type(&ds[0]) == t_string) {
@@ -135,7 +135,7 @@ data_image_params(const gs_memory_t *mem,
n--;
for (i = 1; i < n; ++i) {
if (r_type(&ds[i]) == t_string && r_size(&ds[i]) != r_size(&ds[0])) {
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
}
@@ -156,7 +156,7 @@ pixel_image_params(i_ctx_t *i_ctx_p, const ref *op, gs_pixel_image_t *pim,
int code;
if (num_components < 1)
- return_error(e_rangecheck); /* Pattern space not allowed */
+ return_error(gs_error_rangecheck); /* Pattern space not allowed */
pim->ColorSpace = csp;
if (pim->ColorSpace->cmm_icc_profile_data != NULL)
@@ -341,7 +341,7 @@ zimage_data_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
switch (r_type(pp)) {
case t_file:
if (!level2_enabled)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
/* Check for aliasing. */
{
int pi;
@@ -359,7 +359,7 @@ zimage_data_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
case t_string:
if (r_type(pp) != r_type(sources)) {
gx_image_end(pie, false); /* Clean up pie */
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
check_read(*pp);
break;
@@ -368,7 +368,7 @@ zimage_data_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
static const char ds[] = "DataSource";
gx_image_end(pie, false); /* Clean up pie */
gs_errorinfo_put_pair(i_ctx_p, ds, sizeof(ds) - 1, pp);
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
check_proc(*pp);
string_sources = false;
@@ -380,7 +380,7 @@ zimage_data_setup(i_ctx_t *i_ctx_p, const gs_pixel_image_t * pim,
which may be local when the current allocation mode is global.
Bug 688140. */
if ((penum = gs_image_enum_alloc(imemory_local, "image_setup")) == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = gs_image_enum_init(penum, pie, (const gs_data_image_t *)pim, igs);
if (code != 0 || (pie->skipping && string_sources)) { /* error, or empty image */
int code1 = gs_image_cleanup_and_free_enum(penum, igs);
@@ -439,7 +439,7 @@ image_proc_continue(i_ctx_t *i_ctx_p)
/* Procedure didn't return a (readable) string. Quit. */
esp = zimage_pop_estack(esp);
image_cleanup(i_ctx_p);
- return_error(!r_has_type(op, t_string) ? e_typecheck : e_invalidaccess);
+ return_error(!r_has_type(op, t_string) ? gs_error_typecheck : gs_error_invalidaccess);
}
size = r_size(op);
if (size == 0 && ETOP_SOURCE(esp, 0)[1].value.intval == 0)
@@ -450,7 +450,7 @@ image_proc_continue(i_ctx_t *i_ctx_p)
plane_data[px].data = op->value.bytes;
plane_data[px].size = size;
code = gs_image_next_planes(penum, plane_data, used);
- if (code == e_RemapColor) {
+ if (code == gs_error_Remap_Color) {
op->value.bytes += used[px]; /* skip used data */
r_dec_size(op, used[px]);
ETOP_SOURCE(esp, 0)[1].value.intval = 0; /* RemapColor callout */
@@ -542,7 +542,7 @@ image_file_continue(i_ctx_t *i_ctx_p)
NULL, 0, image_file_continue);
default:
/* case ERRC: */
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
break; /* for EOFC */
}
@@ -577,7 +577,7 @@ image_file_continue(i_ctx_t *i_ctx_p)
sbufskip(pp->value.pfile, used[pi]);
total_used += used[pi];
}
- if (code == e_RemapColor)
+ if (code == gs_error_Remap_Color)
return code;
}
if (at_eof_count >= num_sources || (at_eof_count && total_used == 0))
@@ -608,7 +608,7 @@ image_string_continue(i_ctx_t *i_ctx_p)
int px;
int code = gs_image_next_planes(penum, sources, used);
- if (code == e_RemapColor)
+ if (code == gs_error_Remap_Color)
return code;
stop_now:
if (code) { /* Stop now. */
diff --git a/gs/psi/zimage3.c b/gs/psi/zimage3.c
index 9b1af1470..9384ed58f 100644
--- a/gs/psi/zimage3.c
+++ b/gs/psi/zimage3.c
@@ -52,7 +52,7 @@ zimage3(i_ctx_t *i_ctx_p)
if (dict_find_string(op, "DataDict", &pDataDict) <= 0 ||
dict_find_string(op, "MaskDict", &pMaskDict) <= 0
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = pixel_image_params(i_ctx_p, pDataDict,
(gs_pixel_image_t *)&image, &ip_data,
12, false, gs_currentcolorspace(igs))) < 0 ||
@@ -69,7 +69,7 @@ zimage3(i_ctx_t *i_ctx_p)
ip_mask.MultipleDataSources ||
mcode != (image.InterleaveType != 3)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (image.InterleaveType == 3) {
/* Insert the mask DataSource before the data DataSources. */
memmove(&ip_data.DataSource[1], &ip_data.DataSource[0],
@@ -103,7 +103,7 @@ zimage4(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
code = dict_int_array_check_param(imemory, op, "MaskColor",
- num_components * 2, colors, 0, e_rangecheck);
+ num_components * 2, colors, 0, gs_error_rangecheck);
/* Clamp the color values to the unsigned range. */
if (code == num_components) {
image.MaskColor_is_range = false;
@@ -121,7 +121,7 @@ zimage4(i_ctx_t *i_ctx_p)
}
}
} else
- return_error(code < 0 ? code : gs_note_error(e_rangecheck));
+ return_error(code < 0 ? code : gs_note_error(gs_error_rangecheck));
return zimage_setup(i_ctx_p, (gs_pixel_image_t *)&image, &ip.DataSource[0],
image.CombineWithColor, 1);
}
diff --git a/gs/psi/ziodev.c b/gs/psi/ziodev.c
index 9099475af..9947f033e 100644
--- a/gs/psi/ziodev.c
+++ b/gs/psi/ziodev.c
@@ -78,7 +78,7 @@ zgetiodevice(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
iodev = gs_getiodevice(imemory, (int)(op->value.intval));
if (iodev == 0) /* index out of range */
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
dname = (const byte *)iodev->dname;
if (dname == 0)
make_null(op);
@@ -136,13 +136,13 @@ zfilelineedit(i_ctx_t *i_ctx_p)
/* extend string */
initial_buf_size = statement ? STATEMENTEDIT_BUF_SIZE : LINEEDIT_BUF_SIZE;
if (initial_buf_size > max_string_size)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
if (!buf->data || (buf->size < initial_buf_size)) {
count = 0;
buf->data = gs_alloc_string(imemory_system, initial_buf_size,
"zfilelineedit(buffer)");
if (buf->data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
op->value.bytes = buf->data;
op->tas.rsize = buf->size = initial_buf_size;
}
@@ -158,10 +158,10 @@ rd:
byte *nbuf = gs_resize_string(imemory_system, buf->data, buf->size,
max_string_size, "zfilelineedit(shrink buffer)");
if (nbuf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
op->value.bytes = buf->data = nbuf;
op->tas.rsize = buf->size = max_string_size;
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
}
op->value.bytes = buf->data; /* zreadline_from sometimes resizes the buffer. */
@@ -169,12 +169,12 @@ rd:
switch (code) {
case EOFC:
- code = gs_note_error(e_undefinedfilename);
+ code = gs_note_error(gs_error_undefinedfilename);
/* falls through */
case 0:
break;
default:
- code = gs_note_error(e_ioerror);
+ code = gs_note_error(gs_error_ioerror);
break;
case CALLC:
{
@@ -192,7 +192,7 @@ rd:
byte *nbuf;
if (nsize >= max_string_size) {
- code = gs_note_error(e_limitcheck);
+ code = gs_note_error(gs_error_limitcheck);
break;
}
else if (nsize >= max_string_size / 2)
@@ -202,7 +202,7 @@ rd:
nbuf = gs_resize_string(imemory_system, buf->data, buf->size, nsize,
"zfilelineedit(grow buffer)");
if (nbuf == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
break;
}
op->value.bytes = buf->data = nbuf;
@@ -228,13 +228,13 @@ rd:
nsize = buf->size + 1;
if (nsize > max_string_size) {
- return_error(gs_note_error(e_limitcheck));
+ return_error(gs_note_error(gs_error_limitcheck));
}
else {
nbuf = gs_resize_string(imemory_system, buf->data, buf->size, nsize,
"zfilelineedit(grow buffer)");
if (nbuf == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
return_error(code);
}
op->value.bytes = buf->data = nbuf;
@@ -266,13 +266,13 @@ sc:
buf->data = gs_resize_string(imemory_system, buf->data, buf->size, count,
"zfilelineedit(resize buffer)");
if (buf->data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
op->value.bytes = buf->data;
op->tas.rsize = buf->size;
s = file_alloc_stream(imemory_system, "zfilelineedit(stream)");
if (s == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
sread_string(s, buf->data, count);
s->save_close = s->procs.close;
@@ -283,7 +283,7 @@ sc:
code = ssetfilename(s, (const byte *)filename, strlen(filename)+1);
if (code < 0) {
sclose(s);
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
pop(3);
diff --git a/gs/psi/ziodev2.c b/gs/psi/ziodev2.c
index 8ed18fca1..4e5729d98 100644
--- a/gs/psi/ziodev2.c
+++ b/gs/psi/ziodev2.c
@@ -47,7 +47,7 @@ null_open(gx_io_device * iodev, const char *access, stream ** ps,
gs_memory_t * mem)
{
if (!streq1(access, 'w'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
return file_open_stream(gp_null_file_name,
strlen(gp_null_file_name),
access, 256 /* arbitrary */ , ps,
@@ -70,7 +70,7 @@ zgetdevparams(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
iodev = gs_findiodevice(imemory, op->value.bytes, r_size(op));
if (iodev == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
stack_param_list_write(&list, &o_stack, NULL, iimemory);
if ((code = gs_getdevparams(iodev, plist)) < 0) {
ref_stack_pop(&o_stack, list.count * 2);
@@ -95,7 +95,7 @@ zputdevparams(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
iodev = gs_findiodevice(imemory, op->value.bytes, r_size(op));
if (iodev == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = stack_param_list_read(&list, &o_stack, 1, NULL, false, iimemory);
if (code < 0)
return code;
@@ -106,7 +106,7 @@ zputdevparams(i_ctx_t *i_ctx_p)
code = param_check_password(plist, &system_params_password);
if (code != 0) {
iparam_list_release(&list);
- return_error(code < 0 ? code : e_invalidaccess);
+ return_error(code < 0 ? code : gs_error_invalidaccess);
}
code = gs_putdevparams(iodev, plist);
iparam_list_release(&list);
diff --git a/gs/psi/ziodevs.c b/gs/psi/ziodevs.c
index f16ac8254..980f3d2fb 100644
--- a/gs/psi/ziodevs.c
+++ b/gs/psi/ziodevs.c
@@ -108,7 +108,7 @@ stdin_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'r'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stdin)) {
/****** stdin SHOULD NOT LINE-BUFFER ******/
gs_memory_t *mem = imemory_system;
@@ -121,7 +121,7 @@ stdin_open(gx_io_device * iodev, const char *access, stream ** ps,
/* to make progress. */
buf = gs_alloc_bytes(mem, STDIN_BUF_SIZE, "stdin_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
sread_file(s, gs_stdin, buf, STDIN_BUF_SIZE);
s->procs.process = s_stdin_read_process;
s->save_close = s_std_null;
@@ -187,7 +187,7 @@ stdout_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'w'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stdout)) {
gs_memory_t *mem = imemory_system;
byte *buf;
@@ -195,7 +195,7 @@ stdout_open(gx_io_device * iodev, const char *access, stream ** ps,
s = file_alloc_stream(mem, "stdout_open(stream)");
buf = gs_alloc_bytes(mem, STDOUT_BUF_SIZE, "stdout_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
swrite_file(s, gs_stdout, buf, STDOUT_BUF_SIZE);
s->save_close = s->procs.flush;
s->procs.close = file_close_file;
@@ -234,7 +234,7 @@ stderr_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'w'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stderr)) {
gs_memory_t *mem = imemory_system;
byte *buf;
@@ -242,7 +242,7 @@ stderr_open(gx_io_device * iodev, const char *access, stream ** ps,
s = file_alloc_stream(mem, "stderr_open(stream)");
buf = gs_alloc_bytes(mem, STDERR_BUF_SIZE, "stderr_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
swrite_file(s, gs_stderr, buf, STDERR_BUF_SIZE);
s->save_close = s->procs.flush;
s->procs.close = file_close_file;
diff --git a/gs/psi/ziodevsc.c b/gs/psi/ziodevsc.c
index 210587de8..835848f29 100644
--- a/gs/psi/ziodevsc.c
+++ b/gs/psi/ziodevsc.c
@@ -119,7 +119,7 @@ stdin_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'r'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stdin)) {
/****** stdin SHOULD NOT LINE-BUFFER ******/
gs_memory_t *sysmem = imemory_system;
@@ -137,7 +137,7 @@ stdin_open(gx_io_device * iodev, const char *access, stream ** ps,
/* to make progress. */
buf = gs_alloc_bytes(sysmem, STDIN_BUF_SIZE, "stdin_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
s_std_init(s, buf, STDIN_BUF_SIZE, &p, s_mode_read);
s->file = 0;
@@ -203,7 +203,7 @@ stdout_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'w'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stdout)) {
gs_memory_t *sysmem = imemory_system;
byte *buf;
@@ -215,7 +215,7 @@ stdout_open(gx_io_device * iodev, const char *access, stream ** ps,
s = file_alloc_stream(sysmem, "stdout_open(stream)");
buf = gs_alloc_bytes(sysmem, STDOUT_BUF_SIZE, "stdout_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
s_std_init(s, buf, STDOUT_BUF_SIZE, &p, s_mode_write);
s->file = 0;
s->file_modes = s->modes;
@@ -274,7 +274,7 @@ stderr_open(gx_io_device * iodev, const char *access, stream ** ps,
stream *s;
if (!streq1(access, 'w'))
- return_error(e_invalidfileaccess);
+ return_error(gs_error_invalidfileaccess);
if (file_is_invalid(s, &ref_stderr)) {
gs_memory_t *sysmem = imemory_system;
byte *buf;
@@ -286,7 +286,7 @@ stderr_open(gx_io_device * iodev, const char *access, stream ** ps,
s = file_alloc_stream(sysmem, "stderr_open(stream)");
buf = gs_alloc_bytes(sysmem, STDERR_BUF_SIZE, "stderr_open(buffer)");
if (s == 0 || buf == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
s_std_init(s, buf, STDERR_BUF_SIZE, &p, s_mode_write);
s->file = 0;
s->file_modes = s->modes;
diff --git a/gs/psi/zmath.c b/gs/psi/zmath.c
index a3b5d7cd0..05d33b4ca 100644
--- a/gs/psi/zmath.c
+++ b/gs/psi/zmath.c
@@ -55,7 +55,7 @@ zsqrt(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (num < 0.0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_real(op, sqrt(num));
return 0;
}
@@ -150,7 +150,7 @@ zexp(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (args[0] < 0.0 && modf(args[1], &ipart) != 0.0)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
if (args[0] == 0.0 && args[1] == 0.0)
result = 1.0; /* match Adobe; can't rely on C library */
else
@@ -171,7 +171,7 @@ zln(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (num <= 0.0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_real(op, log(num));
return 0;
}
@@ -187,7 +187,7 @@ zlog(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (num <= 0.0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_real(op, log10(num));
return 0;
}
diff --git a/gs/psi/zmatrix.c b/gs/psi/zmatrix.c
index 75fdb26d6..bb0a628aa 100644
--- a/gs/psi/zmatrix.c
+++ b/gs/psi/zmatrix.c
@@ -356,7 +356,7 @@ zbbox_transform(i_ctx_t *i_ctx_p)
return_op_typecheck(op - 1);
check_read(op[-1]);
if (r_size(op - 1) != 4)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = process_float_array(imemory, op - 1, 4, bbox) < 0))
return code;
diff --git a/gs/psi/zmedia2.c b/gs/psi/zmedia2.c
index 3f5df8397..9192f6b9e 100644
--- a/gs/psi/zmedia2.c
+++ b/gs/psi/zmedia2.c
@@ -301,7 +301,7 @@ zmatch_page_size(const gs_memory_t *mem, const ref * pvreq, const ref * pvmed,
return_error(code);
nm = r_size(pvmed);
if (!((nm == 2 || nm == 4) && (nr == 2 || nr == nm)))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
{
uint i;
double v[6];
@@ -349,7 +349,7 @@ match_page_size(const gs_point * request, const gs_rect * medium, int policy,
double rx = request->x, ry = request->y;
if ((rx <= 0) || (ry <= 0))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (policy == 7) {
/* (Adobe) hack: just impose requested values */
*best_mismatch = 0;
diff --git a/gs/psi/zmisc.c b/gs/psi/zmisc.c
index bbdf1c735..acd566b5d 100644
--- a/gs/psi/zmisc.c
+++ b/gs/psi/zmisc.c
@@ -218,7 +218,7 @@ zgetenv(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
str = ref_to_string(op, imemory, "getenv key");
if (str == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
if (gp_getenv(str, (char *)0, &len) > 0) { /* key missing */
ifree_string((byte *) str, r_size(op) + 1, "getenv key");
make_false(op);
@@ -227,7 +227,7 @@ zgetenv(i_ctx_t *i_ctx_p)
value = ialloc_string(len, "getenv value");
if (value == 0) {
ifree_string((byte *) str, r_size(op) + 1, "getenv key");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
DISCARD(gp_getenv(str, (char *)value, &len)); /* can't fail */
ifree_string((byte *) str, r_size(op) + 1, "getenv key");
@@ -258,7 +258,7 @@ zdefaultpapersize(i_ctx_t *i_ctx_p)
value = ialloc_string(len, "defaultpapersize value");
if (value == 0) {
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
DISCARD(gp_defaultpapersize((char *)value, &len)); /* can't fail */
/* Delete the stupid C string terminator. */
@@ -289,7 +289,7 @@ zmakeoperator(i_ctx_t *i_ctx_p)
opt = &i_ctx_p->op_array_table_local;
break;
default:
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
count = opt->count;
tab = opt->table.value.refs;
@@ -304,7 +304,7 @@ zmakeoperator(i_ctx_t *i_ctx_p)
while (count > 0 && r_has_type(&tab[count - 1], t_null))
--count;
if (count == r_size(&opt->table))
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
ref_assign_old(&opt->table, &tab[count], op, "makeoperator");
opt->nx_table[count] = name_index(imemory, op - 1);
op_index_ref(imemory, opt->base_index + count, op - 1);
@@ -490,7 +490,7 @@ zpcachequery(i_ctx_t *i_ctx_p)
return 0;
}
if (string == NULL)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_string(op, a_all | icurrent_space, len, string);
push(1);
diff --git a/gs/psi/zmisc1.c b/gs/psi/zmisc1.c
index 05c9fd8af..35379150c 100644
--- a/gs/psi/zmisc1.c
+++ b/gs/psi/zmisc1.c
@@ -51,12 +51,12 @@ type1crypt(i_ctx_t *i_ctx_p,
check_type(op[-2], t_integer);
state = op[-2].value.intval;
if (op[-2].value.intval != state)
- return_error(e_rangecheck); /* state value was truncated */
+ return_error(gs_error_rangecheck); /* state value was truncated */
check_read_type(op[-1], t_string);
check_write_type(*op, t_string);
ssize = r_size(op - 1);
if (r_size(op) < ssize)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
discard((*proc)(op->value.bytes, op[-1].value.const_bytes, ssize,
&state)); /* can't fail */
op[-2].value.intval = state;
@@ -78,7 +78,7 @@ eexec_param(os_ptr op, ushort * pcstate)
check_type(*op, t_integer);
*pcstate = op->value.intval;
if (op->value.intval != *pcstate)
- return_error(e_rangecheck); /* state value was truncated */
+ return_error(gs_error_rangecheck); /* state value was truncated */
return npop;
}
diff --git a/gs/psi/zmisc2.c b/gs/psi/zmisc2.c
index 14bc54781..3560cc602 100644
--- a/gs/psi/zmisc2.c
+++ b/gs/psi/zmisc2.c
@@ -97,9 +97,9 @@ set_language_level(i_ctx_t *i_ctx_p, int new_level)
new_level >
(dict_find_string(systemdict, "ll3dict", &level2dict) > 0 ? 3 : 2)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (dict_find_string(systemdict, "level2dict", &level2dict) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
/*
* As noted in dstack.h, we allocate the extra d-stack entry for
* globaldict even in Level 1 mode; in Level 1 mode, this entry
@@ -120,7 +120,7 @@ set_language_level(i_ctx_t *i_ctx_p, int new_level)
code = dict_find_string(level2dict, "globaldict", &pdict);
if (code > 0) {
if (!r_has_type(pdict, t_dictionary))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
*pgdict = *pdict;
}
/* Set other flags for Level 2 operation. */
@@ -164,7 +164,7 @@ set_language_level(i_ctx_t *i_ctx_p, int new_level)
code = swap_level_dict(i_ctx_p, "ll3dict");
break;
default: /* not possible */
- return_error(e_Fatal);
+ return_error(gs_error_Fatal);
}
break;
}
@@ -193,7 +193,7 @@ swap_level_dict(i_ctx_t *i_ctx_p, const char *dict_name)
* move if their containing dictionary is resized.
*/
if (dict_find_string(systemdict, dict_name, &pleveldict) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
rleveldict = *pleveldict;
index = dict_first(&rleveldict);
while ((index = dict_next(&rleveldict, index, &elt[0])) >= 0)
@@ -270,7 +270,7 @@ swap_entry(i_ctx_t *i_ctx_p, ref elt[2], ref * pdict, ref * pdict2)
idict_put(pdict2, &elt[0], &old_value);
if (r_has_type(&elt[1], t_null)) {
code = idict_undef(pdict, &elt[0]);
- if (code == e_undefined &&
+ if (code == gs_error_undefined &&
r_has_type(&old_value, t_null)
)
code = 0;
diff --git a/gs/psi/zpacked.c b/gs/psi/zpacked.c
index ff4ce9f58..d37954c86 100644
--- a/gs/psi/zpacked.c
+++ b/gs/psi/zpacked.c
@@ -48,11 +48,11 @@ zpackedarray(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (op->value.intval > op - osbot &&
op->value.intval >= ref_stack_count(&o_stack)
)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
osp--;
code = make_packed_array(&parr, &o_stack, (uint) op->value.intval,
idmemory, "packedarray");
diff --git a/gs/psi/zpaint.c b/gs/psi/zpaint.c
index 9184953b0..6a8065522 100644
--- a/gs/psi/zpaint.c
+++ b/gs/psi/zpaint.c
@@ -61,7 +61,7 @@ zimagepath(i_ctx_t *i_ctx_p)
check_type(op[-1], t_integer);
check_read_type(*op, t_string);
if (r_size(op) < ((op[-2].value.intval + 7) >> 3) * op[-1].value.intval)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = gs_imagepath(igs,
(int)op[-2].value.intval, (int)op[-1].value.intval,
op->value.const_bytes);
diff --git a/gs/psi/zpath1.c b/gs/psi/zpath1.c
index 9f039a95e..e4f8863fb 100644
--- a/gs/psi/zpath1.c
+++ b/gs/psi/zpath1.c
@@ -197,7 +197,7 @@ zpathforall(i_ctx_t *i_ctx_p)
check_estack(8);
if ((penum = gs_path_enum_alloc(imemory, "pathforall")) == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = gs_path_enum_init(imemory, penum, igs);
if (code < 0) {
ifree_object(penum, "path_cleanup");
diff --git a/gs/psi/zpcolor.c b/gs/psi/zpcolor.c
index 9d8f3645e..c843cccb1 100644
--- a/gs/psi/zpcolor.c
+++ b/gs/psi/zpcolor.c
@@ -75,7 +75,7 @@ int_pattern_alloc(int_pattern **ppdata, const ref *op, gs_memory_t *mem)
gs_alloc_struct(mem, int_pattern, &st_int_pattern, "int_pattern");
if (pdata == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
pdata->dict = *op;
*ppdata = pdata;
return 0;
@@ -106,7 +106,7 @@ zbuildpattern1(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code != 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = dict_int_param(op1, "PaintType", 1, 2, 0, &templat.PaintType);
if (code < 0)
@@ -124,32 +124,32 @@ zbuildpattern1(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_float_param(op1, "XStep", 0.0, &templat.XStep);
if (code < 0)
return code;
if (code == 1)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_float_param(op1, "YStep", 0.0, &templat.YStep);
if (code < 0)
return code;
if (code == 1)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
code = dict_find_string(op1, "PaintProc", &pPaintProc);
if (code < 0)
return code;
if (code == 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
check_proc(*pPaintProc);
if (mat.xx * mat.yy == mat.xy * mat.yx)
- return_error(e_undefinedresult);
+ return_error(gs_error_undefinedresult);
if (BBox[0] >= BBox[2] || BBox[1] >= BBox[3])
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
templat.BBox.p.x = BBox[0];
templat.BBox.p.y = BBox[1];
@@ -191,7 +191,7 @@ zPaintProc(const gs_client_color * pcc, gs_state * pgs)
r_ptr(&gs_int_gstate(pgs)->remap_color_info,
int_remap_color_info_t)->proc =
pattern_paint_prepare;
- return_error(e_RemapColor);
+ return_error(gs_error_Remap_Color);
}
/* Prepare to run the PaintProc. */
static int
@@ -220,7 +220,7 @@ pattern_paint_prepare(i_ctx_t *i_ctx_p)
pdev = gx_pattern_accum_alloc(imemory, storage_memory, pinst, "pattern_paint_prepare");
if (pdev == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = (*dev_proc(pdev, open_device)) ((gx_device *) pdev);
if (code < 0) {
ifree_object(pdev, "pattern_paint_prepare");
diff --git a/gs/psi/zpdf_r6.c b/gs/psi/zpdf_r6.c
index 359248fdf..5f209c712 100644
--- a/gs/psi/zpdf_r6.c
+++ b/gs/psi/zpdf_r6.c
@@ -140,25 +140,25 @@ zcheck_r6_password(i_ctx_t * i_ctx_p)
CryptDict = op--;
Pref = op;
if (!r_has_type(CryptDict, t_dictionary))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (!r_has_type(Pref, t_string))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
code = dict_find_string(CryptDict, "O", &Oref);
if (code < 0 || !r_has_type(Oref, t_string)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = dict_find_string(CryptDict, "OE", &OEref);
if (code < 0 || !r_has_type(OEref, t_string)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = dict_find_string(CryptDict, "U", &Uref);
if (code < 0 || !r_has_type(Uref, t_string)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = dict_find_string(CryptDict, "UE", &UEref);
if (code < 0 || !r_has_type(UEref, t_string)) {
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
pop(2);
@@ -185,7 +185,7 @@ zcheck_r6_password(i_ctx_t * i_ctx_p)
body = ialloc_string(32, "r6 encryption key");
if (body == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
push(1);
memcpy(body, output, 32);
make_string(&stref, a_all | icurrent_space, 32, body);
diff --git a/gs/psi/zpdfops.c b/gs/psi/zpdfops.c
index e055c6772..59a4ea3fb 100644
--- a/gs/psi/zpdfops.c
+++ b/gs/psi/zpdfops.c
@@ -51,9 +51,9 @@ zpdfinkpath(i_ctx_t *i_ctx_p)
const double smooth_value = 1; /* from 0..1 range */
if (count == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
if ((count & 1) == 0 || count < 3)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ocount = count - 1;
optr = op - ocount + 1;
@@ -156,7 +156,7 @@ zsaslprep(i_ctx_t *i_ctx_p)
buffer_size = input_size * 11 + 1;
buffer = ialloc_string(buffer_size, "saslprep result");
if (buffer == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
memcpy(buffer, op->value.bytes, input_size);
buffer[input_size] = '\0';
@@ -181,7 +181,7 @@ zsaslprep(i_ctx_t *i_ctx_p)
if ((int)err < 100)
return 0;
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
output_size = strlen((char *)buffer);
diff --git a/gs/psi/zshade.c b/gs/psi/zshade.c
index e0b38c7b8..b9088c271 100644
--- a/gs/psi/zshade.c
+++ b/gs/psi/zshade.c
@@ -105,7 +105,7 @@ zbuildshadingpattern(i_ctx_t *i_ctx_p)
(code = shading_param(op, &templat.Shading)) < 0 ||
(code = int_pattern_alloc(&pdata, op2, imemory)) < 0
)
- return_error((code < 0 ? code : e_rangecheck));
+ return_error((code < 0 ? code : gs_error_rangecheck));
templat.client_data = pdata;
code = gs_make_pattern(&cc_instance,
(const gs_pattern_template_t *)&templat,
@@ -131,7 +131,7 @@ shading_param(const_os_ptr op, const gs_shading_t ** ppsh)
if (!r_is_struct(op) ||
r_has_masked_attrs(op, a_executable | a_execute, a_all)
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
*ppsh = (gs_shading_t *) op->value.pstruct;
return 0;
}
@@ -170,7 +170,7 @@ build_shading(i_ctx_t *i_ctx_p, build_shading_proc_t proc)
if (num_comp < 0) { /* Pattern color space */
gs_errorinfo_put_pair_from_dict(i_ctx_p, op, "ColorSpace");
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
params.ColorSpace = pcs;
rc_increment_cs(pcs);
@@ -180,7 +180,7 @@ build_shading(i_ctx_t *i_ctx_p, build_shading_proc_t proc)
"build_shading");
if (pcc == 0) {
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
goto fail;
}
pcc->pattern = 0;
@@ -239,7 +239,7 @@ fail:
if (params.ColorSpace) {
rc_decrement_only_cs(params.ColorSpace, "build_shading");
}
- return (code < 0 ? code : gs_note_error(e_rangecheck));
+ return (code < 0 ? code : gs_note_error(gs_error_rangecheck));
}
/* Collect a Function value. */
@@ -261,7 +261,7 @@ build_shading_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
check_read(*pFunction);
if (size == 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = alloc_function_array(size, &Functions, mem);
if (code < 0)
return code;
@@ -290,7 +290,7 @@ build_shading_function(i_ctx_t *i_ctx_p, const ref * op, gs_function_t ** ppfn,
return code;
if ((*ppfn)->params.m != num_inputs) {
gs_function_free(*ppfn, true, mem);
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
}
return code;
@@ -309,7 +309,7 @@ check_indexed_vs_function(i_ctx_t *i_ctx_p, const ref *op,
ref *f;
if (dict_find_string(op, fn, &f) > 0)
gs_errorinfo_put_pair(i_ctx_p, fn, sizeof(fn) - 1, f);
- return_error(e_typecheck); /* CET 12-14a */
+ return_error(gs_error_typecheck); /* CET 12-14a */
}
return 0;
}
@@ -335,7 +335,7 @@ build_shading_1(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pc
goto out;
if (params.Domain[0] > params.Domain[1] || params.Domain[2] > params.Domain[3]) {
gs_errorinfo_put_pair_from_dict(i_ctx_p, op, "Domain");
- code = gs_note_error(e_rangecheck);
+ code = gs_note_error(gs_error_rangecheck);
goto out; /* CPSI 3017 and CET 12-14b reject un-normalised domain */
}
if (dict_find_string(op, "Matrix", &pmatrix) > 0 ) {
@@ -349,7 +349,7 @@ build_shading_1(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pc
if (code < 0)
goto out;
if (params.Function == 0) { /* Function is required */
- code = gs_note_error(e_undefined);
+ code = gs_note_error(gs_error_undefined);
gs_errorinfo_put_pair_from_dict(i_ctx_p, op, "Function");
goto out;
}
@@ -388,22 +388,22 @@ build_directional_shading(i_ctx_t *i_ctx_p, const ref * op, float *Coords, int n
)
return code;
if (!*pFunction)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
if (dict_find_string(op, "Extend", &pExtend) <= 0)
Extend[0] = Extend[1] = false;
else {
ref E0, E1;
if (!r_is_array(pExtend))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
else if (r_size(pExtend) != 2)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
else if ((array_get(imemory, pExtend, 0L, &E0),
!r_has_type(&E0, t_boolean)) ||
(array_get(imemory, pExtend, 1L, &E1),
!r_has_type(&E1, t_boolean))
)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
Extend[0] = E0.value.boolval, Extend[1] = E1.value.boolval;
}
return 0;
@@ -453,7 +453,7 @@ build_shading_3(i_ctx_t *i_ctx_p, const ref * op, const gs_shading_params_t * pc
gs_free_object(mem, params.Function, "Function");
}
if (params.Function == 0) /* Function is required */
- return_error(e_undefined);
+ return_error(gs_error_undefined);
return code;
}
/* <dict> .buildshading3 <shading_struct> */
@@ -477,14 +477,14 @@ build_mesh_shading(i_ctx_t *i_ctx_p, const ref * op,
*pDecode = 0;
*pFunction = 0;
if (dict_find_string(op, "DataSource", &pDataSource) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (r_is_array(pDataSource)) {
uint size = r_size(pDataSource);
data = (float *)gs_alloc_byte_array(mem, size, sizeof(float),
"build_mesh_shading");
if (data == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
code = process_float_array(mem, pDataSource, size, data);
if (code < 0) {
gs_free_object(mem, data, "build_mesh_shading");
@@ -507,7 +507,7 @@ build_mesh_shading(i_ctx_t *i_ctx_p, const ref * op,
r_size(pDataSource));
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
code = build_shading_function(i_ctx_p, op, pFunction, 1, mem, NULL);
if (code < 0) {
@@ -531,7 +531,7 @@ build_mesh_shading(i_ctx_t *i_ctx_p, const ref * op,
gs_alloc_byte_array(mem, num_decode, sizeof(float),
"build_mesh_shading");
if (*pDecode == 0)
- code = gs_note_error(e_VMerror);
+ code = gs_note_error(gs_error_VMerror);
else {
code = dict_floats_param(mem, op, "Decode", num_decode, *pDecode, NULL);
if (code < 0) {
diff --git a/gs/psi/zstack.c b/gs/psi/zstack.c
index 61d7bf083..3031cc42f 100644
--- a/gs/psi/zstack.c
+++ b/gs/psi/zstack.c
@@ -72,10 +72,10 @@ zindex(i_ctx_t *i_ctx_p)
ref *elt;
if (op->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
elt = ref_stack_index(&o_stack, op->value.intval + 1);
if (elt == 0)
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
ref_assign(op, elt);
return 0;
}
@@ -96,8 +96,8 @@ zargindex(i_ctx_t *i_ctx_p)
* result will be a stackunderflow rather than a rangecheck. (This is,
* in fact, the only reason this operator exists.)
*/
- if (code == e_rangecheck && osp->value.intval >= 0)
- code = gs_note_error(e_stackunderflow);
+ if (code == gs_error_rangecheck && osp->value.intval >= 0)
+ code = gs_note_error(gs_error_stackunderflow);
return code;
}
@@ -124,9 +124,9 @@ zroll(i_ctx_t *i_ctx_p)
int left, i;
if (op1->value.intval < 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (op1->value.intval + 2 > (int)ref_stack_count(&o_stack))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
count = op1->value.intval;
if (count <= 1) {
pop(2);
@@ -214,7 +214,7 @@ zroll(i_ctx_t *i_ctx_p)
/* Move everything up, then top elements down. */
if (mod >= ostop - op) {
o_stack.requested = mod;
- return_error(e_stackoverflow);
+ return_error(gs_error_stackoverflow);
}
pop(2);
op -= 2;
@@ -226,7 +226,7 @@ zroll(i_ctx_t *i_ctx_p)
mod = count - mod;
if (mod >= ostop - op) {
o_stack.requested = mod;
- return_error(e_stackoverflow);
+ return_error(gs_error_stackoverflow);
}
pop(2);
op -= 2;
@@ -277,7 +277,7 @@ zcleartomark(i_ctx_t *i_ctx_p)
uint count = ref_stack_counttomark(&o_stack);
if (count == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
ref_stack_pop(&o_stack, count);
return 0;
}
@@ -291,7 +291,7 @@ zcounttomark(i_ctx_t *i_ctx_p)
uint count = ref_stack_counttomark(&o_stack);
if (count == 0)
- return_error(e_unmatchedmark);
+ return_error(gs_error_unmatchedmark);
push(1);
make_int(op, count - 1);
return 0;
diff --git a/gs/psi/zstring.c b/gs/psi/zstring.c
index 34f527103..df9593907 100644
--- a/gs/psi/zstring.c
+++ b/gs/psi/zstring.c
@@ -39,7 +39,7 @@ zbytestring(i_ctx_t *i_ctx_p)
size = (uint)op->value.intval;
sbody = ialloc_bytes(size, ".bytestring");
if (sbody == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_astruct(op, a_all | icurrent_space, sbody);
memset(sbody, 0, size);
return 0;
@@ -55,13 +55,13 @@ zstring(i_ctx_t *i_ctx_p)
check_type(*op, t_integer);
if (op->value.intval < 0 )
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (op->value.intval > max_string_size )
- return_error(e_limitcheck); /* to match Distiller */
+ return_error(gs_error_limitcheck); /* to match Distiller */
size = op->value.intval;
sbody = ialloc_string(size, "string");
if (sbody == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
make_string(op, a_all | icurrent_space, size, sbody);
memset(sbody, 0, size);
return 0;
diff --git a/gs/psi/ztoken.c b/gs/psi/ztoken.c
index 05099658f..4dba7c5bd 100644
--- a/gs/psi/ztoken.c
+++ b/gs/psi/ztoken.c
@@ -63,7 +63,7 @@ ztoken(i_ctx_t *i_ctx_p)
/* Don't pop the operand in case of invalidaccess. */
if (!r_has_attr(op, a_read))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
code = gs_scan_string_token(i_ctx_p, op, &token);
switch (code) {
case scan_EOF: /* no tokens */
@@ -115,7 +115,7 @@ again:
switch (code) {
default: /* error */
if (code > 0) /* comment, not possible */
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
gs_scanner_error_object(i_ctx_p, pstate, &i_ctx_p->error_object);
break;
case scan_BOS:
@@ -255,7 +255,7 @@ ztoken_handle_comment(i_ctx_t *i_ctx_p, scanner_state *sstate,
proc_name = "%ProcessDSCComment";
break;
default:
- return_error(e_Fatal); /* can't happen */
+ return_error(gs_error_Fatal); /* can't happen */
}
/*
* We can't use check_ostack here, because it returns on overflow.
@@ -274,7 +274,7 @@ ztoken_handle_comment(i_ctx_t *i_ctx_p, scanner_state *sstate,
pstate = (scanner_state *)ialloc_struct(scanner_state_dynamic, &st_scanner_state_dynamic,
"ztoken_handle_comment");
if (pstate == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
((scanner_state_dynamic *)pstate)->mem = imemory;
*pstate = *sstate;
} else
diff --git a/gs/psi/ztrans.c b/gs/psi/ztrans.c
index 89ed98524..1133cc076 100644
--- a/gs/psi/ztrans.c
+++ b/gs/psi/ztrans.c
@@ -79,7 +79,7 @@ enum_param(const gs_memory_t *mem, const ref *pnref,
!memcmp(*p, nsref.value.const_bytes, r_size(&nsref))
)
return p - names;
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* ------ Graphics state operators ------ */
@@ -276,7 +276,7 @@ zbegintransparencymaskgroup(i_ctx_t *i_ctx_p)
check_type(*dop, t_dictionary);
check_dict_read(*dop);
if (dict_find_string(dop, "Subtype", &pparam) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = enum_param(imemory, pparam, subtype_names)) < 0)
return code;
gs_trans_mask_params_init(&params, code);
@@ -294,7 +294,7 @@ zbegintransparencymaskgroup(i_ctx_t *i_ctx_p)
gs_function_t *pfn = ref_function(pparam);
if (pfn == 0 || pfn->params.m != 1 || pfn->params.n != 1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
params.TransferFunction = tf_using_function;
params.TransferFunction_data = pfn;
}
@@ -335,7 +335,7 @@ zbegintransparencymaskimage(i_ctx_t *i_ctx_p)
gs_color_space *gray_cs = gs_cspace_new_DeviceGray(imemory);
if (!gray_cs)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
gs_trans_mask_params_init(&params, TRANSPARENCY_MASK_Luminosity);
code = gs_begin_transparency_mask(igs, &params, &bbox, true);
if (code < 0)
@@ -384,7 +384,7 @@ zimage3x(i_ctx_t *i_ctx_p)
memset(&image, 0, sizeof(gs_image3x_t));
gs_image3x_t_init(&image, NULL);
if (dict_find_string(op, "DataDict", &pDataDict) <= 0)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if ((code = pixel_image_params(i_ctx_p, pDataDict,
(gs_pixel_image_t *)&image, &ip_data,
16, false, gs_currentcolorspace(igs))) < 0 ||
@@ -438,7 +438,7 @@ image_params *pip_data, const char *dict_name,
ip_mask.MultipleDataSources ||
mcode != (pixm->InterleaveType != 3)
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
if (pixm->InterleaveType == 3) {
/* Insert the mask DataSource before the data DataSources. */
memmove(&pip_data->DataSource[1], &pip_data->DataSource[0],
diff --git a/gs/psi/ztrap.c b/gs/psi/ztrap.c
index 20e5c347b..314b74d71 100644
--- a/gs/psi/ztrap.c
+++ b/gs/psi/ztrap.c
@@ -50,7 +50,7 @@ static int
zsettrapzone(i_ctx_t *i_ctx_p)
{
/****** NYI ******/
- return_error(e_undefined);
+ return_error(gs_error_undefined);
}
/* ------ Initialization procedure ------ */
diff --git a/gs/psi/ztype.c b/gs/psi/ztype.c
index 97b9f4d67..6a646322d 100644
--- a/gs/psi/ztype.c
+++ b/gs/psi/ztype.c
@@ -149,7 +149,7 @@ zcvx(i_ctx_t *i_ctx_p)
((opidx = op_index(op)) == 0 ||
op_def_is_internal(op_index_def(opidx)))
)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
aop = ACCESS_REF(op);
r_set_attrs(aop, a_executable);
return 0;
@@ -174,7 +174,7 @@ zexecuteonly(i_ctx_t *i_ctx_p)
check_op(1);
if (r_has_type(op, t_dictionary))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
return access_check(i_ctx_p, a_execute, true);
}
@@ -194,12 +194,12 @@ znoaccess(i_ctx_t *i_ctx_p)
/* Already noaccess - do nothing (CET 24-09-1). */
return 0;
}
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
/* Don't allow removing read access to permanent dictionaries. */
if (dict_is_permanent_on_dstack(op))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
}
return access_check(i_ctx_p, 0, true);
}
@@ -259,7 +259,7 @@ zcvi(i_ctx_t *i_ctx_p)
ref_assign(&str, op);
code = gs_scan_string_token(i_ctx_p, &str, &token);
if (code > 0) /* anything other than a plain token */
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
if (code < 0)
return code;
switch (r_type(&token)) {
@@ -270,12 +270,12 @@ zcvi(i_ctx_t *i_ctx_p)
fval = token.value.realval;
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
}
if (!REAL_CAN_BE_INT(fval))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
make_int(op, (long)fval); /* truncates towards 0 */
return 0;
}
@@ -312,7 +312,7 @@ zcvr(i_ctx_t *i_ctx_p)
ref_assign(&str, op);
code = gs_scan_string_token(i_ctx_p, &str, &token);
if (code > 0) /* anything other than a plain token */
- code = gs_note_error(e_syntaxerror);
+ code = gs_note_error(gs_error_syntaxerror);
if (code < 0)
return code;
switch (r_type(&token)) {
@@ -323,7 +323,7 @@ zcvr(i_ctx_t *i_ctx_p)
*op = token;
return 0;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
}
@@ -338,7 +338,7 @@ zcvrs(i_ctx_t *i_ctx_p)
check_type(op[-1], t_integer);
if (op[-1].value.intval < 2 || op[-1].value.intval > 36)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
radix = op[-1].value.intval;
check_write_type(*op, t_string);
if (radix == 10) {
@@ -354,9 +354,9 @@ zcvrs(i_ctx_t *i_ctx_p)
return 0;
}
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_rangecheck); /* CET 24-05 wants rangecheck */
+ return_error(gs_error_rangecheck); /* CET 24-05 wants rangecheck */
}
} else {
uint ival;
@@ -373,13 +373,13 @@ zcvrs(i_ctx_t *i_ctx_p)
float fval = op[-2].value.realval;
if (!REAL_CAN_BE_INT(fval))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
ival = (ulong) (long)fval;
} break;
case t__invalid:
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
default:
- return_error(e_rangecheck); /* CET 24-05 wants rangecheck */
+ return_error(gs_error_rangecheck); /* CET 24-05 wants rangecheck */
}
do {
int dit = ival % radix;
@@ -389,7 +389,7 @@ zcvrs(i_ctx_t *i_ctx_p)
}
while (ival);
if (endp - dp > r_size(op))
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
memcpy(op->value.bytes, dp, (uint) (endp - dp));
r_set_size(op, endp - dp);
}
@@ -456,7 +456,7 @@ access_check(i_ctx_t *i_ctx_p,
aop = dict_access_ref(op);
if (modify) {
if (!r_has_attrs(aop, access))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
ref_save(op, aop, "access_check(modify)");
r_clear_attrs(aop, a_all);
r_set_attrs(aop, access);
@@ -473,7 +473,7 @@ access_check(i_ctx_t *i_ctx_p,
case t_device:;
if (modify) {
if (!r_has_attrs(op, access))
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
r_clear_attrs(op, a_all);
r_set_attrs(op, access);
return 0;
@@ -505,7 +505,7 @@ convert_to_string(const gs_memory_t *mem, os_ptr op1, os_ptr op)
* the object is an operator whose name begins with
* %, ., or @, we just truncate the name.
*/
- if (code == e_rangecheck)
+ if (code == gs_error_rangecheck)
switch (r_btype(op1)) {
case t_oparray:
case t_operator:
diff --git a/gs/psi/zupath.c b/gs/psi/zupath.c
index 32ce9a8ea..7f4ec2a89 100644
--- a/gs/psi/zupath.c
+++ b/gs/psi/zupath.c
@@ -174,7 +174,7 @@ in_path(os_ptr oppath, i_ctx_t *i_ctx_p, gx_device * phdev)
fr.q.y = fr.p.y + fixed_1;
code = gx_clip_to_rectangle(igs, &fr);
npop = 2;
- } else if (code == e_stackunderflow) {
+ } else if (code == gs_error_stackunderflow) {
/* If 0 elements, definitely a stackunderflow; otherwise, */
/* only 1 number, also a stackunderflow. */
npop = code;
@@ -483,7 +483,7 @@ path_length_for_upath(const gx_path *ppath)
size += 1;
continue;
default:
- return_error(e_unregistered);
+ return_error(gs_error_unregistered);
}
}
return size;
@@ -508,7 +508,7 @@ make_upath(i_ctx_t *i_ctx_p, ref *rupath, gs_state *pgs, gx_path *ppath,
* not in CPSI compatibility mode, we set a reasonable default
* bbox instead.
*/
- if (code != e_nocurrentpoint || gs_currentcpsimode(imemory))
+ if (code != gs_error_nocurrentpoint || gs_currentcpsimode(imemory))
return code;
bbox.p.x = bbox.p.y = bbox.q.x = bbox.q.y = 0;
}
@@ -518,7 +518,7 @@ make_upath(i_ctx_t *i_ctx_p, ref *rupath, gs_state *pgs, gx_path *ppath,
return code;
size += code;
if (size >= 65536)
- return_error(e_limitcheck);
+ return_error(gs_error_limitcheck);
code = ialloc_ref_array(rupath, a_all | a_executable, size,
"make_upath");
@@ -577,7 +577,7 @@ make_upath(i_ctx_t *i_ctx_p, ref *rupath, gs_state *pgs, gx_path *ppath,
opstr = "closepath";
break;
default:
- return_error(e_unregistered);
+ return_error(gs_error_unregistered);
}
if ((code = name_enter_string(pgs->memory, opstr, next)) < 0)
return code;
@@ -610,7 +610,7 @@ zgetpath(i_ctx_t *i_ctx_p)
dict_find_string(systemdict, "lineto", &operators[2]) <= 0 ||
dict_find_string(systemdict, "curveto", &operators[3]) <= 0 ||
dict_find_string(systemdict, "closepath", &operators[4]) <= 0)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
main_ref = op->value.refs;
for (i = 0; i < leaf_count; i++) {
@@ -655,7 +655,7 @@ zgetpath(i_ctx_t *i_ctx_p)
if (pe <= 0)
return pe;
if (pe >= 5)
- return_error(e_unregistered);
+ return_error(gs_error_unregistered);
}
}
}
@@ -673,9 +673,9 @@ upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat
ref opcodes;
if (r_has_type(oppath, t__invalid))
- return_error(e_stackunderflow);
+ return_error(gs_error_stackunderflow);
if (!r_is_array(oppath))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
check_read(*oppath);
gs_newpath(igs);
/****** ROUND tx AND ty ******/
@@ -704,7 +704,7 @@ upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat
if (opx > UPATH_REPEAT)
repcount = opx - UPATH_REPEAT;
else if (opx > UPATH_MAX_OP)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
else { /* operator */
const up_data_t data = up_data[opx];
@@ -715,7 +715,7 @@ upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat
ups = ups > UPS_UCACHE ? ups : data.state_after;
} else {
if (!(ups & data.states_before))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ups = data.state_after;
}
do {
@@ -734,7 +734,7 @@ upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat
r_set_type_attrs(op, t_real, 0);
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
code = (*up_ops[opx])(i_ctx_p);
@@ -772,49 +772,49 @@ upath_append_aux(os_ptr oppath, i_ctx_t *i_ctx_p, int *pnargs, bool upath_compat
if (!r_has_attr(&rup, a_executable) ||
dict_find(systemdict, &rup, &defp) <= 0 ||
r_btype(defp) != t_operator)
- return_error(e_typecheck); /* all errors = typecheck */
+ return_error(gs_error_typecheck); /* all errors = typecheck */
goto xop;
case t_operator:
defp = &rup;
xop:if (!r_has_attr(defp, a_executable))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
oproc = real_opproc(defp);
for (opx = 0; opx <= UPATH_MAX_OP; opx++)
if (oproc == up_ops[opx])
break;
if (opx > UPATH_MAX_OP)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
data = up_data[opx];
if (argcount != data.num_args)
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
if (upath_compat && opx == upath_op_ucache) {
/* CPSI does not complain about incorrect ucache
placement, even though PLRM3 says it's illegal. */
ups = ups > UPS_UCACHE ? ups : data.state_after;
} else {
if (!(ups & data.states_before))
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
ups = data.state_after;
}
code = (*up_ops[opx])(i_ctx_p);
if (code < 0) {
- if (code == e_nocurrentpoint)
- return_error(e_rangecheck); /* CET 11-22 */
+ if (code == gs_error_nocurrentpoint)
+ return_error(gs_error_rangecheck); /* CET 11-22 */
return code;
}
argcount = 0;
break;
default:
- return_error(e_typecheck);
+ return_error(gs_error_typecheck);
}
}
if (argcount) {
*pnargs = argcount;
- return_error(e_typecheck); /* leftover args */
+ return_error(gs_error_typecheck); /* leftover args */
}
}
if (ups < UPS_SETBBOX)
- return_error(e_typecheck); /* no setbbox */
+ return_error(gs_error_typecheck); /* no setbbox */
if (ups == UPS_SETBBOX && upath_compat) {
/*
* In CPSI compatibility mode, an empty path with a setbbox also
diff --git a/gs/psi/zusparam.c b/gs/psi/zusparam.c
index c3e13efdd..4e8daa55c 100644
--- a/gs/psi/zusparam.c
+++ b/gs/psi/zusparam.c
@@ -271,7 +271,7 @@ zsetsystemparams(i_ctx_t *i_ctx_p)
code = param_check_password(plist, &pass);
if (code != 0) {
if (code > 0)
- code = gs_note_error(e_invalidaccess);
+ code = gs_note_error(gs_error_invalidaccess);
goto out;
}
code = param_read_password(plist, "StartJobPassword", &pass);
@@ -655,7 +655,7 @@ set_LockFilePermissions(i_ctx_t *i_ctx_p, bool val)
{
/* allow locking even if already locked */
if (i_ctx_p->LockFilePermissions && !val)
- return_error(e_invalidaccess);
+ return_error(gs_error_invalidaccess);
i_ctx_p->LockFilePermissions = val;
return 0;
}
@@ -773,7 +773,7 @@ setparams(i_ctx_t *i_ctx_p, gs_param_list * plist, const param_set * pset)
break;
case 0:
if (val < pdef->min_value || val > pdef->max_value)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
code = (*pdef->set)(i_ctx_p, val);
if (code < 0)
return code;
@@ -916,7 +916,7 @@ currentparam1(i_ctx_t *i_ctx_p, const param_set * pset)
if (code < 0)
return code;
if (osp == op)
- return_error(e_undefined);
+ return_error(gs_error_undefined);
/* We know osp == op + 2. */
ref_assign(op, op + 2);
pop(2);
diff --git a/gs/psi/zutf8.c b/gs/psi/zutf8.c
index afd1a22c0..c195cb706 100644
--- a/gs/psi/zutf8.c
+++ b/gs/psi/zutf8.c
@@ -41,7 +41,7 @@ zlocale_to_utf8(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
input = ref_to_string(op, imemory, "locale_to_utf8 input");
if (input == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
output = stringprep_locale_to_utf8(input);
ifree_string((byte *)input, r_size(op) + 1, "locale_to_utf8 input");
@@ -62,7 +62,7 @@ zlocale_to_utf8(i_ctx_t *i_ctx_p)
/* Other errors (like ENFILE) are real errors, which we
* want to return to the user. */
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
}
code = string_to_ref(output, op, iimemory, "locale_to_utf8 output");
diff --git a/gs/psi/zvmem.c b/gs/psi/zvmem.c
index 86aa8f37e..a00beb1f1 100644
--- a/gs/psi/zvmem.c
+++ b/gs/psi/zvmem.c
@@ -76,14 +76,14 @@ zsave(i_ctx_t *i_ctx_p)
vmsave = ialloc_struct(vm_save_t, &st_vm_save, "zsave");
ialloc_set_space(idmemory, space);
if (vmsave == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
vmsave->gsave = NULL; /* Ensure constructed enough to destroy safely */
code = alloc_save_state(idmemory, vmsave, &sid);
if (code < 0)
return code;
if (sid == 0) {
ifree_object(vmsave, "zsave");
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
}
if_debug2m('u', imemory, "[u]vmsave 0x%lx, id = %lu\n",
(ulong) vmsave, (ulong) sid);
@@ -191,11 +191,11 @@ restore_check_operand(os_ptr op, alloc_save_t ** pasave,
check_type(*op, t_save);
vmsave = r_ptr(op, vm_save_t);
if (vmsave == 0) /* invalidated save */
- return_error(e_invalidrestore);
+ return_error(gs_error_invalidrestore);
sid = op->value.saveid;
asave = alloc_find_save(idmem, sid);
if (asave == 0)
- return_error(e_invalidrestore);
+ return_error(gs_error_invalidrestore);
*pasave = asave;
return 0;
}
@@ -247,7 +247,7 @@ restore_check_stack(const i_ctx_t *i_ctx_p, const ref_stack_t * pstack,
/* Names are special because of how they are allocated. */
if (alloc_name_is_since_save((const gs_memory_t *)pstack->memory,
stkp, asave))
- return_error(e_invalidrestore);
+ return_error(gs_error_invalidrestore);
continue;
case t_string:
/* Don't check empty executable strings */
@@ -285,7 +285,7 @@ restore_check_stack(const i_ctx_t *i_ctx_p, const ref_stack_t * pstack,
* in LL3, but just in case....
*/
if (ptr == 0)
- return_error(e_invalidrestore);
+ return_error(gs_error_invalidrestore);
if (ptr == asave)
continue;
break;
@@ -293,7 +293,7 @@ restore_check_stack(const i_ctx_t *i_ctx_p, const ref_stack_t * pstack,
continue;
}
if (alloc_is_since_save(ptr, asave))
- return_error(e_invalidrestore);
+ return_error(gs_error_invalidrestore);
}
} while (ref_stack_enum_next(&rsenum));
return 0; /* OK */
diff --git a/gs/psi/zvmem2.c b/gs/psi/zvmem2.c
index 13d9b6b88..0edfd5756 100644
--- a/gs/psi/zvmem2.c
+++ b/gs/psi/zvmem2.c
@@ -78,7 +78,7 @@ int
set_vm_threshold(i_ctx_t *i_ctx_p, long val)
{
if (val < -1)
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
else if (val == -1)
val = (gs_debug_c('.') ? DEFAULT_VM_THRESHOLD_SMALL :
DEFAULT_VM_THRESHOLD_LARGE);
@@ -100,7 +100,7 @@ set_vm_reclaim(i_ctx_t *i_ctx_p, long val)
gs_memory_set_vm_reclaim(idmemory->space_local, (val == 0));
return 0;
} else
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/*
@@ -118,9 +118,9 @@ zvmreclaim(i_ctx_t *i_ctx_p)
if (op->value.intval == 1 || op->value.intval == 2) {
/* Force the interpreter to store its state and exit. */
/* The interpreter's caller will do the actual GC. */
- return_error(e_VMreclaim);
+ return_error(gs_error_VMreclaim);
}
- return_error(e_rangecheck);
+ return_error(gs_error_rangecheck);
}
/* ------ Initialization procedure ------ */
diff --git a/gs/psi/zwinutf8.c b/gs/psi/zwinutf8.c
index 1ab7a4a68..fe6865ef2 100644
--- a/gs/psi/zwinutf8.c
+++ b/gs/psi/zwinutf8.c
@@ -45,18 +45,18 @@ zlocale_to_utf8(i_ctx_t *i_ctx_p)
check_read_type(*op, t_string);
input = ref_to_string(op, imemory, "locale_to_utf8 input");
if (input == 0)
- return_error(e_VMerror);
+ return_error(gs_error_VMerror);
success = MultiByteToWideChar(CP_ACP, 0, input, -1,
wide_buffer, LOCALE_TO_UTF8_BUFFER_SIZE);
ifree_string((byte *)input, r_size(op) + 1, "locale_to_utf8 input");
if (success == 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
success = WideCharToMultiByte(CP_UTF8, 0, wide_buffer, -1,
utf8_buffer, LOCALE_TO_UTF8_BUFFER_SIZE, NULL, NULL);
if (success == 0)
- return_error(e_ioerror);
+ return_error(gs_error_ioerror);
code = string_to_ref(utf8_buffer, op, iimemory, "locale_to_utf8 output");
if (code < 0)