commit 6aff3948636798995b5755f126654805aa67254f
parent 94ce672689153a71e84b4a72d7e530e6e7ff7fb6
Author: Kyle Milz <milz@macbook.0x30.net>
Date: Tue, 18 Aug 2020 13:48:27 -0700
%s/_Xconst/const
_Xconst seems to be an X11 thing for systems that maybe do not have const.
Diffstat:
M | dvi-draw.c | | | 44 | ++++++++++++++++++++++---------------------- |
M | dvi-init.c | | | 6 | +++--- |
M | events.c | | | 20 | ++++++++++---------- |
M | filefind.c | | | 260 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
M | filefind.h | | | 56 | ++++++++++++++++++++++++++++---------------------------- |
M | font-open.c | | | 104 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
M | ft.c | | | 8 | ++++---- |
M | popups.c | | | 96 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
M | psdps.c | | | 18 | +++++++++--------- |
M | psgs.c | | | 42 | +++++++++++++++++++++--------------------- |
M | psnews.c | | | 44 | ++++++++++++++++++++++---------------------- |
M | special.c | | | 70 | +++++++++++++++++++++++++++++++++++----------------------------------- |
M | squeeze.c | | | 8 | ++++---- |
M | util.c | | | 52 | ++++++++++++++++++++++++++-------------------------- |
M | xdvi.c | | | 98 | ++++++++++++++++++++++++++++++++++++++++---------------------------------------- |
M | xdvi.h | | | 128 | +++++++++++++++++++++++++++++++++++++------------------------------------------ |
M | xdvi.icon | | | 2 | +- |
17 files changed, 524 insertions(+), 532 deletions(-)
diff --git a/dvi-draw.c b/dvi-draw.c
@@ -287,10 +287,10 @@ xskip(offset)
}
#if NeedVarargsPrototypes
-static void tell_oops(_Xconst char *, ...) NORETURN;
+static void tell_oops(const char *, ...) NORETURN;
static void
-tell_oops(_Xconst char *message, ...)
+tell_oops(const char *message, ...)
#else
/* VARARGS */
static void
@@ -299,7 +299,7 @@ tell_oops(va_alist)
#endif
{
#if !NeedVarargsPrototypes
- _Xconst char *message;
+ const char *message;
#endif
va_list args;
@@ -308,7 +308,7 @@ tell_oops(va_alist)
va_start(args, message);
#else
va_start(args);
- message = va_arg(args, _Xconst char *);
+ message = va_arg(args, const char *);
#endif
(void) vfprintf(stderr, message, args);
va_end(args);
@@ -361,7 +361,7 @@ print_char(ch, g)
print_bitmap(&g->bitmap);
}
-static _Xconst char *dvi_table1[] = {
+static const char *dvi_table1[] = {
"SET1", NULL, NULL, NULL, "SETRULE", "PUT1", NULL, NULL,
NULL, "PUTRULE", "NOP", "BOP", "EOP", "PUSH", "POP", "RIGHT1",
"RIGHT2", "RIGHT3", "RIGHT4", "W0", "W1", "W2", "W3", "W4",
@@ -369,7 +369,7 @@ static _Xconst char *dvi_table1[] = {
"DOWN4", "Y0", "Y1", "Y2", "Y3", "Y4", "Z0", "Z1",
"Z2", "Z3", "Z4"};
-static _Xconst char *dvi_table2[] = {
+static const char *dvi_table2[] = {
"FNT1", "FNT2", "FNT3", "FNT4", "XXX1", "XXX2", "XXX3", "XXX4",
"FNTDEF1", "FNTDEF2", "FNTDEF3", "FNTDEF4", "PRE", "POST", "POSTPOST",
"SREFL", "EREFL", NULL, NULL, NULL, NULL};
@@ -378,7 +378,7 @@ static void
print_dvi(ch)
ubyte ch;
{
- _Xconst char *s;
+ const char *s;
Printf("%4d %4d ", PXL_H, PXL_V);
if (ch <= (ubyte) (SETCHAR0 + 127)) {
@@ -2085,7 +2085,7 @@ static void
src_spec_box ARGS((struct geom_info *, long, long, long, long));
static void
-src_spec_special ARGS((struct geom_info *, _Xconst char *));
+src_spec_special ARGS((struct geom_info *, const char *));
struct src_parsed_special {
int line;
@@ -2106,10 +2106,10 @@ struct src_spec_data {
static void
src_parse(str, parsed)
- _Xconst char *str;
+ const char *str;
struct src_parsed_special *parsed;
{
- _Xconst char *p;
+ const char *p;
p = str + 4; /* skip "src:" */
@@ -2187,7 +2187,7 @@ src_spec_box(g_info, ulx, uly, lrx, lry)
static void
src_spec_special(g_info, str)
struct geom_info *g_info;
- _Xconst char *str;
+ const char *str;
{
struct src_spec_data *data = g_info->geom_data;
@@ -2260,7 +2260,7 @@ scan_last_src_spcl(str)
#include "filf-app.h" /* application-related defs, etc. */
#include "filefind.h"
-static _Xconst char no_f_str_tex[] = "/%f";
+static const char no_f_str_tex[] = "/%f";
static struct findrec search_tex = {
/* path1 */ no_f_str_tex, /* flag value: uninitialized */
@@ -2294,15 +2294,15 @@ static struct findrec search_tex = {
static void
src_spawn_editor(parsed)
- _Xconst struct src_parsed_special *parsed;
+ const struct src_parsed_special *parsed;
{
char scr_str[5 * sizeof(int) / 2];
- _Xconst char *filename2;
+ const char *filename2;
Boolean found_filename = False;
size_t buffer_pos;
int argc;
char **argv;
- _Xconst char *p, *p1;
+ const char *p, *p1;
char *q;
FILE *f;
int i;
@@ -2377,7 +2377,7 @@ src_spawn_editor(parsed)
#endif /* not CFGFILE */
}
- f = filefind(parsed->filename, &search_tex, (_Xconst char **) NULL);
+ f = filefind(parsed->filename, &search_tex, (const char **) NULL);
filename2 = ffline;
}
@@ -2639,7 +2639,7 @@ static void
src_spec_show_box ARGS((struct geom_info *, long, long, long, long));
static void
-src_spec_show_special ARGS((struct geom_info *, _Xconst char *));
+src_spec_show_special ARGS((struct geom_info *, const char *));
struct src_spec_show_data {
Boolean do_this_one; /* flag set after source special */
@@ -2669,7 +2669,7 @@ src_spec_show_box(g_info, ulx, uly, lrx, lry)
static void
src_spec_show_special(g_info, str)
struct geom_info *g_info;
- _Xconst char *str;
+ const char *str;
{
if (memcmp(str, "src:", 4) != 0)
return;
@@ -2710,7 +2710,7 @@ static int src_this_line;
static size_t src_this_file_strcmp;
static int src_line;
static int src_col;
-static _Xconst char *src_file;
+static const char *src_file;
static int src_page;
static jmp_buf src_env;
static Boolean found_src;
@@ -2799,7 +2799,7 @@ static void
src_spec_fwd_box ARGS((struct geom_info *, long, long, long, long));
static void
-src_spec_fwd_special ARGS((struct geom_info *, _Xconst char *));
+src_spec_fwd_special ARGS((struct geom_info *, const char *));
/* ARGSUSED */
static void
@@ -2818,7 +2818,7 @@ src_spec_fwd_box(g_info, ulx, uly, lrx, lry)
static void
src_spec_fwd_special(g_info, str)
struct geom_info *g_info;
- _Xconst char *str;
+ const char *str;
{
long pos;
@@ -2872,7 +2872,7 @@ source_fwd_draw_box()
void
source_forward_search(str)
- _Xconst char *str;
+ const char *str;
{
off_t pos_save;
struct drawinf currinf_save;
diff --git a/dvi-init.c b/dvi-init.c
@@ -53,7 +53,7 @@ NOTE:
#define VF_MAGIC ((VF_PRE << 8) | VF_ID_BYTE)
static jmp_buf dvi_env; /* mechanism to relay dvi file errors */
-static _Xconst char *dvi_oops_msg; /* error message */
+static const char *dvi_oops_msg; /* error message */
#define dvi_oops(str) (dvi_oops_msg = (str), longjmp(dvi_env, 1))
@@ -175,7 +175,7 @@ full_reset_colors()
{
if (page_colors != NULL) {
int i;
- _Xconst struct rgb *last_freed = &fg_initial;
+ const struct rgb *last_freed = &fg_initial;
for (i = 0; i < total_pages; ++i) {
if (page_colors[i].colorstack != last_freed) {
@@ -819,7 +819,7 @@ set_titles()
Boolean
open_dvi_file(path)
- _Xconst char *path;
+ const char *path;
{
struct stat buf;
ino_t old_inode;
diff --git a/events.c b/events.c
@@ -322,10 +322,10 @@ Cardinal num_actions = XtNumber(Actions);
Bool
compile_action(str, app)
- _Xconst char *str;
+ const char *str;
struct xdvi_action **app;
{
- _Xconst char *p, *p1, *p2;
+ const char *p, *p1, *p2;
XtActionsRec *actp;
struct xdvi_action *ap;
@@ -477,7 +477,7 @@ struct button_info {
static struct button_info *b_head;
-_Xconst char default_button_config[] =
+const char default_button_config[] =
#if PS
"Quit:quit()\n\
Open:open-dvi-file()\n\n\
@@ -516,7 +516,7 @@ create_buttons()
Dimension y_pos;
struct button_info **bipp;
struct button_info *bp;
- _Xconst char *cspos;
+ const char *cspos;
int button_number;
int shrink_button_number;
int shrink_arg;
@@ -543,7 +543,7 @@ create_buttons()
for (cspos = resource.button_translations;; ++cspos) {
Dimension w, h;
- _Xconst char *p1, *p2;
+ const char *p1, *p2;
char *label, *q;
char name[9];
Widget widget;
@@ -870,7 +870,7 @@ static Boolean shifts_good = False;
Pixel
alloc_color(colorp, fallback_pixel)
- _Xconst struct rgb *colorp;
+ const struct rgb *colorp;
Pixel fallback_pixel;
{
XColor xcol;
@@ -2382,7 +2382,7 @@ compute_mag_pos(xp, yp)
static
ACTION(Act_magnifier)
{
- _Xconst char *p;
+ const char *p;
int x, y;
XSetWindowAttributes attr;
Window throwaway;
@@ -2900,7 +2900,7 @@ static void do_sigusr ARGS((void));
typedef void (*signalproc) ARGS((void));
-static _Xconst signalproc flags_to_sigproc[32]
+static const signalproc flags_to_sigproc[32]
= {NULL, SP0, SP1, SP1, SP2, SP2, SP2, SP2,
SP3, SP3, SP3, SP3, SP3, SP3, SP3, SP3,
SP4, SP4, SP4, SP4, SP4, SP4, SP4, SP4,
@@ -3715,7 +3715,7 @@ static void
redraw_page()
{
#if COLOR
- _Xconst struct rgb *rgbp;
+ const struct rgb *rgbp;
#endif
if (debug & DBG_EVENT) Fputs("Redraw page: ", stdout);
@@ -3879,7 +3879,7 @@ do_pages()
ev_flags &= ~EV_SRC;
if (source_forward_string != NULL) {
- _Xconst char *s = source_forward_string;
+ const char *s = source_forward_string;
source_forward_string = NULL;
source_forward_search(s);
diff --git a/filefind.c b/filefind.c
@@ -65,8 +65,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#endif
#endif /* !defined(ST_NLINK_TRICK) */
-extern char *xstrdup ARGS((_Xconst char *));
-extern char *xmemdup ARGS((_Xconst char *, size_t));
+extern char *xstrdup ARGS((const char *));
+extern char *xmemdup ARGS((const char *, size_t));
/* These are defined so that the editor can match braces properly. */
#define LBRACE '{'
@@ -96,19 +96,19 @@ struct statrec { /* status vis-a-vis laying down the file name */
struct texmfrec { /* list of texmf components */
struct texmfrec *next;
- _Xconst char *home;
- _Xconst char *str;
+ const char *home;
+ const char *str;
int len;
int flags;
};
#if !CFGFILE
-static _Xconst char default_texmf_path[] = DEFAULT_TEXMF_PATH;
+static const char default_texmf_path[] = DEFAULT_TEXMF_PATH;
#endif
/* These are global variables. */
-_Xconst char *fF_values[MAX_N_OPTS]; /* not static */
+const char *fF_values[MAX_N_OPTS]; /* not static */
static FILE *file_found;
static jmp_buf got_it;
@@ -118,7 +118,7 @@ static struct findrec *frecp; /* used to distinguish ls-Rs */
static int seqno;
static struct texmfrec *texmfhead = NULL;
static struct rootrec **rootpp;
-static _Xconst struct atomrec *treeatom;
+static const struct atomrec *treeatom;
#if USE_GF
static int gflags; /* global flags */
static Boolean pk_second_pass;
@@ -153,8 +153,8 @@ struct lsr {
struct findrec *frecp; /* which search type? */
short seqno; /* which ls-R invocation we are using */
short keylen; /* length of key */
- _Xconst char *key;
- _Xconst char *value;
+ const char *key;
+ const char *value;
};
static struct lsr *lsrtab[1024]; /* hash table */
@@ -194,10 +194,10 @@ expandline(n)
static unsigned int
prehash(str, len)
- _Xconst char *str;
+ const char *str;
size_t len;
{
- _Xconst char *p;
+ const char *p;
unsigned int hash;
hash = 0;
@@ -213,15 +213,15 @@ prehash(str, len)
* Look up the home directory.
*/
-static _Xconst struct passwd *
+static const struct passwd *
ff_getpw(pp, p_end)
- _Xconst char **pp;
- _Xconst char *p_end;
+ const char **pp;
+ const char *p_end;
{
- _Xconst char *p = *pp;
- _Xconst char *p1;
+ const char *p = *pp;
+ const char *p1;
int len;
- _Xconst struct passwd *pw;
+ const struct passwd *pw;
++p; /* skip the tilde */
p1 = p;
@@ -246,11 +246,11 @@ ff_getpw(pp, p_end)
static void
gethome(pp, p_end, homepp)
- _Xconst char **pp;
- _Xconst char *p_end;
- _Xconst char **homepp;
+ const char **pp;
+ const char *p_end;
+ const char **homepp;
{
- _Xconst struct passwd *pw;
+ const struct passwd *pw;
pw = ff_getpw(pp, p_end);
if (pw != NULL)
@@ -265,13 +265,13 @@ gethome(pp, p_end, homepp)
* or to end of string if none. Never return NULL.
*/
-static _Xconst char *
+static const char *
sep_index(p)
- _Xconst char *p;
+ const char *p;
{
int len;
- _Xconst char *p1;
- _Xconst char *p2;
+ const char *p1;
+ const char *p2;
len = strlen(p);
p1 = memchr(p, ':', len);
@@ -289,15 +289,15 @@ struct envrec *envtab[128]; /* hash table for local environment */
struct cfglist { /* linked list of config files we've done */
struct cfglist *next;
- _Xconst char *value;
+ const char *value;
};
struct cfglist *cfghead; /* head of that linked list */
/* global stuff for the fancy loop over config files. */
-static _Xconst struct envrec *lastvar = NULL;
-static _Xconst char *deflt = DEFAULT_CONFIG_PATH;
+static const struct envrec *lastvar = NULL;
+static const char *deflt = DEFAULT_CONFIG_PATH;
/*
* Get the node containing a local environment variable.
@@ -305,7 +305,7 @@ static _Xconst char *deflt = DEFAULT_CONFIG_PATH;
struct envrec *
ffgetenv(key)
- _Xconst char *key;
+ const char *key;
{
int keylen;
struct envrec *envp;
@@ -334,14 +334,14 @@ ffgetenv(key)
static void
ffputenv(key, keylen, value, flag)
- _Xconst char *key;
+ const char *key;
int keylen;
- _Xconst char *value;
+ const char *value;
Boolean flag;
{
struct envrec **envpp;
struct envrec *envp;
- _Xconst char *key1;
+ const char *key1;
envpp = envtab + prehash(key, keylen) % XtNumber(envtab);
++keylen;
@@ -383,7 +383,7 @@ ffputenv(key, keylen, value, flag)
#ifdef SELFAUTO
/* contains values of SELFAUTOLOC, SELFAUTODIR, and SELFAUTOPARENT */
-static _Xconst char *selfautostr = NULL;
+static const char *selfautostr = NULL;
static int selfautoloclen;
static int selfautodirlen;
static int selfautoparentlen;
@@ -464,9 +464,9 @@ static void
selfautoinit(pos)
int pos;
{
- _Xconst char *p;
+ const char *p;
int len;
- _Xconst char *path;
+ const char *path;
int argv0len;
int pos1;
struct stat statbuf;
@@ -540,12 +540,12 @@ static int envexpand();
static int
dollarsub(key, keylen, pos, percent)
- _Xconst char *key;
+ const char *key;
int keylen;
int pos;
char percent;
{
- _Xconst char *env_value;
+ const char *env_value;
struct envrec *env_rec;
#ifdef SELFAUTO
@@ -597,17 +597,17 @@ dollarsub(key, keylen, pos, percent)
static int
envexpand(p, p_end, pos, percent)
- _Xconst char *p;
- _Xconst char *p_end;
+ const char *p;
+ const char *p_end;
int pos;
char percent;
{
- _Xconst char *p1;
- _Xconst char *p2;
+ const char *p1;
+ const char *p2;
for (;;) { /* transfer this to ffline */
for (p2 = p;;) { /* find the next $ */
- _Xconst char *p3;
+ const char *p3;
p1 = memchr(p2, '$', p_end - p);
if (p1 == NULL) {
@@ -660,18 +660,18 @@ envexpand(p, p_end, pos, percent)
static int
form_path_part(pathpp, percent)
- _Xconst char **pathpp;
+ const char **pathpp;
char percent;
{
- _Xconst char *path;
- _Xconst char *p;
- _Xconst char *p_end;
+ const char *path;
+ const char *p;
+ const char *p_end;
int pos;
path = *pathpp;
p_end = p;
for (p = path;;) { /* find end of path part */
- _Xconst char *p1;
+ const char *p1;
p_end = sep_index(p);
if (*p_end == '\0')
@@ -741,7 +741,7 @@ read_config_file(f)
keyend = p;
while (*p == ' ' || *p == '\t') ++p;
if (*p == '.') { /* if qualified by a program name */
- _Xconst char *progbegin;
+ const char *progbegin;
++p;
while (*p == ' ' || *p == '\t') ++p;
@@ -789,7 +789,7 @@ read_config_file(f)
static void
rd_cfg(paths)
- _Xconst char *paths;
+ const char *paths;
{
int pos;
FILE *f;
@@ -798,7 +798,7 @@ rd_cfg(paths)
for (;;) {
if (*paths == '\0' || IS_SEP(*paths)) { /* do the default */
if (deflt != NULL) {
- _Xconst char *d1 = deflt;
+ const char *d1 = deflt;
deflt = NULL;
rd_cfg(d1); /* do the compiled-in default */
@@ -807,7 +807,7 @@ rd_cfg(paths)
else {
pos = form_path_part(&paths, '\0');
if (ffline[0] == '~') {
- _Xconst char *home = NULL;
+ const char *home = NULL;
char *ffp = ffline;
gethome(&ffp, ffline + pos, &home);
@@ -890,7 +890,7 @@ rd_cfg(paths)
void
readconfig()
{
- _Xconst char *paths;
+ const char *paths;
paths = getenv("TEXMFCNF");
if (paths == NULL) { /* if no env variable set */
@@ -910,16 +910,16 @@ readconfig()
static void
atomize(p0, sp)
- _Xconst char *p0;
+ const char *p0;
struct steprec *sp;
{
struct atomrec *head;
struct atomrec **linkpp;
int flags; /* F_SLASH_SLASH and F_WILD */
Boolean percent_s;
- _Xconst char *p = p0;
- _Xconst char *p1;
- _Xconst char *p2;
+ const char *p = p0;
+ const char *p1;
+ const char *p2;
/*
* First check the string for braces.
@@ -1025,10 +1025,10 @@ atomize(p0, sp)
* It also does much of the work in ff_prescan().
*/
-static _Xconst char *
+static const char *
prescan2(sp, p, skip)
struct steprec *sp;
- _Xconst char *p;
+ const char *p;
Boolean skip; /* true if initial / does not mean // */
{
int flags;
@@ -1113,14 +1113,14 @@ prescan2(sp, p, skip)
static void
dobrace(p, pos0, level, skip)
- _Xconst char *p;
+ const char *p;
unsigned pos0;
int level;
Boolean skip; /* true if initial / does not mean // */
{
int lev;
int level1;
- _Xconst char *p1;
+ const char *p1;
unsigned pos;
for (;;) { /* loop over the alternatives */
@@ -1252,7 +1252,7 @@ static struct steprec *
scan_pct_s()
{
struct steprec **headpp;
- _Xconst char *p;
+ const char *p;
struct steprec *sp;
if (lrec.v.pct_s_head != NULL) /* if we've already done this */
@@ -1284,7 +1284,7 @@ scan_pct_s()
static void
atomize_pct_s()
{
- _Xconst struct atomrec **app;
+ const struct atomrec **app;
struct steprec *sp;
(void) scan_pct_s(); /* make sure the count is valid */
@@ -1311,16 +1311,16 @@ atomize_pct_s()
static void /* here's a small subroutine */
add_to_texmf_list(pp)
- _Xconst char **pp;
+ const char **pp;
{
static struct texmfrec **tpp = &texmfhead;
struct texmfrec *tp;
- _Xconst char *p;
- _Xconst char *p_end;
- _Xconst char *home = NULL;
+ const char *p;
+ const char *p_end;
+ const char *home = NULL;
int flags = 0;
#if CFGFILE
- _Xconst char *p0;
+ const char *p0;
int pos;
#endif
@@ -1371,11 +1371,11 @@ add_to_texmf_list(pp)
static void
intexmf(env_value, env_ptr, dflt)
- _Xconst char *env_value;
- _Xconst struct envrec *env_ptr;
- _Xconst char *dflt;
+ const char *env_value;
+ const struct envrec *env_ptr;
+ const char *dflt;
{
- _Xconst char *path;
+ const char *path;
Boolean did_next_default;
if (env_value != NULL) {
@@ -1418,10 +1418,10 @@ static void
init_texmf()
{
#if !CFGFILE
- _Xconst char *texmf;
- _Xconst char *texmf2;
+ const char *texmf;
+ const char *texmf2;
#endif
- _Xconst struct texmfrec *tp;
+ const struct texmfrec *tp;
unsigned n;
if (texmfhead != NULL)
@@ -1475,9 +1475,9 @@ init_texmf()
* We look for // or wild cards or {}.
*/
-static _Xconst char *
+static const char *
ff_prescan(p)
- _Xconst char *p;
+ const char *p;
{
struct steprec *sp;
@@ -1503,14 +1503,14 @@ ff_prescan(p)
static unsigned
xlat(stat_in, stat_ret, pos0, p, lastp)
- _Xconst struct statrec *stat_in;
+ const struct statrec *stat_in;
struct statrec *stat_ret;
unsigned pos0;
- _Xconst char *p;
- _Xconst char *lastp;
+ const char *p;
+ const char *lastp;
{
struct statrec status;
- _Xconst char *q;
+ const char *q;
int l;
status.pos = pos0;
@@ -1531,7 +1531,7 @@ xlat(stat_in, stat_ret, pos0, p, lastp)
if (p >= lastp) break;
q = index(lrec.fF_etc, *p);
if (q != NULL) {
- _Xconst char *str = fF_values[q - lrec.fF_etc];
+ const char *str = fF_values[q - lrec.fF_etc];
if (str != NULL) {
l = strlen(str);
@@ -1640,9 +1640,9 @@ lsrgetline(f, pos0)
static void
lsrput(key, keylen, value)
- _Xconst char *key;
+ const char *key;
unsigned keylen;
- _Xconst char *value;
+ const char *value;
{
struct lsr **lpp;
struct lsr *lp;
@@ -1678,7 +1678,7 @@ static void
init_quick_find(root, pos, atom, pos1)
struct rootrec *root; /* pointer to the governing rootrec */
unsigned pos; /* position of %[qQ] in ffline[] */
- _Xconst struct atomrec *atom; /* the beginning of the atomlist */
+ const struct atomrec *atom; /* the beginning of the atomlist */
unsigned pos1; /* next free byte in ffline[] */
{
#define LS_R_LEN 5 /* length of the string "ls-R\0" */
@@ -1689,11 +1689,11 @@ init_quick_find(root, pos, atom, pos1)
unsigned pos2; /* end + 1 of the decoded thing */
int nslashes; /* how many slashes in bbbcccddd */
FILE *f; /* ls-R file */
- _Xconst char *fullpat; /* fields in *root */
- _Xconst char *keypat; /* " */
- _Xconst char *keypat_end; /* " */
- _Xconst char *fullpat_end; /* " */
- _Xconst char *keypat_a; /* position of end+1 of restricted
+ const char *fullpat; /* fields in *root */
+ const char *keypat; /* " */
+ const char *keypat_end; /* " */
+ const char *fullpat_end; /* " */
+ const char *keypat_a; /* position of end+1 of restricted
* initial fixed part */
int retval; /* return value of lsrgetline */
@@ -1721,14 +1721,14 @@ init_quick_find(root, pos, atom, pos1)
nslashes = 0;
for (;;) {
- _Xconst char *p;
+ const char *p;
keypos_a = pos2;
/* translate the atom, leaving %f and maybe %d alone */
for (p = atom->p; p < atom->p_end; ++p) {
if (p >= atom->p_end) break;
if (*p == '%') {
- _Xconst char *q;
+ const char *q;
++p;
if (p >= atom->p_end) break;
@@ -1741,7 +1741,7 @@ init_quick_find(root, pos, atom, pos1)
keyend = pos2 + 2;
}
else {
- _Xconst char *str = fF_values[q - lrec.fF_etc];
+ const char *str = fF_values[q - lrec.fF_etc];
if (str != NULL) {
int l = strlen(str);
@@ -1845,9 +1845,9 @@ init_quick_find(root, pos, atom, pos1)
for (;;) {
int i;
- _Xconst char *p;
- _Xconst char *p_begin;
- _Xconst char *p_end;
+ const char *p;
+ const char *p_begin;
+ const char *p_end;
unsigned pos3;
unsigned pos4;
unsigned pos5;
@@ -1949,20 +1949,20 @@ init_quick_find(root, pos, atom, pos1)
static Boolean
wildmatch(pat, pat_end, candidate, allowvar)
- _Xconst char *pat;
- _Xconst char *pat_end;
- _Xconst char *candidate;
+ const char *pat;
+ const char *pat_end;
+ const char *candidate;
int allowvar; /* How many of %f, %F, %d, ... to */
/* treat as '*' */
{
- _Xconst char *p;
- _Xconst char *q = candidate;
+ const char *p;
+ const char *q = candidate;
for (p = pat; p < pat_end; ++p)
switch (*p) {
case '%': {
- _Xconst char *q1;
+ const char *q1;
if (p + 1 >= pat_end) continue;
++p;
@@ -1981,7 +1981,7 @@ wildmatch(pat, pat_end, candidate, allowvar)
return False;
}
else {
- _Xconst char *str = fF_values[q1 - lrec.fF_etc];
+ const char *str = fF_values[q1 - lrec.fF_etc];
int l;
if (str == NULL) str = "";
@@ -1994,7 +1994,7 @@ wildmatch(pat, pat_end, candidate, allowvar)
}
case '*': {
- _Xconst char *q1;
+ const char *q1;
for (q1 = q + strlen(q); q1 >= q; --q1)
if (wildmatch(p + 1, pat_end, q1, allowvar))
@@ -2081,7 +2081,7 @@ static void
filltree(pos, treepp, atom, slashslash)
unsigned pos;
struct treerec **treepp;
- _Xconst struct atomrec *atom;
+ const struct atomrec *atom;
Boolean slashslash;
{
DIR *f;
@@ -2191,8 +2191,8 @@ filltree(pos, treepp, atom, slashslash)
static void
do_tree_search(treepp, atom, goback, pos, flags)
struct treerec **treepp;
- _Xconst struct atomrec *atom;
- _Xconst struct atomrec *goback;
+ const struct atomrec *atom;
+ const struct atomrec *goback;
unsigned pos;
int flags;
{
@@ -2293,9 +2293,9 @@ do_tree_search(treepp, atom, goback, pos, flags)
static void
begin_tree_search(status, oneatom, twoatom)
- _Xconst struct statrec *status;
- _Xconst struct atomrec *oneatom; /* initial atom */
- _Xconst struct atomrec *twoatom; /* if F_PCT_S set */
+ const struct statrec *status;
+ const struct atomrec *oneatom; /* initial atom */
+ const struct atomrec *twoatom; /* if F_PCT_S set */
{
struct treerec **tpp;
@@ -2312,7 +2312,7 @@ begin_tree_search(status, oneatom, twoatom)
#if 0
{
- _Xconst struct atomrec *atom;
+ const struct atomrec *atom;
puts("begin_tree_search():");
fwrite(ffline, 1, status->pos, stdout);
@@ -2343,14 +2343,14 @@ begin_tree_search(status, oneatom, twoatom)
struct vrootrec {
struct rootrec *next; /* link to next in hash chain */
struct treerec *tree; /* the tree */
- _Xconst char *path;
+ const char *path;
int seqno;
};
struct rtab {
struct rtab *next;
int seqno;
int len;
- _Xconst char *tag;
+ const char *tag;
struct vrootrec *r;
};
static struct rtab *varroot[32];
@@ -2457,8 +2457,8 @@ begin_tree_search(status, oneatom, twoatom)
static void
dostep(sp, stat0)
- _Xconst struct steprec *sp;
- _Xconst struct statrec *stat0;
+ const struct steprec *sp;
+ const struct statrec *stat0;
{
struct statrec status;
@@ -2503,7 +2503,7 @@ static void
fixbegin(sp)
struct steprec *sp;
{
- _Xconst char *p = sp->str;
+ const char *p = sp->str;
/*
* Initial !!.
@@ -2546,19 +2546,19 @@ fixbegin(sp)
* pathpart() - Handle one (colon-separated) part of the search path.
*/
-static _Xconst char *
+static const char *
pathpart(p)
- _Xconst char *p;
+ const char *p;
{
struct steprec *sp;
- static _Xconst struct statrec stat_ini = {0, 0, '\0', 0};
+ static const struct statrec stat_ini = {0, 0, '\0', 0};
struct statrec status;
sp = *steppp;
if (sp == NULL) { /* do prescanning (lazy evaluation) */
- _Xconst char *p_end;
+ const char *p_end;
#if CFGFILE
- _Xconst char *p1;
+ const char *p1;
int pos;
#endif
@@ -2670,10 +2670,10 @@ pathpart(p)
static void
ffrecurse(env_ptr, dflt)
- _Xconst struct envrec *env_ptr;
- _Xconst char *dflt;
+ const struct envrec *env_ptr;
+ const char *dflt;
{
- _Xconst char *p;
+ const char *p;
Boolean did_next_default;
if (env_ptr != NULL) {
@@ -2715,10 +2715,10 @@ ffrecurse(env_ptr, dflt)
static void
dumpsteps(sp, indent)
- _Xconst struct steprec *sp;
+ const struct steprec *sp;
int indent;
{
- _Xconst struct steprec *sp1;
+ const struct steprec *sp1;
int i;
while (sp != NULL) {
@@ -2750,9 +2750,9 @@ dumpsteps(sp, indent)
FILE *
filefind(name, srchtype, path_ret)
- _Xconst char *name; /* name of the font or file */
+ const char *name; /* name of the font or file */
struct findrec *srchtype; /* what type of search to perform */
- _Xconst char **path_ret; /* put the name of the file here */
+ const char **path_ret; /* put the name of the file here */
{
lrec = *srchtype;
fF_values[0] = fF_values[1] = name;
@@ -2761,7 +2761,7 @@ filefind(name, srchtype, path_ret)
if (*name == '/' || *name == '~') { /* if absolute path */
unsigned pos;
unsigned pos0 = 0;
- _Xconst struct passwd *pw = NULL;
+ const struct passwd *pw = NULL;
if (*name == '~')
pw = ff_getpw(&name, name + strlen(name));
@@ -2792,7 +2792,7 @@ filefind(name, srchtype, path_ret)
#endif
}
else {
- _Xconst char *p;
+ const char *p;
steppp = &lrec.v.stephead;
frecp = srchtype;
@@ -2827,7 +2827,7 @@ filefind(name, srchtype, path_ret)
if (*p == '\0' || *p == ':') {
/* bring in the default path */
if (lrec.path2 != NULL) {
- _Xconst char *p1 = lrec.path2;
+ const char *p1 = lrec.path2;
for (;;) {
if (*p1 == '\0') break;
diff --git a/filefind.h b/filefind.h
@@ -52,31 +52,31 @@ typedef char Boolean;
*/
struct findrec {
- _Xconst char *path1;
+ const char *path1;
#if CFGFILE
- _Xconst struct envrec *envptr;
+ const struct envrec *envptr;
#endif
- _Xconst char *path2;
- _Xconst char *type;
- _Xconst char *fF_etc;
+ const char *path2;
+ const char *type;
+ const char *fF_etc;
char x_var_char;
int n_var_opts;
- _Xconst char *no_f_str;
- _Xconst char *no_f_str_end;
- _Xconst char *abs_str;
+ const char *no_f_str;
+ const char *no_f_str_end;
+ const char *abs_str;
#if USE_GF
int no_f_str_flags;
int abs_str_flags;
char pk_opt_char;
- _Xconst char **pk_gf_addr;
+ const char **pk_gf_addr;
#endif
- _Xconst char *pct_s_str;
+ const char *pct_s_str;
struct {
struct steprec *stephead;
struct steprec *pct_s_head;
int pct_s_count;
- _Xconst struct atomrec **pct_s_atom;
+ const struct atomrec **pct_s_atom;
struct rootrec *rootp;
} v;
};
@@ -85,8 +85,8 @@ struct findrec {
* And now, the star of our show.
*/
-extern FILE *filefind ARGS((_Xconst char *, struct findrec *,
- _Xconst char **));
+extern FILE *filefind ARGS((const char *, struct findrec *,
+ const char **));
/*
* Here are the meanings of the various fields in struct findrec:
@@ -195,7 +195,7 @@ extern FILE *filefind ARGS((_Xconst char *, struct findrec *,
#define MAX_N_OPTS 6
#endif
-extern _Xconst char *fF_values[MAX_N_OPTS];
+extern const char *fF_values[MAX_N_OPTS];
/*
* Additional data structures. These are included because they are
@@ -213,13 +213,13 @@ extern _Xconst char *fF_values[MAX_N_OPTS];
struct steprec {
struct steprec *next; /* link to next record in chain */
- _Xconst char *str; /* the string we're now looking at */
- _Xconst char *strend;
+ const char *str; /* the string we're now looking at */
+ const char *strend;
int flags; /* not cumulative */
struct atomrec *atom;
struct steprec *nextstep;
- _Xconst char *nextpart; /* only for the main linked list */
- _Xconst char *home; /* ~ expansion result (main list only)*/
+ const char *nextpart; /* only for the main linked list */
+ const char *home; /* ~ expansion result (main list only)*/
};
/*
@@ -228,8 +228,8 @@ struct steprec {
struct atomrec {
struct atomrec *next;
- _Xconst char *p; /* first char. of dir. name */
- _Xconst char *p_end; /* last + 1 char. */
+ const char *p; /* first char. of dir. name */
+ const char *p_end; /* last + 1 char. */
int flags; /* F_PCT_S or F_SLASH_SLASH (so far) */
};
@@ -241,10 +241,10 @@ struct rootrec {
struct rootrec *next; /* link to next in list */
struct treerec *tree; /* the tree */
int flags; /* F_QUICKFIND and F_QUICKONLY */
- _Xconst char *fullpat; /* xlat pattern for use with ls-R */
- _Xconst char *fullpat_end;
- _Xconst char *keypat; /* key for ls-R database search */
- _Xconst char *keypat_end;
+ const char *fullpat; /* xlat pattern for use with ls-R */
+ const char *fullpat_end;
+ const char *keypat; /* key for ls-R database search */
+ const char *keypat_end;
};
/*
@@ -252,7 +252,7 @@ struct rootrec {
*/
struct treerec {
- _Xconst char *dirname;
+ const char *dirname;
struct treerec *next; /* link to next sibling */
struct treerec *child; /* link to subdirectories */
Boolean tried_already;
@@ -265,9 +265,9 @@ struct treerec {
struct envrec {
struct envrec *next;
- _Xconst char *key;
- _Xconst char *value;
+ const char *key;
+ const char *value;
Boolean flag;
};
-extern struct envrec *ffgetenv ARGS((_Xconst char *));
+extern struct envrec *ffgetenv ARGS((const char *));
diff --git a/font-open.c b/font-open.c
@@ -35,7 +35,7 @@ NOTE:
#ifdef X_NOT_STDC_ENV
extern int errno;
-extern char *getenv ARGS((_Xconst char *));
+extern char *getenv ARGS((const char *));
#endif
/*
@@ -59,14 +59,14 @@ extern char *getenv ARGS((_Xconst char *));
#endif
#ifdef MKTEXPK
-static _Xconst char *makepkcmd = NULL;
+static const char *makepkcmd = NULL;
#endif
/*
* Information on how to search for pk and gf files.
*/
-static _Xconst char no_f_str_pkgf[] = DEFAULT_TAIL;
+static const char no_f_str_pkgf[] = DEFAULT_TAIL;
static struct findrec search_pkgf = {
/* path1 */ NULL,
@@ -99,7 +99,7 @@ static struct findrec search_pkgf = {
#ifdef DOSNAMES
-static _Xconst char no_f_str_dos[] = "/dpi%d/%f.%p";
+static const char no_f_str_dos[] = "/dpi%d/%f.%p";
static struct findrec search_pkgf_dos = {
/* path1 */ NULL,
@@ -135,7 +135,7 @@ static struct findrec search_pkgf_dos = {
* Information on how to search for vf files.
*/
-static _Xconst char no_f_str_vf[] = DEFAULT_VF_TAIL;
+static const char no_f_str_vf[] = DEFAULT_VF_TAIL;
static struct findrec search_vf = {
/* path1 */ NULL,
@@ -182,7 +182,7 @@ static double magsteps[10] = {1.0, 1.2, 1.44, 1.728, 2.0736,
* Information on how to search for dvips configuration files.
*/
-static _Xconst char no_f_str_dvips_cf[] = "/%f";
+static const char no_f_str_dvips_cf[] = "/%f";
static struct findrec search_dvips_cf = {
/* path1 */ NULL,
@@ -217,7 +217,7 @@ static struct findrec search_dvips_cf = {
* Information on how to search for (dvips-style) map files.
*/
-static _Xconst char no_f_str_fontmap[] = "/%f";
+static const char no_f_str_fontmap[] = "/%f";
static struct findrec search_fontmap = {
/* path1 */ NULL,
@@ -252,7 +252,7 @@ static struct findrec search_fontmap = {
* Information on how to search for font encoding files.
*/
-static _Xconst char no_f_str_enc[] = "/%f";
+static const char no_f_str_enc[] = "/%f";
static struct findrec search_enc = {
/* path1 */ no_f_str_enc, /* flag value: uninitialized */
@@ -287,7 +287,7 @@ static struct findrec search_enc = {
* Information on how to search for Type 1 fonts.
*/
-static _Xconst char no_f_str_type1[] = "/%f";
+static const char no_f_str_type1[] = "/%f";
static struct findrec search_type1 = {
/* path1 */ no_f_str_type1, /* flag value: uninitialized */
@@ -323,9 +323,9 @@ static struct findrec search_type1 = {
static int
atosize(p)
- _Xconst char *p;
+ const char *p;
{
- _Xconst char *q;
+ const char *q;
Boolean minus;
double factor;
@@ -381,7 +381,7 @@ get_sizes(size_list, spp)
struct p_list { /* list of map file names */
struct p_list *next;
- _Xconst char *value;
+ const char *value;
};
/* Initialize this list to "psfonts.map". */
@@ -488,14 +488,14 @@ static struct avl_t1 *t1_head = NULL;
static struct avl_t1 *
dvips_parse(line)
- _Xconst char *line;
+ const char *line;
{
- _Xconst char *w1p, *encp, *pfp, *qp;
+ const char *w1p, *encp, *pfp, *qp;
size_t w1l, encl, pfl, ql;
- _Xconst char *w2p;
+ const char *w2p;
size_t w2l;
- _Xconst char *p, *p0;
- _Xconst char *err;
+ const char *p, *p0;
+ const char *err;
struct avl_t1 *t1p;
char *q;
@@ -508,7 +508,7 @@ dvips_parse(line)
break;
if (*p == '"') { /* quoted string */
- _Xconst char *p_end;
+ const char *p_end;
p0 = p + 1;
p_end = p0 + strlen(p0);
@@ -650,7 +650,7 @@ dvips_parse(line)
q += ql;
}
else { /* multiple quoted strings; rescan to get them */
- _Xconst char *p_end;
+ const char *p_end;
p = line;
p_end = p + strlen(p);
@@ -697,20 +697,20 @@ struct avl_gs { /* structure for gs font information */
struct gs_list { /* list of Fontmap entries for this font name */
struct gs_list *next;
- _Xconst char value[0];
+ const char value[0];
};
static struct avl_gs *gs_head = NULL;
typedef void (*gs_path_proc) ARGS((FILE *));
-static _Xconst char *env_gs_lib;
+static const char *env_gs_lib;
static FILE *
gs_try_fopen(str, len, name)
- _Xconst char *str;
+ const char *str;
unsigned int len;
- _Xconst char *name;
+ const char *name;
{
unsigned int namelen = strlen(name) + 1;
FILE *f;
@@ -731,13 +731,13 @@ gs_try_fopen(str, len, name)
static FILE *
gs_path_fopen(name, proc)
- _Xconst char *name;
+ const char *name;
gs_path_proc proc;
{
- _Xconst char *str1 = env_gs_lib;
- _Xconst char *str2 = DEFAULT_GS_LIB_PATH;
- _Xconst char *str1_end, *str2_end;
- _Xconst char *p1, *p2;
+ const char *str1 = env_gs_lib;
+ const char *str2 = DEFAULT_GS_LIB_PATH;
+ const char *str1_end, *str2_end;
+ const char *p1, *p2;
FILE *f;
if (str1 == NULL) {
@@ -793,8 +793,8 @@ gs_path_fopen(name, proc)
static FILE *
lookup_gs_font(font, path_ret)
- _Xconst char *font;
- _Xconst char **path_ret;
+ const char *font;
+ const char **path_ret;
{
struct avl_gs *gsfp;
int font_len;
@@ -879,8 +879,8 @@ lookup_gs_font(font, path_ret)
struct gsfile {
FILE *f;
unsigned char *buffer;
- _Xconst unsigned char *bufpos;
- _Xconst unsigned char *buf_end;
+ const unsigned char *bufpos;
+ const unsigned char *buf_end;
};
static Boolean
@@ -915,7 +915,7 @@ static unsigned char gs_ctype[256];
static void
init_gs_ctype()
{
- _Xconst char *p;
+ const char *p;
for (p = " \t\f\n\r";; ++p) {
gs_ctype[(unsigned char) *p] = 1; /* white space */
@@ -941,7 +941,7 @@ get_gs_character(gsfp)
/* Check for comments */
if (c == '%') {
for (;;) {
- _Xconst unsigned char *p1, *p2;
+ const unsigned char *p1, *p2;
p1 = memchr(gsfp->bufpos, '\n',
gsfp->buf_end - gsfp->bufpos);
@@ -972,11 +972,11 @@ get_gs_token(gsfp, pos, pos_ret, file_type)
struct gsfile *gsfp;
unsigned int pos;
unsigned int *pos_ret;
- _Xconst char *file_type;
+ const char *file_type;
{
unsigned char gs_t_type;
unsigned char c;
- _Xconst unsigned char *p0;
+ const unsigned char *p0;
unsigned int pos0;
unsigned int depth;
@@ -1019,7 +1019,7 @@ get_gs_token(gsfp, pos, pos_ret, file_type)
case 3: /* left parenthesis */
depth = 1;
for (;;) {
- _Xconst unsigned char *p1, *p2, *p3;
+ const unsigned char *p1, *p2, *p3;
if (gsfp->bufpos >= gsfp->buf_end) {
unsigned int len = gsfp->bufpos - p0;
@@ -1250,7 +1250,7 @@ read_gs_fontmaps()
static struct avl_t1 *
pre_lookup_t1_font(fontname)
- _Xconst char *fontname;
+ const char *fontname;
{
struct avl_t1 *t1p;
size_t len;
@@ -1360,7 +1360,7 @@ lookup_t1_font(fontp)
FILE *
open_t1_font(t1p, path_ret)
struct avl_t1 *t1p;
- _Xconst char **path_ret;
+ const char **path_ret;
{
FILE *f;
@@ -1448,7 +1448,7 @@ read_encoding(encp)
unsigned char ttype;
unsigned int pos1, pos2;
unsigned int identindex[256];
- _Xconst char *str;
+ const char *str;
unsigned int i;
if (debug & DBG_OPEN)
@@ -1553,7 +1553,7 @@ init_font_open()
char *p;
#if FREETYPE || PS
FILE *f;
- _Xconst char *dvipsrc;
+ const char *dvipsrc;
#endif
Sprintf(bdpi_string, "%d", pixels_per_inch);
@@ -1765,9 +1765,9 @@ init_font_open()
static FILE *
try_size(font, dpi, ret_path)
- _Xconst char *font;
+ const char *font;
int dpi;
- _Xconst char **ret_path;
+ const char **ret_path;
{
#ifdef DOSNAMES
FILE *retval;
@@ -1859,7 +1859,7 @@ try_size(font, dpi, ret_path)
static unsigned int
ffmemcpy(pos, src, len)
unsigned int pos;
- _Xconst char *src;
+ const char *src;
unsigned int len;
{
if (pos + len >= ffline_len)
@@ -1875,7 +1875,7 @@ ffmemcpy(pos, src, len)
static unsigned int
ffstrcpy(pos, str)
unsigned int pos;
- _Xconst char *str;
+ const char *str;
{
return ffmemcpy(pos, str, strlen(str));
}
@@ -1970,19 +1970,19 @@ mkpk_get_result()
static FILE *
makefont(font, dpi, name, magstepval)
- _Xconst char *font;
+ const char *font;
int dpi;
- _Xconst char **name;
+ const char **name;
int magstepval;
{
int pipefds[2];
Boolean used_fontname = False;
Boolean used_mfmode = False;
int redirect_to = 1;
- _Xconst char *p;
+ const char *p;
unsigned int argc;
unsigned int pos_end, pos1, destpos;
- _Xconst char *actual_command;
+ const char *actual_command;
char **argv;
unsigned int pos;
static Boolean did_putenv = False;
@@ -2304,12 +2304,12 @@ makefont(font, dpi, name, magstepval)
static Boolean
PRE_FONT_OPEN(fontp, fontname, fdpi, magstepval, name_ret, dpi_ret)
struct font *fontp;
- _Xconst char *fontname;
+ const char *fontname;
double fdpi;
#if MKTEXPK
int magstepval;
#endif
- _Xconst char **name_ret;
+ const char **name_ret;
int *dpi_ret;
{
FILE *f;
@@ -2326,7 +2326,7 @@ PRE_FONT_OPEN(fontp, fontname, fdpi, magstepval, name_ret, dpi_ret)
if (resource.freetype) {
struct avl_t1 *t1p = lookup_t1_font(fontp);
- _Xconst char *path;
+ const char *path;
if (t1p != NULL) { /* if font found */
if (debug & DBG_OPEN)
diff --git a/ft.c b/ft.c
@@ -42,7 +42,7 @@ static struct avl_enc *enc_head = NULL;
/* From xc/lib/X11/PutImage.c */
#if !WORDS_BIGENDIAN
-static _Xconst unsigned char reverse_byte[0x100] = {
+static const unsigned char reverse_byte[0x100] = {
0x00, 0x80, 0x40, 0xc0, 0x20, 0xa0, 0x60, 0xe0,
0x10, 0x90, 0x50, 0xd0, 0x30, 0xb0, 0x70, 0xf0,
0x08, 0x88, 0x48, 0xc8, 0x28, 0xa8, 0x68, 0xe8,
@@ -206,7 +206,7 @@ read_ft_char(fontp, ch)
static Boolean
set_transform(ftp, str)
struct ftfont *ftp;
- _Xconst char *str;
+ const char *str;
{
double x = 1.0;
double y = 0.0;
@@ -288,7 +288,7 @@ load_ft_font(fontp)
FT_Face face;
FT_Size size;
int err;
- _Xconst char *path;
+ const char *path;
FILE *f;
ftp = fontp->ft;
@@ -446,7 +446,7 @@ load_ft_font(fontp)
if (encp == NULL)
ci = FT_Get_Char_Index(face, i);
else {
- _Xconst char *glyphname = encp->vec[i];
+ const char *glyphname = encp->vec[i];
if (glyphname == NULL)
ci = 0;
diff --git a/popups.c b/popups.c
@@ -167,10 +167,10 @@ static int uintlen(i)
static int
vnprintf(format, args)
- _Xconst char *format;
+ const char *format;
va_list args;
{
- _Xconst char *p, *p_end, *q;
+ const char *p, *p_end, *q;
int len;
p = format;
@@ -196,7 +196,7 @@ vnprintf(format, args)
}
break;
case 's':
- len += strlen(va_arg(args, _Xconst char *));
+ len += strlen(va_arg(args, const char *));
break;
default:
oops("Invalid designator `%c' in format string \"%s\"\n",
@@ -212,7 +212,7 @@ vnprintf(format, args)
static int
#if NeedVarargsPrototypes
-nprintf(_Xconst char *format, ...)
+nprintf(const char *format, ...)
#else
/* VARARGS */
nprintf(va_alist)
@@ -220,7 +220,7 @@ nprintf(va_alist)
#endif
{
#if !NeedVarargsPrototypes
- _Xconst char *format;
+ const char *format;
#endif
va_list args;
int len;
@@ -229,7 +229,7 @@ nprintf(va_alist)
va_start(args, format);
#else
va_start(args);
- format = va_arg(args, _Xconst char *);
+ format = va_arg(args, const char *);
#endif
len = vnprintf(format, args);
@@ -247,7 +247,7 @@ nprintf(va_alist)
static char *
vmprintf(format, args)
- _Xconst char *format;
+ const char *format;
va_list args;
{
#if !HAVE_VASPRINTF
@@ -278,7 +278,7 @@ vmprintf(format, args)
static char *
#if NeedVarargsPrototypes
-mprintf(_Xconst char *format, ...)
+mprintf(const char *format, ...)
#else
/* VARARGS */
mprintf(va_alist)
@@ -286,7 +286,7 @@ mprintf(va_alist)
#endif
{
#if !NeedVarargsPrototypes
- _Xconst char *format;
+ const char *format;
#endif
va_list args;
char *result;
@@ -295,7 +295,7 @@ mprintf(va_alist)
va_start(args, format);
#else
va_start(args);
- format = va_arg(args, _Xconst char *);
+ format = va_arg(args, const char *);
#endif
result = vmprintf(format, args);
@@ -396,7 +396,7 @@ handle_popup_events(widget, rec, ev, cont)
void
simple_popup(rec, message, callback)
struct status_popup *rec;
- _Xconst char *message;
+ const char *message;
XtCallbackProc callback;
{
Position x, y;
@@ -505,8 +505,8 @@ do_popup(shell)
Widget
warning_popup(message, button_name, callback)
- _Xconst char *message;
- _Xconst char *button_name;
+ const char *message;
+ const char *button_name;
XtCallbackProc callback;
{
Widget shell, form, label, button;
@@ -571,12 +571,12 @@ warning_popup(message, button_name, callback)
Widget
#if NeedVarargsPrototypes
-warning_popup_long(_Xconst char *format,
- _Xconst char *button_name, XtCallbackProc callback, ...)
+warning_popup_long(const char *format,
+ const char *button_name, XtCallbackProc callback, ...)
#else /* ! NeedVarargsPrototypes */
warning_popup_long(format, button_name, callback, va_alist)
- _Xconst char *format;
- _Xconst char *button_name;
+ const char *format;
+ const char *button_name;
XtCallbackProc callback;
va_dcl
#endif /* ! NeedVarargsPrototypes */
@@ -608,8 +608,8 @@ warning_popup_long(format, button_name, callback, va_alist)
Widget
confirm_popup(message, button_name, callback, yes_answer, no_answer)
- _Xconst char *message;
- _Xconst char *button_name;
+ const char *message;
+ const char *button_name;
XtCallbackProc callback;
XtPointer yes_answer, no_answer;
{
@@ -701,7 +701,7 @@ static int file_entry_height = 0; /* line height in viewport */
static Position f2ddist; /* size of list border */
struct suffix {
- _Xconst char *str;
+ const char *str;
size_t len;
};
static struct suffix *suffixes = NULL;
@@ -740,7 +740,7 @@ static char filehide = '.';
* the hidden-file checkbox, these are OK, but we need to do the same for the
* suffixes. */
-static _Xconst char *file_save_suff = ".dvi";
+static const char *file_save_suff = ".dvi";
static void act_file_go ARGS((Widget, XEvent *, String *, Cardinal *));
static void act_file_click ARGS((Widget, XEvent *, String *, Cardinal *));
@@ -775,7 +775,7 @@ static XtActionsRec file_actions[] = {
struct dirnode {
struct dirnode *next;
- _Xconst char *name;
+ const char *name;
};
static struct dirnode *
@@ -828,7 +828,7 @@ ll_sort(np)
static Boolean
suffix_check(s, len)
- _Xconst char *s;
+ const char *s;
size_t len;
{
struct suffix *sp;
@@ -948,7 +948,7 @@ file_refresh()
filedir_pm = XCreateBitmapFromData(DISP,
mane.win != (Window) 0 ? mane.win
: RootWindowOfScreen(SCRN),
- (_Xconst char *) filedir_bits,
+ (const char *) filedir_bits,
filedir_width, filedir_height);
if (*head->name != '0' && fileblank_pm == (Pixmap) 0)
fileblank_pm = XCreateBitmapFromData(DISP,
@@ -1120,7 +1120,7 @@ cb_file_home(w, client_data, call_data)
XtPointer client_data;
XtPointer call_data;
{
- _Xconst char *d;
+ const char *d;
size_t l;
d = getenv("HOME");
@@ -1179,7 +1179,7 @@ xdvi_get_cwd()
static Boolean
get_dir_name(str, len)
- _Xconst char *str;
+ const char *str;
size_t len;
{
int fd;
@@ -1550,7 +1550,7 @@ act_file_scroll P4C(Widget, w, XEvent *, event, String *, params,
Dimension ch, fh; /* clip and form (child) heights */
Position y;
Widget sbar;
- _Xconst char *arg;
+ const char *arg;
ptrdiff_t sign;
ptrdiff_t dist;
@@ -1594,11 +1594,11 @@ act_file_scroll P4C(Widget, w, XEvent *, event, String *, params,
static void
rebuild_suffixes(s)
- _Xconst char *s;
+ const char *s;
{
struct suffix *sp;
size_t n;
- _Xconst char *p, *p1;
+ const char *p, *p1;
char *q;
/* First free the old suffixes */
@@ -1909,7 +1909,7 @@ Act_open_dvi_file P4C(Widget, w, XEvent *, event, String *, params,
filechk_pm = XCreateBitmapFromData(DISP,
mane.win != (Window) 0 ? mane.win : RootWindowOfScreen(SCRN),
- (_Xconst char *) filechk_bits, filechk_width, filechk_height);
+ (const char *) filechk_bits, filechk_width, filechk_height);
fileunchk_pm = XCreateBitmapFromData(DISP,
mane.win != (Window) 0 ? mane.win : RootWindowOfScreen(SCRN),
@@ -2048,10 +2048,10 @@ static Widget *pr_current_pageradio = &r6radio;
static Widget *pr_save_fileradio = &r1radio1;
static Widget *pr_save_pageradio = &r6radio;
-static _Xconst char *pr_save_cmd = NULL;
-static _Xconst char *pr_save_file = NULL;
-static _Xconst char *pr_save_printer= NULL;
-static _Xconst char *pr_save_xargs = NULL;
+static const char *pr_save_cmd = NULL;
+static const char *pr_save_file = NULL;
+static const char *pr_save_printer= NULL;
+static const char *pr_save_xargs = NULL;
/* Things to do with running the dvips process */
@@ -2588,7 +2588,7 @@ Act_print P4C(Widget, w, XEvent *, event, String *, params,
NULL);
{ /* set initial values of print command and file name fields */
- _Xconst char *s;
+ const char *s;
char s2[3 * sizeof(int) + 1];
s = pr_save_cmd;
@@ -2743,12 +2743,12 @@ static void cb_dvips_close ARGS((Widget, XtPointer, XtPointer));
static void cb_dvips_keep ARGS((Widget, XtPointer, XtPointer));
static void cb_dvips_cancel ARGS((Widget, XtPointer, XtPointer));
static void cb_dvips_delete ARGS((Widget, XtPointer, XtPointer));
-static void printlog_append ARGS((_Xconst char *, int));
+static void printlog_append ARGS((const char *, int));
struct dvips_env {
- _Xconst char *envname;
- _Xconst char *en1, *en2;
- _Xconst char *envval;
+ const char *envname;
+ const char *en1, *en2;
+ const char *envval;
};
static struct dvips_env dvips_envs[] = {
@@ -2758,9 +2758,9 @@ static struct dvips_env dvips_envs[] = {
static void
print_do_it()
{
- _Xconst char *dest;
- _Xconst char *prn;
- _Xconst char *xargs;
+ const char *dest;
+ const char *prn;
+ const char *xargs;
FILE *f;
unsigned int len; /* length of command line */
unsigned int argc;
@@ -2768,7 +2768,7 @@ print_do_it()
char **argnext;
int print_io[2];
char *p, **pp;
- _Xconst char *q;
+ const char *q;
if (dvi_file == NULL) {
WARN(XmDIALOG_ERROR, "No active dvi file");
@@ -2933,7 +2933,7 @@ print_do_it()
len += uintlen(pageno1) + uintlen(pageno2) + 7;
}
if (pr_save_xargs != NULL) {
- _Xconst char *q = pr_save_xargs;
+ const char *q = pr_save_xargs;
len += strlen(pr_save_xargs);
for (;;) {
@@ -2980,7 +2980,7 @@ print_do_it()
}
if (pr_save_xargs != NULL) {
- _Xconst char *q = pr_save_xargs;
+ const char *q = pr_save_xargs;
for (;;) {
while (*q == ' ' || *q == '\t') ++q;
@@ -3015,8 +3015,8 @@ print_do_it()
if (dvips_envs[0].envname == NULL) {
for (dep = dvips_envs; dep < dvips_envs + XtNumber(dvips_envs);
++dep) {
- _Xconst char *envname;
- _Xconst char *envval;
+ const char *envname;
+ const char *envval;
unsigned int len;
envval = getenv(envname = dep->en1);
@@ -3133,7 +3133,7 @@ print_do_it()
static void
printlog_append(str, len)
- _Xconst char *str;
+ const char *str;
int len;
{
static XawTextBlock block = {0, 0, NULL, 0};
diff --git a/psdps.c b/psdps.c
@@ -97,7 +97,7 @@ xdvi$ack \
}loop\nH";
#endif /* SUNHACK */
-extern _Xconst char psheader[];
+extern const char psheader[];
extern unsigned psheaderlen;
#define postscript resource._postscript
@@ -109,10 +109,10 @@ static void toggleDPS ARGS((void));
static void destroyDPS ARGS((void));
static void interruptDPS ARGS((void));
static void endpageDPS ARGS((void));
-static void drawbeginDPS ARGS((int, int, _Xconst char *));
-static void drawrawDPS ARGS((_Xconst char *));
-static void drawfileDPS ARGS((_Xconst char *, FILE *));
-static void drawendDPS ARGS((_Xconst char *));
+static void drawbeginDPS ARGS((int, int, const char *));
+static void drawrawDPS ARGS((const char *));
+static void drawfileDPS ARGS((const char *, FILE *));
+static void drawendDPS ARGS((const char *));
static void beginheaderDPS ARGS((void));
static void endheaderDPS ARGS((void));
static void newdocDPS ARGS((void));
@@ -609,7 +609,7 @@ checkDPS()
static void
drawbeginDPS(xul, yul, cp)
int xul, yul;
- _Xconst char *cp;
+ const char *cp;
{
if (debug & DBG_PS)
Printf("Begin drawing at xul= %d, yul= %d.\n", xul, yul);
@@ -660,7 +660,7 @@ end stop\n%%%%xdvimark\n",
static void
drawrawDPS(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!DPS_active || (ev_flags & DPS_ev_mask))
return;
@@ -687,7 +687,7 @@ drawrawDPS(cp)
static void
drawfileDPS(cp, psfile)
- _Xconst char *cp;
+ const char *cp;
FILE *psfile;
{
char buffer[1025];
@@ -731,7 +731,7 @@ drawfileDPS(cp, psfile)
static void
drawendDPS(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!DPS_active || (ev_flags & DPS_MASK_NORMAL))
return;
diff --git a/psgs.c b/psgs.c
@@ -63,7 +63,7 @@ extern int errno;
# define GS_TIMEOUT 1000 /* milliseconds */
#endif
-extern _Xconst char psheader[];
+extern const char psheader[];
extern unsigned psheaderlen;
#define postscript resource._postscript
@@ -74,10 +74,10 @@ static void toggle_gs ARGS((void));
static void destroy_gs ARGS((void));
static void interrupt_gs ARGS((void));
static void endpage_gs ARGS((void));
-static void drawbegin_gs ARGS((int, int, _Xconst char *));
-static void drawraw_gs ARGS((_Xconst char *));
-static void drawfile_gs ARGS((_Xconst char *, FILE *));
-static void drawend_gs ARGS((_Xconst char *));
+static void drawbegin_gs ARGS((int, int, const char *));
+static void drawraw_gs ARGS((const char *));
+static void drawfile_gs ARGS((const char *, FILE *));
+static void drawend_gs ARGS((const char *));
static void beginheader_gs ARGS((void));
static void endheader_gs ARGS((void));
static void newdoc_gs ARGS((void));
@@ -103,7 +103,7 @@ static int std_io[2];
static char arg4[] = "-dDEVICEWIDTH=xxxxxxxxxx";
static char arg5[] = "-dDEVICEHEIGHT=xxxxxxxxxx";
-static _Xconst char *argv[] = {NULL, NULL, "-dNOPAUSE", "-q", arg4, arg5,
+static const char *argv[] = {NULL, NULL, "-dNOPAUSE", "-q", arg4, arg5,
"-dDEVICEXRESOLUTION=72",
"-dDEVICEYRESOLUTION=72",
"-dNOSAFER", "-dNOEPS", NULL, NULL, NULL};
@@ -293,10 +293,10 @@ write_to_gs()
static void
gs_send(cp, len)
- _Xconst char *cp;
+ const char *cp;
size_t len;
{
- _Xconst char *cp_end = cp + len;
+ const char *cp_end = cp + len;
char *send_end;
size_t bytes;
char *old_out;
@@ -485,12 +485,12 @@ initGS()
* header; i.e., no save/restore.
* `execute' is unique to ghostscript.
*/
- static _Xconst char strsafe[] = "\
+ static const char strsafe[] = "\
{ << /PermitFileReading [ (*) ] /PermitFileWriting [ ] /PermitFileControl [ ] \
>> setuserparams .locksafe \
} stopped pop\n";
- static _Xconst char str1[] = "\
+ static const char str1[] = "\
/xdvi$run {$error /newerror false put {currentfile cvx execute} stopped pop} \
def \
/xdvi$ack (\347\310\376) def \
@@ -504,7 +504,7 @@ initGS()
{clear} {pop eq {exit} if} ifelse }loop \
flushpage xdvi$ack print flush \
}loop\nH";
- static _Xconst char str2[] = "[0 1 1 0 0 0] concat\n\
+ static const char str2[] = "[0 1 1 0 0 0] concat\n\
revision 300 lt{(\347\310\375) print flush}if\n\
stop\n%%xdvimark\n";
@@ -555,7 +555,7 @@ stop\n%%xdvimark\n";
Fflush(stderr); /* to avoid double flushing */
GS_pid = vfork();
if (GS_pid == 0) { /* child */
- _Xconst char **argvp = argv + 10;
+ const char **argvp = argv + 10;
argv[1] = resource.gs_alpha ? "-sDEVICE=x11alpha" : "-sDEVICE=x11";
Sprintf(arg4 + 14, "%u", GS_page_w);
@@ -567,7 +567,7 @@ stop\n%%xdvimark\n";
(void) dup2(std_io[1], 1);
(void) dup2(std_io[1], 2);
(void) close(std_io[1]);
- (void) execvp(argv[0] = resource.gs_path, (char * _Xconst *) argv);
+ (void) execvp(argv[0] = resource.gs_path, (char * const *) argv);
Fprintf(stderr, "%s: Execvp of %s failed.\n", prog, argv[0]);
Fflush(stderr);
_exit(1);
@@ -689,7 +689,7 @@ destroy_gs()
static void
deactivate()
{
- static _Xconst char str[] = " stop\n%%xdvimark\n";
+ static const char str[] = " stop\n%%xdvimark\n";
int saved_mask;
saved_mask = GS_ev_mask;
@@ -789,10 +789,10 @@ end stop\n%%%%xdvimark\n",
static void
drawbegin_gs(xul, yul, cp)
int xul, yul;
- _Xconst char *cp;
+ const char *cp;
{
char buf[32];
- static _Xconst char str[] = " TeXDict begin\n";
+ static const char str[] = " TeXDict begin\n";
checkgs(False);
@@ -816,7 +816,7 @@ drawbegin_gs(xul, yul, cp)
static void
drawraw_gs(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!GS_active)
return;
@@ -827,7 +827,7 @@ drawraw_gs(cp)
static void
drawfile_gs(cp, f)
- _Xconst char *cp;
+ const char *cp;
FILE *f;
{
Fclose(f); /* don't need it */
@@ -845,7 +845,7 @@ drawfile_gs(cp, f)
static void
drawend_gs(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!GS_active)
return;
@@ -857,7 +857,7 @@ drawend_gs(cp)
static void
beginheader_gs()
{
- static _Xconst char str[] = "Hsave /xdvi$doc exch def\n";
+ static const char str[] = "Hsave /xdvi$doc exch def\n";
if (debug & DBG_PS) Puts("Running beginheader_gs()");
@@ -900,7 +900,7 @@ endheader_gs()
static void
newdoc_gs()
{
- static _Xconst char str[] =
+ static const char str[] =
"Hxdvi$doc restore stop\n%%xdvimark\n";
if (debug & DBG_PS) Puts("Running newdoc_gs()");
diff --git a/psnews.c b/psnews.c
@@ -86,7 +86,7 @@ extern int errno;
#define FLAKY_SIGPOLL 1
#endif
-char *strtok ARGS((char *, _Xconst char *));
+char *strtok ARGS((char *, const char *));
#define Fprintf (void) fprintf
@@ -99,7 +99,7 @@ char *strtok ARGS((char *, _Xconst char *));
/*
* Some setup code.
*/
-static _Xconst char str0[] = "\
+static const char str0[] = "\
/OW2? version cvi 2 eq def \
OW2? \
{ /setlinewidth { pop } def} \
@@ -119,7 +119,7 @@ if\n";
* The `H' at the end tells it that the first group is a
* header; i.e., no save/restore.
*/
-static _Xconst char preamble[] = "\
+static const char preamble[] = "\
/xdvi$line 81 string def \
/xdvi$run {$error null ne {$error /newerror false put} if \
{currentfile cvx stopped \
@@ -136,10 +136,10 @@ static _Xconst char preamble[] = "\
58 tagprint flush \
}loop\nH";
-extern _Xconst char psheader[];
+extern const char psheader[];
extern unsigned psheaderlen;
-static _Xconst char preamble2[] = " stop\n%%xdvimark\n";
+static const char preamble2[] = " stop\n%%xdvimark\n";
#define stopstring preamble2
#define postscript resource._postscript
@@ -151,10 +151,10 @@ static void toggleNeWS ARGS((void));
static void destroyNeWS ARGS((void));
static void interruptNeWS ARGS((void));
static void endpageNeWS ARGS((void));
-static void drawbeginNeWS ARGS((int, int, _Xconst char *));
-static void drawrawNeWS ARGS((_Xconst char *));
-static void drawfileNeWS ARGS((_Xconst char *, FILE *));
-static void drawendNeWS ARGS((_Xconst char *));
+static void drawbeginNeWS ARGS((int, int, const char *));
+static void drawrawNeWS ARGS((const char *));
+static void drawfileNeWS ARGS((const char *, FILE *));
+static void drawendNeWS ARGS((const char *));
static void beginheaderNeWS ARGS((void));
static void endheaderNeWS ARGS((void));
static void newdocNeWS ARGS((void));
@@ -179,8 +179,8 @@ static unsigned int NeWS_page_w; /* how big our current page is */
static unsigned int NeWS_page_h;
static Boolean NeWS_active; /* if we've started a page yet */
static int NeWS_pending; /* number of ack's we're expecting */
-static _Xconst char *NeWS_send_byte; /* next byte to send to NeWS */
-static _Xconst char *NeWS_send_end; /* last + 1 byte to send */
+static const char *NeWS_send_byte; /* next byte to send to NeWS */
+static const char *NeWS_send_end; /* last + 1 byte to send */
static Boolean NeWS_in_header; /* if we're sending a header */
static Boolean NeWS_in_doc; /* if we've sent header information */
static int NeWS_ev_mask; /* events for which we'll stop */
@@ -338,7 +338,7 @@ post_send()
static void
NeWS_send(cp, len)
- _Xconst char *cp;
+ const char *cp;
size_t len;
{
struct sigaction orig;
@@ -598,11 +598,11 @@ endpageNeWS()
static void
drawbeginNeWS(xul, yul, cp)
int xul, yul;
- _Xconst char *cp;
+ const char *cp;
{
char buf[100];
- static _Xconst char str[] = " TeXDict begin\n";
- static _Xconst char str2[] = "Hinitgraphics stop\n%%xdvimark\n";
+ static const char str[] = " TeXDict begin\n";
+ static const char str2[] = "Hinitgraphics stop\n%%xdvimark\n";
if (debug & DBG_PS) {
Printf("xul= %d yul= %d\n", xul, yul);
@@ -669,9 +669,9 @@ end stop\n%%%%xdvimark\n",
static void
drawrawNeWS(origcp)
- _Xconst char *origcp;
+ const char *origcp;
{
- _Xconst char *pt, *ptm1, *ocp1;
+ const char *pt, *ptm1, *ocp1;
static char *cp;
char *cp1;
static unsigned int cplen = 0;
@@ -766,7 +766,7 @@ drawrawNeWS(origcp)
static void
drawfileNeWS(cp, psfile)
- _Xconst char *cp;
+ const char *cp;
FILE *psfile;
{
char buffer[1025];
@@ -814,7 +814,7 @@ drawfileNeWS(cp, psfile)
static void
drawendNeWS(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!NeWS_active)
return;
@@ -840,7 +840,7 @@ drawendNeWS(cp)
static void
beginheaderNeWS()
{
- static _Xconst char str[] = "Hsave /xdvi$doc exch def\n";
+ static const char str[] = "Hsave /xdvi$doc exch def\n";
if (debug & DBG_PS) Puts("Running beginheaderNeWS()");
@@ -880,7 +880,7 @@ beginheaderNeWS()
static void
endheaderNeWS()
{
- static _Xconst char str[] = "stop\n%%xdvimark\n";
+ static const char str[] = "stop\n%%xdvimark\n";
if (debug & DBG_PS) Puts("Running endheaderNeWS()");
@@ -909,7 +909,7 @@ endheaderNeWS()
static void
newdocNeWS()
{
- static _Xconst char str[] =
+ static const char str[] =
"H xdvi$doc restore stop\n%%xdvimark\n";
if (debug & DBG_PS) Puts("Running newdocNeWS()");
diff --git a/special.c b/special.c
@@ -58,16 +58,16 @@ NOTE:
#include <math.h>
#include <ctype.h>
-extern char *strtok ARGS((char *, _Xconst char *));
+extern char *strtok ARGS((char *, const char *));
extern double floor ARGS((double));
#define rint(x) floor((x) + 0.5)
#ifdef X_NOT_STDC_ENV
#ifndef atof
-extern double atof ARGS((_Xconst char *));
+extern double atof ARGS((const char *));
#endif
-extern char *getenv ARGS((_Xconst char *));
+extern char *getenv ARGS((const char *));
#endif /* X_NOT_STDC_ENV */
#if PS
@@ -524,7 +524,7 @@ blacken_last()
#include "filf-app.h" /* application-related defs, etc. */
#include "filefind.h"
-static _Xconst char no_f_str_ps[] = "/%f";
+static const char no_f_str_ps[] = "/%f";
static struct findrec search_header = {
/* path1 */ NULL,
@@ -584,10 +584,10 @@ static struct findrec search_fig = {
}
};
-static void ps_startup ARGS((int, int, _Xconst char *));
+static void ps_startup ARGS((int, int, const char *));
static void ps_startup2 ARGS((void));
void NullProc ARGS((void)) {}
-static void NullProc2 ARGS((_Xconst char *));
+static void NullProc2 ARGS((const char *));
struct psprocs psp = { /* used for lazy startup of the ps machinery */
/* toggle */ NullProc,
@@ -784,7 +784,7 @@ actual_startup()
static void
ps_startup(xul, yul, cp)
int xul, yul;
- _Xconst char *cp;
+ const char *cp;
{
if (!resource._postscript) {
draw_bbox();
@@ -804,14 +804,14 @@ ps_startup2()
/* ARGSUSED */
static void
NullProc2(cp)
- _Xconst char *cp;
+ const char *cp;
{}
static void
ps_parseraw(PostScript_cmd)
- _Xconst char *PostScript_cmd;
+ const char *PostScript_cmd;
{
- _Xconst char *p;
+ const char *p;
/* dumb parsing of PostScript - search for rotation H. Zeller 1/97 */
bbox_angle = 0;
@@ -827,11 +827,11 @@ ps_parseraw(PostScript_cmd)
/* ARGSUSED */
void
#if NeedFunctionPrototypes
-drawbegin_none(int xul, int yul, _Xconst char *cp)
+drawbegin_none(int xul, int yul, const char *cp)
#else /* !NeedFunctionPrototypes */
drawbegin_none(xul, yul, cp)
int xul, yul;
- _Xconst char *cp;
+ const char *cp;
#endif /* NeedFunctionPrototypes */
{
draw_bbox();
@@ -870,7 +870,7 @@ static int nticks = 0; /* number of records total */
static struct tickrec *
cachetick(filename, pathinfo, fp, fdp)
- _Xconst char *filename;
+ const char *filename;
struct findrec *pathinfo;
FILE **fp;
int *fdp;
@@ -961,13 +961,13 @@ ps_clear_cache()
static void
send_ps_file(filename, pathinfo)
- _Xconst char *filename;
+ const char *filename;
struct findrec *pathinfo;
{
FILE *f;
int fd;
- static _Xconst char *argv[] = {NULL, "-c", NULL, NULL};
- _Xconst char *bufp;
+ static const char *argv[] = {NULL, "-c", NULL, NULL};
+ const char *bufp;
struct tickrec *tikp;
char *p;
unsigned len;
@@ -1023,7 +1023,7 @@ send_ps_file(filename, pathinfo)
f = xfopen(bufp, OPEN_MODE);
}
if (f == NULL) {
- f = filefind(filename, pathinfo, (_Xconst char **) NULL);
+ f = filefind(filename, pathinfo, (const char **) NULL);
bufp = ffline;
}
@@ -1234,7 +1234,7 @@ psfig_special(cp)
/* Keys for epsf specials */
-static _Xconst char *keytab[] = {"clip",
+static const char *keytab[] = {"clip",
"llx",
"lly",
"urx",
@@ -1439,7 +1439,7 @@ scan_bang(cp)
struct dvipscolor {
int len;
- _Xconst char *name;
+ const char *name;
struct rgb color;
};
@@ -1523,7 +1523,7 @@ static struct dvipscolor colornames[] = {
static Boolean
parse_color(cp0, cp, rgbp)
- _Xconst char *cp0, *cp;
+ const char *cp0, *cp;
struct rgb *rgbp;
{
double r, g, b;
@@ -1659,7 +1659,7 @@ init_page_colors()
static void
scan_bg_color(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!use_color)
return;
@@ -1672,9 +1672,9 @@ scan_bg_color(cp)
static void
scan_color(cp)
- _Xconst char *cp;
+ const char *cp;
{
- _Xconst char *cp1 = cp + 6;
+ const char *cp1 = cp + 6;
if (!use_color)
return;
@@ -1724,9 +1724,9 @@ void
scan_color_eop()
{
int i;
- _Xconst struct rgb *prev;
+ const struct rgb *prev;
struct colorframe *cf;
- _Xconst struct rgb *p1;
+ const struct rgb *p1;
struct rgb *rgbp;
if (page_colors == NULL)
@@ -1786,7 +1786,7 @@ static struct colorframe *rcs_head;
*/
void
-set_fg_color(_Xconst struct rgb *color)
+set_fg_color(const struct rgb *color)
{
struct fgrec **fgpp;
@@ -1821,7 +1821,7 @@ set_fg_color(_Xconst struct rgb *color)
static void
color_special(cp)
- _Xconst char *cp;
+ const char *cp;
{
if (!use_color)
return;
@@ -1906,12 +1906,12 @@ color_special(cp)
static unsigned int
myatopix(pp)
- _Xconst char **pp;
+ const char **pp;
{
unsigned int value;
- _Xconst char *cp = *pp;
+ const char *cp = *pp;
char scr[16];
- _Xconst char *p0, *p1;
+ const char *p0, *p1;
p0 = cp;
while ((*cp >= '0' && *cp <= '9') || *cp == '.') ++cp;
@@ -1935,9 +1935,9 @@ myatopix(pp)
static void
scan_papersize(cp0)
- _Xconst char *cp0;
+ const char *cp0;
{
- _Xconst char *cp = cp0;
+ const char *cp = cp0;
unsigned int w, h;
double mag = 1.;
@@ -2191,11 +2191,11 @@ scan_special(cp)
void
geom_do_special(g_info, cp, current_dimconv)
struct geom_info *g_info;
- /* cp is not _Xconst, because of endofcommand(). */
+ /* cp is not const, because of endofcommand(). */
char *cp;
double current_dimconv;
{
- _Xconst char *p;
+ const char *p;
/* Skip white space */
while (isspace(*cp)) ++cp;
@@ -2222,7 +2222,7 @@ geom_do_special(g_info, cp, current_dimconv)
while (*p != '\0' && !isspace(*p)) ++p;
while (isspace(*p)) ++p;
while (*p != '\0') {
- _Xconst char *p1 = p;
+ const char *p1 = p;
int keyno;
while (*p1 != '=' && !isspace(*p1) && *p1 != '\0') ++p1;
diff --git a/squeeze.c b/squeeze.c
@@ -121,14 +121,14 @@ char *argv[] ;
* DO NOT EDIT THIS FILE!\n\
* It was created by squeeze.c from another file (see the Makefile).\n\
*/\n\n\
-#ifndef _Xconst\n\
+#ifndef const\n\
#if __STDC__\n\
-#define _Xconst const\n\
+#define const const\n\
#else\n\
-#define _Xconst\n\
+#define const\n\
#endif\n\
#endif\n\n\
-_Xconst char psheader[] = \"\\\n", out);
+const char psheader[] = \"\\\n", out);
while (1) {
c = getc(in) ;
if (c==EOF)
diff --git a/util.c b/util.c
@@ -183,7 +183,7 @@ xdvi_exit(status)
#if NeedVarargsPrototypes
void
-oops(_Xconst char *message, ...)
+oops(const char *message, ...)
#else
/* VARARGS */
void
@@ -192,7 +192,7 @@ oops(va_alist)
#endif
{
#if !NeedVarargsPrototypes
- _Xconst char *message;
+ const char *message;
#endif
va_list args;
@@ -201,7 +201,7 @@ oops(va_alist)
va_start(args, message);
#else
va_start(args);
- message = va_arg(args, _Xconst char *);
+ message = va_arg(args, const char *);
#endif
(void) vfprintf(stderr, message, args);
va_end(args);
@@ -247,7 +247,7 @@ xrealloc(where, size)
char *
xstrdup(str)
- _Xconst char *str;
+ const char *str;
{
size_t len;
char *new;
@@ -265,7 +265,7 @@ xstrdup(str)
char *
xmemdup(str, len)
- _Xconst char *str;
+ const char *str;
size_t len;
{
char *new;
@@ -341,8 +341,8 @@ extern char **environ;
void
xputenv(var, value)
- _Xconst char *var;
- _Xconst char *value;
+ const char *var;
+ const char *value;
{
#if HAVE_PUTENV
@@ -412,8 +412,8 @@ xputenv(var, value)
int
memicmp(s1, s2, n)
- _Xconst char *s1;
- _Xconst char *s2;
+ const char *s1;
+ const char *s2;
size_t n;
{
while (n > 0) {
@@ -491,14 +491,14 @@ close_small_file()
FILE *
#ifndef VMS
xfopen(filename, type)
- _Xconst char *filename;
- _Xconst char *type;
+ const char *filename;
+ const char *type;
#define TYPE type
#else
xfopen(filename, type, type2)
- _Xconst char *filename;
- _Xconst char *type;
- _Xconst char *type2;
+ const char *filename;
+ const char *type;
+ const char *type2;
#define TYPE type, type2
#endif /* VMS */
{
@@ -534,7 +534,7 @@ xfopen(filename, type, type2)
int
xopen(path, flags)
- _Xconst char *path;
+ const char *path;
int flags;
{
int fd;
@@ -590,7 +590,7 @@ xpipe(fd)
DIR *
xopendir(name)
- _Xconst char *name;
+ const char *name;
{
DIR *retval;
@@ -611,15 +611,15 @@ xopendir(name)
* user was not found.
*/
-_Xconst struct passwd *
+const struct passwd *
ff_getpw(pp, p_end)
- _Xconst char **pp;
- _Xconst char *p_end;
+ const char **pp;
+ const char *p_end;
{
- _Xconst char *p = *pp;
- _Xconst char *p1;
+ const char *p = *pp;
+ const char *p1;
unsigned len;
- _Xconst struct passwd *pw;
+ const struct passwd *pw;
int count;
++p; /* skip the tilde */
@@ -703,7 +703,7 @@ snum(fp, size)
struct avl *
avladd(key, key_len, headp, size)
- _Xconst char *key;
+ const char *key;
size_t key_len;
struct avl **headp;
size_t size;
@@ -919,7 +919,7 @@ property_get_data(w, a, ret_buf, x_get_property)
#define P_tmpdir "/tmp"
#endif
-static _Xconst char tmp_suffix[] = "/xdvi-XXXXXX";
+static const char tmp_suffix[] = "/xdvi-XXXXXX";
int
xdvi_temp_fd(str)
@@ -928,7 +928,7 @@ xdvi_temp_fd(str)
int fd;
char *p;
size_t len;
- static _Xconst char *template = NULL;
+ static const char *template = NULL;
#if !HAVE_MKSTEMP
static unsigned long seed;
static char letters[] =
@@ -954,7 +954,7 @@ xdvi_temp_fd(str)
}
else {
if (template == NULL) {
- _Xconst char *ourdir;
+ const char *ourdir;
ourdir = getenv("TMPDIR");
if (ourdir == NULL || access(ourdir, W_OK) < 0) {
diff --git a/xdvi.c b/xdvi.c
@@ -121,7 +121,7 @@ static char copyright[] UNUSED =
#ifdef X_NOT_STDC_ENV
#ifndef atof
-extern double atof ARGS((_Xconst char *));
+extern double atof ARGS((const char *));
#endif
#endif
@@ -201,10 +201,10 @@ typedef char *XPointer;
#define drag_vert_height 17
#define drag_vert_x_hot 3
#define drag_vert_y_hot 8
-static _Xconst unsigned char drag_vert_bits[] = {
+static const unsigned char drag_vert_bits[] = {
0x00, 0x08, 0x1c, 0x2a, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08, 0x08,
0x08, 0x2a, 0x1c, 0x08, 0x00};
-static _Xconst unsigned char drag_vert_mask[] = {
+static const unsigned char drag_vert_mask[] = {
0x08, 0x1c, 0x3e, 0x7f, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c, 0x1c,
0x1c, 0x7f, 0x3e, 0x1c, 0x08};
@@ -212,10 +212,10 @@ static _Xconst unsigned char drag_vert_mask[] = {
#define drag_horiz_height 7
#define drag_horiz_x_hot 8
#define drag_horiz_y_hot 3
-static _Xconst unsigned char drag_horiz_bits[] = {
+static const unsigned char drag_horiz_bits[] = {
0x00, 0x00, 0x00, 0x08, 0x20, 0x00, 0x04, 0x40, 0x00, 0xfe, 0xff, 0x00,
0x04, 0x40, 0x00, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00};
-static _Xconst unsigned char drag_horiz_mask[] = {
+static const unsigned char drag_horiz_mask[] = {
0x08, 0x20, 0x00, 0x0c, 0x60, 0x00, 0xfe, 0xff, 0x00, 0xff, 0xff, 0x01,
0xfe, 0xff, 0x00, 0x0c, 0x60, 0x00, 0x08, 0x20, 0x00};
@@ -223,13 +223,13 @@ static _Xconst unsigned char drag_horiz_mask[] = {
#define drag_omni_height 17
#define drag_omni_x_hot 8
#define drag_omni_y_hot 8
-static _Xconst unsigned char drag_omni_bits[] = {
+static const unsigned char drag_omni_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0x40, 0x05, 0x00,
0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x08, 0x21, 0x00, 0x04, 0x41, 0x00,
0xfe, 0xff, 0x00, 0x04, 0x41, 0x00, 0x08, 0x21, 0x00, 0x00, 0x01, 0x00,
0x00, 0x01, 0x00, 0x40, 0x05, 0x00, 0x80, 0x03, 0x00, 0x00, 0x01, 0x00,
0x00, 0x00, 0x00};
-static _Xconst unsigned char drag_omni_mask[] = {
+static const unsigned char drag_omni_mask[] = {
0x00, 0x01, 0x00, 0x80, 0x03, 0x00, 0xc0, 0x07, 0x00, 0xe0, 0x0f, 0x00,
0x80, 0x03, 0x00, 0x88, 0x23, 0x00, 0x8c, 0x63, 0x00, 0xfe, 0xff, 0x00,
0xff, 0xff, 0x01, 0xfe, 0xff, 0x00, 0x8c, 0x63, 0x00, 0x88, 0x23, 0x00,
@@ -302,11 +302,11 @@ static char * atom_names[] = {"XDVI WINDOWS", "DVI NAME", "SRC GOTO",
* Data for options processing
*/
-static _Xconst char silent[] = " "; /* flag value for usage() */
+static const char silent[] = " "; /* flag value for usage() */
-static _Xconst char subst[] = "x"; /* another flag value */
+static const char subst[] = "x"; /* another flag value */
-static _Xconst char *subst_val[] = {
+static const char *subst_val[] = {
#ifdef BUTTONS
"-shrinkbutton[1-9] <shrink>",
#endif
@@ -436,7 +436,7 @@ static XrmOptionDescRec options[] = {
#if !CC_K_AND_R || MAKING_HEADER
-static _Xconst char base_translations[] = ""
+static const char base_translations[] = ""
"^<Key>c:quit()\n" /* Control keys first */
"^<Key>d:quit()\n"
"^<Key>m:forward-page()\n"
@@ -722,7 +722,7 @@ static XtResource app_pixel_resources[] = { /* get these later */
};
#undef offset
-static _Xconst char *usagestr[] = {
+static const char *usagestr[] = {
/* shrinkFactor */ "shrink",
#ifndef VMS
/* S */ "density",
@@ -886,11 +886,11 @@ static Arg form_args[] = {
#endif
-static void usage VARGS((_Xconst char *, ...)) NORETURN;
+static void usage VARGS((const char *, ...)) NORETURN;
#if NeedVarargsPrototypes
static void
-usage(_Xconst char *message, ...)
+usage(const char *message, ...)
#else
/* VARARGS */
void
@@ -899,14 +899,14 @@ usage(va_alist)
#endif
{
#if !NeedVarargsPrototypes
- _Xconst char *message;
+ const char *message;
#endif
va_list args;
XrmOptionDescRec *opt;
- _Xconst char **usageptr = usagestr;
- _Xconst char **sv = subst_val;
- _Xconst char *str1;
- _Xconst char *str2;
+ const char **usageptr = usagestr;
+ const char **sv = subst_val;
+ const char *str1;
+ const char *str2;
int col = 23;
int n;
@@ -916,7 +916,7 @@ usage(va_alist)
va_start(args, message);
#else
va_start(args);
- message = va_arg(args, _Xconst char *);
+ message = va_arg(args, const char *);
#endif
(void) vfprintf(stderr, message, args);
va_end(args);
@@ -962,11 +962,11 @@ usage(va_alist)
int
atopix(arg, allow_minus)
- _Xconst char *arg;
+ const char *arg;
Boolean allow_minus;
{
int len = strlen(arg);
- _Xconst char *arg_end = arg;
+ const char *arg_end = arg;
char tmp[11];
double factor;
@@ -1364,7 +1364,7 @@ src_client_check()
XChangeProperty(DISP, w,
ATOM_SRC_GOTO, ATOM_SRC_GOTO, 8, PropModeReplace,
- (_Xconst unsigned char *) resource.src_pos,
+ (const unsigned char *) resource.src_pos,
strlen(resource.src_pos));
retval = True;
@@ -1388,7 +1388,7 @@ src_client_check()
* internally.
*/
-static _Xconst char *paper_types[] = {
+static const char *paper_types[] = {
"letter", "8.5x11in",
"letterr", "11x8.5in",
"us", "8.5x11in",
@@ -1461,9 +1461,9 @@ static _Xconst char *paper_types[] = {
static Boolean
set_paper_type() {
- _Xconst char *arg, *arg1;
+ const char *arg, *arg1;
char temp[21];
- _Xconst char **p;
+ const char **p;
char *q;
arg = resource.paper;
@@ -1503,7 +1503,7 @@ set_paper_type() {
#include "filf-app.h" /* application-related defs, etc. */
#include "filefind.h"
-static _Xconst char no_f_str_text[] = "/%f";
+static const char no_f_str_text[] = "/%f";
static struct findrec search_text = {
/* path1 */ NULL,
@@ -1540,7 +1540,7 @@ static struct findrec search_text = {
struct modifierinf {
int len;
- _Xconst char *name;
+ const char *name;
Modifiers mask;
KeySym keysym;
};
@@ -1580,11 +1580,11 @@ static struct modifierinf modifiers[] = {
static Bool
compile_modifiers(pp, wactp)
- _Xconst char **pp;
+ const char **pp;
struct wheel_acts *wactp;
{
- _Xconst char *p = *pp;
- _Xconst char *p1;
+ const char *p = *pp;
+ const char *p1;
Bool exclusive = False;
LateBindingsPtr latep = NULL;
int nlate;
@@ -1710,11 +1710,11 @@ compile_modifiers(pp, wactp)
static Bool
compile_evtype(pp, buttonp)
- _Xconst char **pp;
+ const char **pp;
unsigned int *buttonp;
{
- _Xconst char *p = *pp;
- _Xconst char *p0;
+ const char *p = *pp;
+ const char *p0;
++p; /* already assumed to be '<' */
while (*p == ' ' || *p == '\t') ++p;
@@ -1763,8 +1763,8 @@ compile_wheel_actions()
{
struct wheel_acts **wactpp;
struct wheel_acts *wactp;
- _Xconst char *p = resource.wheel_translations;
- _Xconst char *p_end = p + strlen(p);
+ const char *p = resource.wheel_translations;
+ const char *p_end = p + strlen(p);
struct wheel_acts wact;
wactpp = &wheel_actions;
@@ -1887,7 +1887,7 @@ or invalid argument:\n\t\"%s\", \"%s\".",
{
FILE *f;
- _Xconst char *path;
+ const char *path;
XrmDatabase db;
f = filefind("XDvi", &search_text, &path);
@@ -2145,7 +2145,7 @@ or invalid argument:\n\t\"%s\", \"%s\".",
offset_y = resource.yoffset ? atopix(resource.yoffset, True)
: pixels_per_inch;
if (!set_paper_type()) {
- _Xconst char **p;
+ const char **p;
Fprintf(stderr,
"%s: Unrecognized paper type \"%s\". Legal values are:\n ",
@@ -2183,8 +2183,8 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
#endif /* PS */
#ifdef PS_GS
{
- _Xconst char *CGMcgm = "CGMcgm";
- _Xconst char *cgmp;
+ const char *CGMcgm = "CGMcgm";
+ const char *cgmp;
cgmp = index(CGMcgm, resource.gs_palette[0]);
if (cgmp == NULL)
@@ -2290,7 +2290,7 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
XtGetValues(top_level, &temp_args4, 1);
if (icon_pm == (Pixmap) 0) {
temp_args4.value = (XtArgVal) (XCreateBitmapFromData(DISP,
- RootWindowOfScreen(SCRN), (_Xconst char *) xdvi_bits,
+ RootWindowOfScreen(SCRN), (const char *) xdvi_bits,
xdvi_width, xdvi_height));
XtSetValues(top_level, &temp_args4, 1);
}
@@ -2372,8 +2372,8 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
xlats = XtParseTranslationTable(resource.main_translations);
for (;;) { /* not really a loop */
- _Xconst char *p1;
- _Xconst char *p2;
+ const char *p1;
+ const char *p2;
p1 = resource.main_translations;
while (*p1 == ' ' || *p1 == '\t') ++p1;
@@ -2660,10 +2660,10 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
#endif
arrow_pixmap = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_vert_bits,
+ (const char *) drag_vert_bits,
drag_vert_width, drag_vert_height);
arrow_mask = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_vert_mask,
+ (const char *) drag_vert_mask,
drag_vert_width, drag_vert_height);
drag_cursor[0] = XCreatePixmapCursor(DISP, arrow_pixmap, arrow_mask,
&cr_Color, &bg_Color, drag_vert_x_hot, drag_vert_y_hot);
@@ -2671,10 +2671,10 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
XFreePixmap(DISP, arrow_mask);
arrow_pixmap = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_horiz_bits,
+ (const char *) drag_horiz_bits,
drag_horiz_width, drag_horiz_height);
arrow_mask = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_horiz_mask,
+ (const char *) drag_horiz_mask,
drag_horiz_width, drag_horiz_height);
drag_cursor[1] = XCreatePixmapCursor(DISP, arrow_pixmap, arrow_mask,
&cr_Color, &bg_Color, drag_horiz_x_hot, drag_horiz_y_hot);
@@ -2682,10 +2682,10 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr);
XFreePixmap(DISP, arrow_mask);
arrow_pixmap = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_omni_bits,
+ (const char *) drag_omni_bits,
drag_omni_width, drag_omni_height);
arrow_mask = XCreateBitmapFromData(DISP, RootWindowOfScreen(SCRN),
- (_Xconst char *) drag_omni_mask,
+ (const char *) drag_omni_mask,
drag_omni_width, drag_omni_height);
drag_cursor[2] = XCreatePixmapCursor(DISP, arrow_pixmap, arrow_mask,
&cr_Color, &bg_Color, drag_omni_x_hot, drag_omni_y_hot);
diff --git a/xdvi.h b/xdvi.h
@@ -223,14 +223,6 @@ typedef char Bool3; /* Yes/No/Maybe */
#define _XFUNCPROTOEND
#endif
-#ifndef _Xconst
-#if __STDC__
-#define _Xconst const
-#else /* STDC */
-#define _Xconst
-#endif /* STDC */
-#endif /* _Xconst */
-
#ifndef VOLATILE
#if __STDC__ || (defined(__stdc__) && defined(__convex__))
#define VOLATILE volatile
@@ -264,9 +256,9 @@ typedef char Bool3; /* Yes/No/Maybe */
#endif /* OPEN_MODE */
#ifndef VMS
-#define OPEN_MODE_ARGS _Xconst char *
+#define OPEN_MODE_ARGS const char *
#else
-#define OPEN_MODE_ARGS _Xconst char *, _Xconst char *
+#define OPEN_MODE_ARGS const char *, const char *
#endif
#define Printf (void) printf
@@ -452,7 +444,7 @@ EXTERN int source_fwd_box_page INIT(-1); /* -1 means no box */
/*
* Information on deferred source operation. See do_pages() for meaning.
*/
-EXTERN _Xconst char *source_forward_string INIT(NULL);
+EXTERN const char *source_forward_string INIT(NULL);
EXTERN int source_reverse_x, source_reverse_y;
EXTERN int source_show_all;
@@ -524,7 +516,7 @@ struct font {
float fsize; /* size information (dots per inch) */
int magstepval; /* magstep number * two, or NOMAGSTP */
FILE *file; /* open font file or NULL */
- _Xconst char *filename; /* name of font file */
+ const char *filename; /* name of font file */
long checksum; /* checksum */
unsigned short timestamp; /* for LRU management of fonts */
ubyte flags; /* flags byte (see values below) */
@@ -575,11 +567,11 @@ EXTERN unsigned short current_timestamp INIT(0);
extern struct _resource {
#if CFGFILE
- _Xconst char *progname;
+ const char *progname;
#endif
int shrinkfactor;
- _Xconst char *main_translations;
- _Xconst char *wheel_translations;
+ const char *main_translations;
+ const char *wheel_translations;
int dvips_hang;
int dvips_fail_hang;
int wheel_unit;
@@ -588,18 +580,18 @@ extern struct _resource {
float _gamma;
#endif
int _pixels_per_inch;
- _Xconst char *sidemargin;
- _Xconst char *topmargin;
- _Xconst char *xoffset;
- _Xconst char *yoffset;
- _Xconst char *paper;
- _Xconst char *_alt_font;
+ const char *sidemargin;
+ const char *topmargin;
+ const char *xoffset;
+ const char *yoffset;
+ const char *paper;
+ const char *_alt_font;
#ifdef MKTEXPK
Boolean makepk;
#endif
- _Xconst char *mfmode;
- _Xconst char *editor;
- _Xconst char *src_pos;
+ const char *mfmode;
+ const char *editor;
+ const char *src_pos;
Boolean src_fork;
Boolean _list_fonts;
#if FREETYPE
@@ -615,7 +607,7 @@ extern struct _resource {
Pixel _brdr_Pixel;
Pixel _hl_Pixel;
Pixel _cr_Pixel;
- _Xconst char *icon_geometry;
+ const char *icon_geometry;
Boolean keep_flag;
Boolean copy;
Boolean thorough;
@@ -634,16 +626,16 @@ extern struct _resource {
Boolean useGS;
Boolean gs_safer;
Boolean gs_alpha;
- _Xconst char *gs_path;
- _Xconst char *gs_palette;
+ const char *gs_path;
+ const char *gs_palette;
#endif
#endif /* PS */
Boolean prescan;
- _Xconst char *debug_arg;
+ const char *debug_arg;
Boolean version_flag;
#if BUTTONS
Boolean expert;
- _Xconst char *button_translations;
+ const char *button_translations;
int shrinkbutton[9];
Dimension btn_side_spacing;
Dimension btn_top_spacing;
@@ -651,7 +643,7 @@ extern struct _resource {
Dimension btn_between_extra;
Dimension btn_border_width;
#endif
- _Xconst char *mg_arg[5];
+ const char *mg_arg[5];
#if COLOR
Boolean _use_color;
#endif
@@ -659,7 +651,7 @@ extern struct _resource {
Boolean _use_grey;
Bool3 install;
#endif
- _Xconst char *dvips_path;
+ const char *dvips_path;
} resource;
/* As a convenience, we define the field names without leading underscores
@@ -700,14 +692,14 @@ struct rgb {
struct pagecolor {
struct rgb bg;
unsigned int stacksize;
- _Xconst struct rgb *colorstack;
+ const struct rgb *colorstack;
};
/* Information on background color and initial color stack for each page. */
EXTERN struct pagecolor *page_colors INIT(NULL);
/* The initial color stack is gotten from the pagecolor record for a page. */
-EXTERN _Xconst struct rgb *color_bottom;
+EXTERN const struct rgb *color_bottom;
EXTERN unsigned int color_bot_size; /* number of entries */
/* Additions to the runtime color stack on a given page are stored in a linked
@@ -793,7 +785,7 @@ EXTERN unsigned char *dvi_property; /* for setting in window */
EXTERN size_t dvi_property_length;
EXTERN Boolean titles_are_stale INIT(True);
/* replace icon/window titles */
-EXTERN _Xconst char *prog;
+EXTERN const char *prog;
EXTERN int bak_shrink; /* last shrink factor != 1 */
EXTERN Dimension window_w, window_h;
EXTERN XImage *image;
@@ -936,7 +928,7 @@ EXTERN Widget vport_widget, draw_widget, clip_widget;
# if BUTTONS
EXTERN Widget form_widget;
EXTERN int xtra_wid INIT(0);
-extern _Xconst char default_button_config[]; /* defined in events.c */
+extern const char default_button_config[]; /* defined in events.c */
EXTERN Widget panel_widget;
EXTERN Cursor panel_cursor INIT(0);
# endif
@@ -983,7 +975,7 @@ EXTERN size_t ffline_len INIT(0); /* current length of ffline[] */
*/
#define AVL_COMMON \
- _Xconst char *key; /* key */ \
+ const char *key; /* key */ \
int key_len; /* length of key */ \
int bal; /* AVL balancing information */ \
struct avl *left; \
@@ -996,10 +988,10 @@ struct avl { /* generic data structure */
/* Data structure for Type 1 fonts -- contents of psfonts.map */
struct avl_t1 {
AVL_COMMON;
- _Xconst char *psname; /* PS name of font */
- _Xconst char *fontfile; /* (short) name of pfa/pfb file */
- _Xconst char *encname; /* (short) name of encoding file */
- _Xconst char *addinfo; /* additional PS instructions */
+ const char *psname; /* PS name of font */
+ const char *fontfile; /* (short) name of pfa/pfb file */
+ const char *encname; /* (short) name of encoding file */
+ const char *addinfo; /* additional PS instructions */
# if FREETYPE
Boolean bad; /* if later found to be unloadable */
struct ftfont *ft; /* pointer to FreeType record */
@@ -1024,7 +1016,7 @@ struct ftfont { /* info for FreeType font (Type 1 or TrueType) */
struct avl_enc {
AVL_COMMON;
Boolean valid;
- _Xconst char *vec[256];
+ const char *vec[256];
};
#endif /* FREETYPE || PS */
@@ -1039,7 +1031,7 @@ struct avl_enc {
struct geom_info {
void (*geom_box) ARGS((struct geom_info *,
long, long, long, long));
- void (*geom_special) ARGS((struct geom_info *, _Xconst char *));
+ void (*geom_special) ARGS((struct geom_info *, const char *));
jmp_buf done_env;
void *geom_data;
};
@@ -1062,7 +1054,7 @@ EXTERN Atom atoms[5];
#define XA_WM_PROTOCOLS (atoms[4])
#ifdef SELFAUTO
-EXTERN _Xconst char *argv0; /* argv[0] */
+EXTERN const char *argv0; /* argv[0] */
#endif
#if PS
@@ -1072,10 +1064,10 @@ extern struct psprocs {
void (*destroy) ARGS((void));
void (*interrupt) ARGS((void));
void (*endpage) ARGS((void));
- void (*drawbegin) ARGS((int, int, _Xconst char *));
- void (*drawraw) ARGS((_Xconst char *));
- void (*drawfile) ARGS((_Xconst char *, FILE *));
- void (*drawend) ARGS((_Xconst char *));
+ void (*drawbegin) ARGS((int, int, const char *));
+ void (*drawraw) ARGS((const char *));
+ void (*drawfile) ARGS((const char *, FILE *));
+ void (*drawend) ARGS((const char *));
void (*beginheader) ARGS((void));
void (*endheader) ARGS((void));
void (*newdoc) ARGS((void));
@@ -1089,8 +1081,8 @@ extern struct psprocs {
_XFUNCPROTOBEGIN
-extern int atopix ARGS((_Xconst char *, wide_bool));
-extern Bool compile_action ARGS((_Xconst char *, struct xdvi_action **));
+extern int atopix ARGS((const char *, wide_bool));
+extern Bool compile_action ARGS((const char *, struct xdvi_action **));
#if BUTTONS
extern void create_buttons ARGS((void));
extern void set_button_panel_height ARGS((XtArgVal));
@@ -1099,7 +1091,7 @@ extern void set_button_panel_height ARGS((XtArgVal));
extern void init_plane_masks ARGS((void));
#endif
#if COLOR
-extern Pixel alloc_color ARGS((_Xconst struct rgb *, Pixel));
+extern Pixel alloc_color ARGS((const struct rgb *, Pixel));
extern void do_color_change ARGS((void));
#elif GREY
extern void init_pix ARGS((void));
@@ -1123,13 +1115,13 @@ extern void cancel_timer ARGS((struct xtimer *));
extern unsigned int read_events ARGS((unsigned int));
extern void enable_intr ARGS((void));
extern void do_pages ARGS((void)) NORETURN;
-extern void simple_popup ARGS((struct status_popup *, _Xconst char *,
+extern void simple_popup ARGS((struct status_popup *, const char *,
XtCallbackProc));
extern void simple_popdown ARGS((struct status_popup *));
extern void do_popup ARGS((Widget));
-extern Widget warning_popup ARGS((_Xconst char *, _Xconst char *,
+extern Widget warning_popup ARGS((const char *, const char *,
XtCallbackProc));
-extern Widget warning_popup_long VARGS((_Xconst char *, _Xconst char *,
+extern Widget warning_popup_long VARGS((const char *, const char *,
XtCallbackProc, ...));
extern void Act_print ARGS((Widget, XEvent *, String *, Cardinal *));
extern void Act_open_dvi_file ARGS((Widget, XEvent *, String *,
@@ -1146,7 +1138,7 @@ extern struct font *define_font ARGS((FILE *, wide_ubyte,
struct font *, struct font **, unsigned int,
struct tn **));
extern void init_page ARGS((void));
-extern Boolean open_dvi_file ARGS((_Xconst char *));
+extern Boolean open_dvi_file ARGS((const char *));
extern void form_dvi_property ARGS((ino_t));
extern void init_dvi_file ARGS((void));
extern void set_dvi_property ARGS((void));
@@ -1172,12 +1164,12 @@ extern void prescan ARGS((void));
extern void draw_page ARGS((void));
extern void source_reverse_search ARGS((int, int));
extern void source_special_show ARGS((wide_bool));
-extern void source_forward_search ARGS((_Xconst char *));
+extern void source_forward_search ARGS((const char *));
#if CFGFILE
extern void readconfig ARGS((void));
#endif
#if FREETYPE || PS
-extern FILE *open_t1_font ARGS((struct avl_t1 *, _Xconst char **));
+extern FILE *open_t1_font ARGS((struct avl_t1 *, const char **));
extern void read_encoding ARGS((struct avl_enc *));
#endif
extern void init_font_open ARGS((void));
@@ -1189,18 +1181,18 @@ extern void ps_destroy ARGS((void));
extern void init_prescan ARGS((void));
#if COLOR
extern void scan_color_eop ARGS((void));
-extern void set_fg_color ARGS((_Xconst struct rgb *));
+extern void set_fg_color ARGS((const struct rgb *));
#endif
extern void applicationDoSpecial ARGS((char *));
extern void scan_special ARGS((char *));
extern void geom_do_special ARGS((struct geom_info *, char *, double));
extern void xdvi_exit ARGS((int)) NORETURN;
-extern void oops VARGS((_Xconst char *, ...)) NORETURN;
+extern void oops VARGS((const char *, ...)) NORETURN;
#ifndef KPATHSEA
extern void *xmalloc ARGS((unsigned));
extern void *xrealloc ARGS((void *, unsigned));
-extern char *xstrdup ARGS((_Xconst char *));
-extern char *xmemdup ARGS((_Xconst char *, size_t));
+extern char *xstrdup ARGS((const char *));
+extern char *xmemdup ARGS((const char *, size_t));
#endif
#if !HAVE_STRERROR && !defined strerror
extern char *strerror ARGS((int));
@@ -1208,18 +1200,18 @@ extern char *strerror ARGS((int));
extern void expandline ARGS((size_t));
extern void alloc_bitmap ARGS((struct bitmap *));
#ifndef KPATHSEA
-extern void xputenv ARGS((_Xconst char *, _Xconst char *));
+extern void xputenv ARGS((const char *, const char *));
#endif
-extern int memicmp ARGS((_Xconst char *, _Xconst char *, size_t));
-extern FILE *xfopen ARGS((_Xconst char *, OPEN_MODE_ARGS));
-extern int xopen ARGS((_Xconst char *, int));
+extern int memicmp ARGS((const char *, const char *, size_t));
+extern FILE *xfopen ARGS((const char *, OPEN_MODE_ARGS));
+extern int xopen ARGS((const char *, int));
extern int xpipe ARGS((int *));
-extern DIR *xopendir ARGS((_Xconst char *));
-extern _Xconst struct passwd *ff_getpw ARGS((_Xconst char **, _Xconst char *));
+extern DIR *xopendir ARGS((const char *));
+extern const struct passwd *ff_getpw ARGS((const char **, const char *));
extern unsigned long num ARGS((FILE *, int));
extern long snum ARGS((FILE *, int));
#if FREETYPE || PS
-extern struct avl *avladd ARGS((_Xconst char *, size_t, struct avl **,
+extern struct avl *avladd ARGS((const char *, size_t, struct avl **,
size_t));
#endif
extern size_t property_get_data ARGS((Window, Atom, unsigned char **,
@@ -1239,7 +1231,7 @@ extern Boolean load_ft_font ARGS((struct font *));
#if PS
extern void ps_init_paths ARGS((void));
-extern void drawbegin_none ARGS((int, int, _Xconst char *));
+extern void drawbegin_none ARGS((int, int, const char *));
extern void draw_bbox ARGS((void));
extern void NullProc ARGS((void));
#ifdef PS_DPS
diff --git a/xdvi.icon b/xdvi.icon
@@ -1,6 +1,6 @@
#define xdvi_width 48
#define xdvi_height 48
-static _Xconst unsigned char xdvi_bits[] = {
+static const unsigned char xdvi_bits[] = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x00, 0x00,
0x22, 0x00, 0x00, 0x01, 0x00, 0x00, 0xa2, 0xe0, 0x44, 0x38, 0x95, 0x13,
0x9e, 0x17, 0x45, 0x45, 0x55, 0xf4, 0x82, 0xf0, 0x28, 0x3d, 0xd5, 0x13,