diff -ruN ghostscript/base/gdevkrnlsclass.c ghostscript-10.04.0/base/gdevkrnlsclass.c
--- ghostscript/base/gdevkrnlsclass.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gdevkrnlsclass.c	2025-09-22 23:44:23.062226922 -0400
@@ -29,7 +29,7 @@
  * of devices which the push of the compositor claims are already installed (to prevent
  * a second copy being installed by gdev_prn_open).
  */
-int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded)
+int install_internal_subclass_devices(gx_device **ppdev, bool *devices_loaded)
 {
     int code = 0;
     gx_device *dev = (gx_device *)*ppdev, *saved;
diff -ruN ghostscript/base/gdevkrnlsclass.h ghostscript-10.04.0/base/gdevkrnlsclass.h
--- ghostscript/base/gdevkrnlsclass.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gdevkrnlsclass.h	2025-09-22 23:44:11.014798838 -0400
@@ -29,6 +29,6 @@
 
 extern gx_device_nup gs_nup_device;
 
-int install_internal_subclass_devices(gx_device **ppdev, int *devices_loaded);
+int install_internal_subclass_devices(gx_device **ppdev, bool *devices_loaded);
 
 #endif /* gdev_subclass_dev_INCLUDED */
diff -ruN ghostscript/base/gdevnup.c ghostscript-10.04.0/base/gdevnup.c
--- ghostscript/base/gdevnup.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gdevnup.c	2025-09-22 23:45:23.630654305 -0400
@@ -682,7 +682,7 @@
         case gxdso_get_dev_param:
             {
                 dev_param_req_t *request = (dev_param_req_t *)data;
-                int code = false;
+                bool code = false;
 
                 /* We need to disable pdfmark writing, primarily for CropBox, but also	*/
                 /* they are probably not relevant for multiple input files to a single	*/
diff -ruN ghostscript/base/gp.h ghostscript-10.04.0/base/gp.h
--- ghostscript/base/gp.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gp.h	2025-09-22 23:46:27.750962352 -0400
@@ -646,7 +646,7 @@
 /* Create a second open gp_file on the basis of a given one */
 FILE *gp_fdup_impl(FILE *f, const char *mode);
 
-int gp_fseekable_impl(FILE *f);
+bool gp_fseekable_impl(FILE *f);
 
 /* Force given file into binary mode (no eol translations, etc) */
 /* if 2nd param true, text mode if 2nd param false */
diff -ruN ghostscript/base/gsfcmap.c ghostscript-10.04.0/base/gsfcmap.c
--- ghostscript/base/gsfcmap.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gsfcmap.c	2025-09-22 23:47:01.894647661 -0400
@@ -221,7 +221,7 @@
 /*
  * Check for identity CMap. Uses a fast check for special cases.
  */
-int
+bool
 gs_cmap_is_identity(const gs_cmap_t *pcmap, int font_index_only)
 {
     return pcmap->procs->is_identity(pcmap, font_index_only);
diff -ruN ghostscript/base/gsovrc.c ghostscript-10.04.0/base/gsovrc.c
--- ghostscript/base/gsovrc.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gsovrc.c	2025-09-22 23:48:07.239632855 -0400
@@ -297,7 +297,7 @@
  * This is used by the gs_pdf1.4_device (and eventually the PDFWrite
  * device), which implements overprint and overprint mode directly.
  */
-int
+bool
 gs_is_overprint_compositor(const gs_composite_t * pct)
 {
     return pct->type == &gs_composite_overprint_type;
diff -ruN ghostscript/base/gsstate.h ghostscript-10.04.0/base/gsstate.h
--- ghostscript/base/gsstate.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gsstate.h	2025-09-22 23:49:08.254613264 -0400
@@ -54,8 +54,8 @@
 int gs_currentrenderingintent(const gs_gstate *);
 int gs_setrenderingintent(gs_gstate *, int);
 
-int gs_currentblackptcomp(const gs_gstate *);
-int gs_setblackptcomp(gs_gstate *, int);
+bool gs_currentblackptcomp(const gs_gstate *);
+bool gs_setblackptcomp(gs_gstate *, int);
 
 int gs_initgraphics(gs_gstate *);
 int gs_initgraphics_no_cspace(gs_gstate *);
diff -ruN ghostscript/base/gxcmap.c ghostscript-10.04.0/base/gxcmap.c
--- ghostscript/base/gxcmap.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gxcmap.c	2025-09-22 23:49:28.086849202 -0400
@@ -601,7 +601,7 @@
 /* If someone has specified a table for handling named spot colors then we will
    be attempting to do the special handling to go directly to the device colors
    here */
-bool
+int
 gx_remap_named_color(const gs_client_color * pcc, const gs_color_space * pcs,
 gx_device_color * pdc, const gs_gstate * pgs, gx_device * dev,
 gs_color_select_t select)
diff -ruN ghostscript/base/gxdownscale.c ghostscript-10.04.0/base/gxdownscale.c
--- ghostscript/base/gxdownscale.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gxdownscale.c	2025-09-22 23:50:22.007691537 -0400
@@ -3376,7 +3376,8 @@
                               int                   features)
 {
     int code;
-    int downscale, mfs, ets, deskew;
+    int downscale, mfs, ets;
+    bool deskew;
     int trap_w, trap_h;
     const char *param_name;
     gs_param_int_array trap_order;
diff -ruN ghostscript/base/gxfapi.h ghostscript-10.04.0/base/gxfapi.h
--- ghostscript/base/gxfapi.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gxfapi.h	2025-09-22 23:51:32.383467323 -0400
@@ -348,7 +348,7 @@
     gs_fapi_retcode(*get_decodingID) (gs_fapi_server *server, gs_fapi_font *ff, const char **decodingID);
     gs_fapi_retcode(*get_font_bbox) (gs_fapi_server *server, gs_fapi_font *ff, int BBox[4], int unitsPerEm[2]);
     gs_fapi_retcode(*get_font_proportional_feature) (gs_fapi_server *server, gs_fapi_font *ff, bool *bProportional);
-    gs_fapi_retcode(*can_retrieve_char_by_name) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, int *result);
+    gs_fapi_retcode(*can_retrieve_char_by_name) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, bool *result);
     gs_fapi_retcode(*can_replace_metrics) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_char_ref *c, int *result);
     gs_fapi_retcode(*can_simulate_style) (gs_fapi_server *server, gs_fapi_font *ff, gs_fapi_style style, void *style_data);
     gs_fapi_retcode(*get_fontmatrix) (gs_fapi_server *server, gs_matrix *m);
diff -ruN ghostscript/base/gximag3x.c ghostscript-10.04.0/base/gximag3x.c
--- ghostscript/base/gximag3x.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gximag3x.c	2025-09-22 23:53:11.855293398 -0400
@@ -391,7 +391,7 @@
  * pmcs->{InterleaveType,width,height,full_height,depth,data,y,skip}.
  * If the mask is omitted, sets pmcs->depth = 0 and returns normally.
  */
-static bool
+static int
 check_image3x_mask(const gs_image3x_t *pim, const gs_image3x_mask_t *pimm,
                    const image3x_channel_values_t *ppcv,
                    image3x_channel_values_t *pmcv,
diff -ruN ghostscript/base/gxiscale.c ghostscript-10.04.0/base/gxiscale.c
--- ghostscript/base/gxiscale.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/gxiscale.c	2025-09-22 23:53:44.151472092 -0400
@@ -112,7 +112,7 @@
     char data[] = "NoInterpolateImagemasks";
     dev_param_req_t request;
     gs_c_param_list list;
-    int nointerpolate = 0;
+    bool nointerpolate = 0;
     int code;
 
     gs_c_param_list_write(&list, dev->memory);
diff -ruN ghostscript/base/stdpre.h ghostscript-10.04.0/base/stdpre.h
--- ghostscript/base/stdpre.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/base/stdpre.h	2025-09-22 23:55:11.055527009 -0400
@@ -341,7 +341,8 @@
  * and the MetroWerks C++ compiler insists that bool be equivalent to
  * unsigned char.
  */
-#ifndef __cplusplus
+/* C23 has bool as a builtin type. */
+#if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 202311L)
 #ifdef __BEOS__
 typedef unsigned char bool;
 #else
diff -ruN ghostscript/contrib/eplaser/gdevescv.c ghostscript-10.04.0/contrib/eplaser/gdevescv.c
--- ghostscript/contrib/eplaser/gdevescv.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/eplaser/gdevescv.c	2025-09-22 23:56:19.423635110 -0400
@@ -183,7 +183,7 @@
         0,			/*   int           prev_paper_height; */\
         0,			/*   int           prev_num_copies; */\
         -1,			/*   int           prev_feed_mode; */\
-        0,			/*   int           orientation; */\
+        false,			/*   bool          orientation; */\
         ESCPAGE_FACEUP_DEFAULT,	/*   bool          faceup; */\
         ESCPAGE_MEDIATYPE_DEFAULT, /*   int           MediaType; */\
         0,			/*   bool          first_page; */\
diff -ruN ghostscript/contrib/eplaser/gdevescv.h ghostscript-10.04.0/contrib/eplaser/gdevescv.h
--- ghostscript/contrib/eplaser/gdevescv.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/eplaser/gdevescv.h	2025-09-22 23:56:39.551544141 -0400
@@ -126,7 +126,7 @@
   int           prev_paper_height;
   int           prev_num_copies;
   int           prev_feed_mode;
-  int           orientation;
+  bool          orientation;
   bool          faceup;
   int           MediaType;
   bool          first_page;
diff -ruN ghostscript/contrib/gdevmd2k.c ghostscript-10.04.0/contrib/gdevmd2k.c
--- ghostscript/contrib/gdevmd2k.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/gdevmd2k.c	2025-09-22 23:57:41.583978277 -0400
@@ -157,10 +157,10 @@
 }
 
 static int
-alps_put_param_bool(gs_param_list *plist, gs_param_name pname, int *pvalue,
+alps_put_param_bool(gs_param_list *plist, gs_param_name pname, bool *pvalue,
                    int ecode)
 {
-    int code, value;
+    bool code, value;
     switch (code = param_read_bool(plist, pname, &value)) {
     default:
         return code;
diff -ruN ghostscript/contrib/lips4/gdevl4r.c ghostscript-10.04.0/contrib/lips4/gdevl4r.c
--- ghostscript/contrib/lips4/gdevl4r.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/lips4/gdevl4r.c	2025-09-22 23:58:25.791558374 -0400
@@ -496,7 +496,7 @@
     int code;
     gs_param_name param_name;
     gs_param_string pmedia;
-    bool nup = lips4->nup;
+    int nup = lips4->nup;
     bool faceup = lips4->faceup;
     int old_bpp = pdev->color_info.depth;
     int bpp = 0;
diff -ruN ghostscript/contrib/lips4/gdevl4v.c ghostscript-10.04.0/contrib/lips4/gdevl4v.c
--- ghostscript/contrib/lips4/gdevl4v.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/lips4/gdevl4v.c	2025-09-22 23:59:42.607840750 -0400
@@ -224,7 +224,7 @@
 static int
 lips4v_setlogop(gx_device_vector * vdev, gs_logical_operation_t lop,
                  gs_logical_operation_t diff);
-static int lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs,
+static bool lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs,
                   const gx_drawing_color * pdc);
 static int
 
@@ -1220,7 +1220,7 @@
 }
 
 /*--- added for Ghostscritp 8.15 ---*/
-static int
+static bool
 lips4v_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs1,
               const gx_drawing_color * pdc)
 {
diff -ruN ghostscript/contrib/opvp/gdevopvp.c ghostscript-10.04.0/contrib/opvp/gdevopvp.c
--- ghostscript/contrib/opvp/gdevopvp.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/contrib/opvp/gdevopvp.c	2025-09-23 00:00:54.984663980 -0400
@@ -265,7 +265,7 @@
 static  int opvp_setflat(gx_device_vector *, double);
 static  int opvp_setlogop(gx_device_vector *, gs_logical_operation_t,
                           gs_logical_operation_t);
-static  int opvp_can_handle_hl_color(gx_device_vector *, const gs_gstate *, const gx_drawing_color *);
+static  bool opvp_can_handle_hl_color(gx_device_vector *, const gs_gstate *, const gx_drawing_color *);
 static  int opvp_setfillcolor(gx_device_vector *, const gs_gstate *, const gx_drawing_color *);
 static  int opvp_setstrokecolor(gx_device_vector *, const gs_gstate *,const gx_drawing_color *);
 static  int opvp_vector_dopath(gx_device_vector *, const gx_path *,
@@ -4947,7 +4947,7 @@
 }
 
 /*--- added for Ghostscript 8.15 ---*/
-static int
+static bool
 opvp_can_handle_hl_color(gx_device_vector * vdev,
               const gs_gstate * pgs1, const gx_drawing_color * pdc)
 {
diff -ruN ghostscript/devices/gdevcdj.c ghostscript-10.04.0/devices/gdevcdj.c
--- ghostscript/devices/gdevcdj.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/gdevcdj.c	2025-09-23 00:06:59.064849452 -0400
@@ -337,7 +337,7 @@
     bool mediaWeight_isSet;	/* Say if weight is an integer or null */ \
     int mediaWeight;		/* Weigth of the media */ \
     int printQuality;		/* Cf. strings below */ \
-    bool ditheringType;		/* Do dithering */ \
+    int ditheringType;		/* Do dithering */ \
     int colorComponents;	/* The number of *desired* color comps */ \
     int printColors		/* 0: Transparent, \
                                    1: C, 2: M, 4: Y, 7: K (Color decomp). \
diff -ruN ghostscript/devices/gdevpdfimg.h ghostscript-10.04.0/devices/gdevpdfimg.h
--- ghostscript/devices/gdevpdfimg.h	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/gdevpdfimg.h	2025-09-23 00:07:30.232991606 -0400
@@ -74,8 +74,8 @@
     PCLm_temp_file_t temp_stream;
     int NextObject;
 
-    int Tumble;
-    int Tumble2;
+    bool Tumble;
+    bool Tumble2;
 
     /* OCR data */
     struct {
diff -ruN ghostscript/devices/vector/gdevpdfd.c ghostscript-10.04.0/devices/vector/gdevpdfd.c
--- ghostscript/devices/vector/gdevpdfd.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/vector/gdevpdfd.c	2025-09-23 00:08:26.169119196 -0400
@@ -108,7 +108,7 @@
     return psdf_setlinewidth(vdev, fabs(width));
 }
 
-static int
+static bool
 pdf_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs,
                  const gx_drawing_color * pdc)
 {
diff -ruN ghostscript/devices/vector/gdevpdtt.c ghostscript-10.04.0/devices/vector/gdevpdtt.c
--- ghostscript/devices/vector/gdevpdtt.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/vector/gdevpdtt.c	2025-09-23 00:11:02.665454293 -0400
@@ -3260,18 +3260,15 @@
     gs_matrix_scale(pmat, pdev->HWResolution[0] / 72.0, pdev->HWResolution[0] / 72.0, pmat);
 }
 
-static int pdf_query_purge_cached_char(const gs_memory_t *mem, cached_char *cc, void *data)
+static bool pdf_query_purge_cached_char(const gs_memory_t *mem, cached_char *cc, void *data)
 {
     cached_char *to_purge = (cached_char *)data;
 
 
-    if (cc->code == to_purge->code && cc_pair(cc) == cc_pair(to_purge) &&
-        cc->subpix_origin.x == to_purge->subpix_origin.x &&
-        cc->subpix_origin.y == to_purge->subpix_origin.y &&
-        cc->wmode == to_purge->wmode && cc_depth(cc) == cc_depth(to_purge)
-        )
-        return 1;
-    return 0;
+    return cc->code == to_purge->code && cc_pair(cc) == cc_pair(to_purge) &&
+           cc->subpix_origin.x == to_purge->subpix_origin.x &&
+           cc->subpix_origin.y == to_purge->subpix_origin.y &&
+           cc->wmode == to_purge->wmode && cc_depth(cc) == cc_depth(to_purge);
 }
 
 static int ProcessTextForOCR(gs_text_enum_t *pte)
diff -ruN ghostscript/devices/vector/gdevpx.c ghostscript-10.04.0/devices/vector/gdevpx.c
--- ghostscript/devices/vector/gdevpx.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/vector/gdevpx.c	2025-09-23 00:11:26.153055850 -0400
@@ -1393,7 +1393,7 @@
     return 0;
 }
 
-static int
+static bool
 pclxl_can_handle_hl_color(gx_device_vector * vdev, const gs_gstate * pgs,
                           const gx_drawing_color * pdc)
 {
diff -ruN ghostscript/devices/vector/gdevxps.c ghostscript-10.04.0/devices/vector/gdevxps.c
--- ghostscript/devices/vector/gdevxps.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/devices/vector/gdevxps.c	2025-09-23 00:12:32.017408699 -0400
@@ -271,7 +271,7 @@
 xps_setlogop(gx_device_vector *vdev, gs_logical_operation_t lop,
              gs_logical_operation_t diff);
 
-static int
+static bool
 xps_can_handle_hl_color(gx_device_vector *vdev, const gs_gstate *pgs,
                         const gx_drawing_color * pdc);
 static int
@@ -1480,12 +1480,12 @@
 
         /* Other state */
 
-static int
+static bool
 xps_can_handle_hl_color(gx_device_vector *vdev, const gs_gstate *pgs,
                           const gx_drawing_color *pdc)
 {
     if_debug0m('_', vdev->memory, "xps_can_handle_hl_color\n");
-    return 0;
+    return false;
 }
 
 /* Paths */
diff -ruN ghostscript/pdf/pdf_device.c ghostscript-10.04.0/pdf/pdf_device.c
--- ghostscript/pdf/pdf_device.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/pdf/pdf_device.c	2025-09-23 00:13:15.905023198 -0400
@@ -45,7 +45,7 @@
 {
     int code;
     gs_c_param_list list;
-    int value;
+    bool value;
 
     code = pdfi_device_check_param(dev, param, &list);
     if (code < 0)
@@ -57,7 +57,7 @@
     if (code < 0)
         value = false;
     gs_c_param_list_release(&list);
-    return (bool)value;
+    return value;
 }
 
 /* Set value of string device parameter */
diff -ruN ghostscript/psi/zcontrol.c ghostscript-10.04.0/psi/zcontrol.c
--- ghostscript/psi/zcontrol.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/psi/zcontrol.c	2025-09-23 00:14:04.993458475 -0400
@@ -990,7 +990,7 @@
  * interpreter to catch them, so that we can signal the error with the
  * object still on the operand stack.
  */
-static bool
+static int
 check_for_exec(const_os_ptr op)
 {
     if (!r_has_attr(op, a_execute) && /* only true if noaccess */
diff -ruN ghostscript/psi/zfaes.c ghostscript-10.04.0/psi/zfaes.c
--- ghostscript/psi/zfaes.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/psi/zfaes.c	2025-09-23 00:14:30.505424041 -0400
@@ -38,7 +38,7 @@
     os_ptr op = osp;		/* i_ctx_p->op_stack.stack.p defined in osstack.h */
     ref *sop = NULL;
     stream_aes_state state;
-    int use_padding;
+    bool use_padding;
 
     check_op(2);
     /* extract the key from the parameter dictionary */
diff -ruN ghostscript/psi/zfdecode.c ghostscript-10.04.0/psi/zfdecode.c
--- ghostscript/psi/zfdecode.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/psi/zfdecode.c	2025-09-23 00:16:55.465678371 -0400
@@ -190,7 +190,7 @@
 int
 zlz_setup(os_ptr op, stream_LZW_state * plzs)
 {
-    int code;
+    int code, ech;
     const ref *dop;
 
     s_LZW_set_defaults_inline(plzs);
@@ -200,7 +200,7 @@
     } else
         dop = 0;
     if (   (code = dict_int_param(dop, "EarlyChange", 0, 1, 1,
-                                  &plzs->EarlyChange)) < 0 ||
+                                  &ech) < 0 ||
            /*
             * The following are not PostScript standard, although
             * LanguageLevel 3 provides the first two under different
@@ -213,7 +213,8 @@
            (code = dict_bool_param(dop, "BlockData", false,
                                    &plzs->BlockData)) < 0
         )
-        return code;
+	return code;
+    plzs->EarlyChange = ech != 0;
     return 0;
 }
 
diff -ruN ghostscript/psi/zfunc4.c ghostscript-10.04.0/psi/zfunc4.c
--- ghostscript/psi/zfunc4.c	2024-09-18 03:34:15.000000000 -0400
+++ ghostscript-10.04.0/psi/zfunc4.c	2025-09-23 00:18:29.026158092 -0400
@@ -468,7 +468,7 @@
     int code;
     byte *ops;
     uint size;
-    int AllowRepeat = 1; /* Default to permitting Repeat, devices which can't handle it implement the spec_op */
+    bool AllowRepeat = true; /* Default to permitting Repeat, devices which can't handle it implement the spec_op */
 
     *(gs_function_params_t *)&params = *mnDR;
     params.ops.data = 0;	/* in case of failure */
@@ -548,7 +548,7 @@
     float *ptr;
     ref alternatespace, *palternatespace = &alternatespace;
     PS_colour_space_t *space, *altspace;
-    int AllowRepeat = 1; /* Default to permitting Repeat, devices which can't handle it implement the spec_op */
+    bool AllowRepeat = true; /* Default to permitting Repeat, devices which can't handle it implement the spec_op */
 
     code = get_space_object(i_ctx_p, arr, &space);
     if (code < 0)
