Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 891533
Collapse All | Expand All

(-)a/ar/ar.c (-118 / +46 lines)
Lines 295-305 Link Here
295
   FILE is the name of the file (for error messages).  */
295
   FILE is the name of the file (for error messages).  */
296
296
297
void
297
void
298
mywrite (desc, pbuf, bytes, file)
298
mywrite (int desc, void *pbuf, int bytes, char *file)
299
     int desc;
300
     void *pbuf;
301
     int bytes;
302
     char *file;
303
{
299
{
304
  register int val;
300
  register int val;
305
  register char * buf = pbuf;
301
  register char * buf = pbuf;
Lines 315-323 Link Here
315
}
311
}
316
312
317
int
313
int
318
main (argc, argv)
314
main (int argc, char **argv)
319
     int argc;
320
     char **argv;
321
{
315
{
322
  int i;
316
  int i;
323
317
Lines 513-525 Link Here
513
}
507
}
514
508
515
void
509
void
516
scan (function, crflag)
510
scan (
517
#ifdef __STDC__
511
#ifdef __STDC__
518
     void (*function) (struct member_desc member, FILE *istream);
512
  void (*function) (struct member_desc member, FILE *istream),
519
#else
513
#else
520
     void (*function) ();
514
  void (*function) (),
521
#endif
515
#endif
522
     int crflag;
516
  int crflag)
523
{
517
{
524
  FILE *arcstream = fopen (archive, "r");
518
  FILE *arcstream = fopen (archive, "r");
525
519
Lines 601-609 Link Here
601
}
595
}
602
596
603
void
597
void
604
print_descr (member, instream)
598
print_descr (struct member_desc member, FILE * instream)
605
     struct member_desc member;
606
     FILE * instream;
607
{
599
{
608
  char *timestring;
600
  char *timestring;
609
  if (!verbose)
601
  if (!verbose)
Lines 620-627 Link Here
620
}
612
}
621
613
622
void
614
void
623
print_modes (modes)
615
print_modes (int modes)
624
     int modes;
625
{
616
{
626
  putchar (modes & 0400 ? 'r' : '-');
617
  putchar (modes & 0400 ? 'r' : '-');
627
  putchar (modes & 0200 ? 'w' : '-');
618
  putchar (modes & 0200 ? 'w' : '-');
Lines 637-645 Link Here
637
#define BUFSIZE 1024
628
#define BUFSIZE 1024
638
629
639
void
630
void
640
extract_member (member, istream)
631
extract_member (struct member_desc member, FILE *istream)
641
     struct member_desc member;
642
     FILE *istream;
643
{
632
{
644
  int ncopied = 0;
633
  int ncopied = 0;
645
  FILE *ostream;
634
  FILE *ostream;
Lines 695-703 Link Here
695
}
684
}
696
685
697
void
686
void
698
print_contents (member, istream)
687
print_contents (struct member_desc member, FILE *istream)
699
     struct member_desc member;
700
     FILE *istream;
701
{
688
{
702
  int ncopied = 0;
689
  int ncopied = 0;
703
690
Lines 729-736 Link Here
729
 create a new archive.  */
716
 create a new archive.  */
730
717
731
struct mapelt *
718
struct mapelt *
732
make_map (nonexistent_ok)
719
make_map (int nonexistent_ok)
733
     int nonexistent_ok;
734
{
720
{
735
  struct mapelt mapstart;
721
  struct mapelt mapstart;
736
  mapstart.next = 0;
722
  mapstart.next = 0;
Lines 740-748 Link Here
740
}
726
}
741
727
742
void
728
void
743
add_to_map (member, istream)
729
add_to_map (struct member_desc member, FILE * istream)
744
     struct member_desc member;
745
     FILE * istream;
746
{
730
{
747
  struct mapelt *mapelt = (struct mapelt *) xmalloc (sizeof (struct mapelt));
731
  struct mapelt *mapelt = (struct mapelt *) xmalloc (sizeof (struct mapelt));
748
  mapelt->info = member;
732
  mapelt->info = member;
Lines 755-762 Link Here
755
/* Return the last element of the specified map.  */
739
/* Return the last element of the specified map.  */
756
740
757
struct mapelt *
741
struct mapelt *
758
last_mapelt (map)
742
last_mapelt (struct mapelt *map)
759
     struct mapelt *map;
760
{
743
{
761
  struct mapelt *tail = map;
744
  struct mapelt *tail = map;
762
  while (tail->next) tail = tail->next;
745
  while (tail->next) tail = tail->next;
Lines 766-773 Link Here
766
/* Return the element of the specified map which precedes elt.  */
749
/* Return the element of the specified map which precedes elt.  */
767
750
768
struct mapelt *
751
struct mapelt *
769
prev_mapelt (map, elt)
752
prev_mapelt (struct mapelt *map, struct mapelt *elt)
770
     struct mapelt *map, *elt;
771
{
753
{
772
  struct mapelt *tail = map;
754
  struct mapelt *tail = map;
773
  while (tail->next && tail->next != elt)
755
  while (tail->next && tail->next != elt)
Lines 779-787 Link Here
779
/* Return the element of the specified map which has the specified name.  */
761
/* Return the element of the specified map which has the specified name.  */
780
762
781
struct mapelt *
763
struct mapelt *
782
find_mapelt_noerror (map, name)
764
find_mapelt_noerror (struct mapelt *map, register char *name)
783
     struct mapelt *map;
784
     register char *name;
785
{
765
{
786
  register struct mapelt *tail;
766
  register struct mapelt *tail;
787
  unsigned int len;
767
  unsigned int len;
Lines 816-824 Link Here
816
}
796
}
817
797
818
struct mapelt *
798
struct mapelt *
819
find_mapelt (map, name)
799
find_mapelt (struct mapelt *map, char *name)
820
     struct mapelt *map;
821
     char *name;
822
{
800
{
823
  register struct mapelt *found = find_mapelt_noerror (map, name);
801
  register struct mapelt *found = find_mapelt_noerror (map, name);
824
  if (found == 0)
802
  if (found == 0)
Lines 934-942 Link Here
934
*/
912
*/
935
913
936
void
914
void
937
write_archive (map, appendflag)
915
write_archive (struct mapelt *map, int appendflag)
938
     struct mapelt *map;
939
     int appendflag;
940
{
916
{
941
  char *tempname = make_tempname (archive);
917
  char *tempname = make_tempname (archive);
942
  int indesc = lock_indesc;
918
  int indesc = lock_indesc;
Lines 1059-1067 Link Here
1059
}
1035
}
1060
1036
1061
void
1037
void
1062
header_from_map (header, mapelt)
1038
header_from_map (struct ar_hdr *header, struct mapelt *mapelt)
1063
     struct ar_hdr *header;
1064
     struct mapelt *mapelt;
1065
{
1039
{
1066
  unsigned int namelen;
1040
  unsigned int namelen;
1067
  char *p;
1041
  char *p;
Lines 1116-1123 Link Here
1116
/* gets just the file part of name */
1090
/* gets just the file part of name */
1117
1091
1118
char *
1092
char *
1119
basename (path)
1093
basename (char *path)
1120
     char *path;
1121
{
1094
{
1122
  char *save, *start;
1095
  char *save, *start;
1123
  for (start = save = path; *path; path++)
1096
  for (start = save = path; *path; path++)
Lines 1132-1142 Link Here
1132
1105
1133
/* writes to file open on OUTDESC with name OUTNAME.  */
1106
/* writes to file open on OUTDESC with name OUTNAME.  */
1134
void
1107
void
1135
copy_out_member (mapelt, archive_indesc, outdesc, outname)
1108
copy_out_member (struct mapelt *mapelt, int archive_indesc, int outdesc, char *outname)
1136
     struct mapelt *mapelt;
1137
     int archive_indesc;
1138
     int outdesc;
1139
     char *outname;
1140
{
1109
{
1141
  struct ar_hdr header;
1110
  struct ar_hdr header;
1142
  int indesc;
1111
  int indesc;
Lines 1192-1200 Link Here
1192
   It is open on OUTDESC and its name is OUTNAME.  */
1161
   It is open on OUTDESC and its name is OUTNAME.  */
1193
1162
1194
void
1163
void
1195
touch_symdef_member (outdesc, outname)
1164
touch_symdef_member (int outdesc, char *outname)
1196
     int outdesc;
1197
     char *outname;
1198
{
1165
{
1199
  struct stat statbuf;
1166
  struct stat statbuf;
1200
  int i;
1167
  int i;
Lines 1215-1222 Link Here
1215
}
1182
}
1216
1183
1217
char *
1184
char *
1218
make_tempname (name)
1185
make_tempname (char *name)
1219
     char *name;
1220
{
1186
{
1221
#if defined(USG) || defined(SHORT_FILENAME)
1187
#if defined(USG) || defined(SHORT_FILENAME)
1222
  /* sigh. 14 character filenames are *wonderful*, just *wonderful*. */
1188
  /* sigh. 14 character filenames are *wonderful*, just *wonderful*. */
Lines 1264-1272 Link Here
1264
}
1230
}
1265
1231
1266
void
1232
void
1267
delete_from_map (name, map)
1233
delete_from_map (char *name, struct mapelt *map)
1268
     char *name;
1269
     struct mapelt *map;
1270
{
1234
{
1271
  struct mapelt *this = find_mapelt (map, name);
1235
  struct mapelt *this = find_mapelt (map, name);
1272
1236
Lines 1321-1329 Link Here
1321
}
1285
}
1322
1286
1323
int
1287
int
1324
move_in_map (name, map, after)
1288
move_in_map (char *name, struct mapelt *map, struct mapelt *after)
1325
     char *name;
1326
     struct mapelt *map, *after;
1327
{
1289
{
1328
  struct mapelt *this = find_mapelt (map, name);
1290
  struct mapelt *this = find_mapelt (map, name);
1329
  struct mapelt *prev;
1291
  struct mapelt *prev;
Lines 1430-1438 Link Here
1430
   exist or (optionally) is older.  */
1392
   exist or (optionally) is older.  */
1431
1393
1432
int
1394
int
1433
insert_in_map (name, map, after)
1395
insert_in_map (char *name, struct mapelt *map, struct mapelt *after)
1434
     char *name;
1435
     struct mapelt *map, *after;
1436
{
1396
{
1437
  struct mapelt *old = find_mapelt_noerror (map, name);
1397
  struct mapelt *old = find_mapelt_noerror (map, name);
1438
  struct mapelt *this;
1398
  struct mapelt *this;
Lines 1474-1484 Link Here
1474
*/
1434
*/
1475
1435
1476
void
1436
void
1477
extract_members (function)
1437
extract_members (
1478
#ifdef __STDC__
1438
#ifdef __STDC__
1479
     void (*function) (struct member_desc member, FILE *istream);
1439
     void (*function) (struct member_desc member, FILE *istream))
1480
#else
1440
#else
1481
     void (*function) ();
1441
     void (*function) ())
1482
#endif
1442
#endif
1483
{
1443
{
1484
  struct mapelt *map;
1444
  struct mapelt *map;
Lines 1513-1523 Link Here
1513
   are descriptor and name of file to write to.  */
1473
   are descriptor and name of file to write to.  */
1514
1474
1515
void
1475
void
1516
write_symdef_member (mapelt, map, outdesc, outname)
1476
write_symdef_member (struct mapelt *mapelt, struct mapelt *map, int outdesc, char *outname)
1517
     struct mapelt *mapelt;
1518
     struct mapelt *map;
1519
     int outdesc;
1520
     char *outname;
1521
{
1477
{
1522
  struct ar_hdr header;
1478
  struct ar_hdr header;
1523
  struct mapelt *mapptr;
1479
  struct mapelt *mapptr;
Lines 1590-1598 Link Here
1590
}
1546
}
1591
1547
1592
void
1548
void
1593
read_old_symdefs (map, archive_indesc)
1549
read_old_symdefs (struct mapelt *map, int archive_indesc)
1594
     struct mapelt *map;
1595
     int archive_indesc;
1596
{
1550
{
1597
  struct mapelt *mapelt;
1551
  struct mapelt *mapelt;
1598
  char *data;
1552
  char *data;
Lines 1636-1649 Link Here
1636
   Return 0 for failure or 1 for success.  */
1590
   Return 0 for failure or 1 for success.  */
1637
1591
1638
int
1592
int
1639
read_header_info (mapelt, desc, offset, syms_offset, syms_size, strs_offset, strs_size)
1593
read_header_info (struct mapelt *mapelt, int desc, long int offset, long int *syms_offset,
1640
     struct mapelt *mapelt;
1594
                  unsigned int *syms_size, long int *strs_offset, unsigned int *strs_size)
1641
     int desc;
1642
     long int offset;
1643
     long int *syms_offset;
1644
     unsigned int *syms_size;
1645
     long int *strs_offset;
1646
     unsigned int *strs_size;
1647
{
1595
{
1648
    struct exec hdr;
1596
    struct exec hdr;
1649
    int len;
1597
    int len;
Lines 1683-1691 Link Here
1683
   by reading the file it is coming from.  */
1631
   by reading the file it is coming from.  */
1684
1632
1685
void
1633
void
1686
make_new_symdefs (mapelt, archive_indesc)
1634
make_new_symdefs (struct mapelt *mapelt, int archive_indesc)
1687
     struct mapelt *mapelt;
1688
     int archive_indesc;
1689
{
1635
{
1690
  int indesc;
1636
  int indesc;
1691
  char *name = mapelt->info.name;
1637
  char *name = mapelt->info.name;
Lines 1798-1806 Link Here
1798
   Return the number of symbols left.  */
1744
   Return the number of symbols left.  */
1799
1745
1800
int
1746
int
1801
filter_symbols (syms, symcount)
1747
filter_symbols (struct nlist *syms, unsigned int symcount)
1802
     struct nlist *syms;
1803
     unsigned int symcount;
1804
{
1748
{
1805
  struct nlist *from, *to;
1749
  struct nlist *from, *to;
1806
  struct nlist *end = syms + symcount;
1750
  struct nlist *end = syms + symcount;
Lines 1817-1825 Link Here
1817
/* Update the __.SYMDEF data before writing a new archive.  */
1761
/* Update the __.SYMDEF data before writing a new archive.  */
1818
1762
1819
void
1763
void
1820
update_symdefs (map, archive_indesc)
1764
update_symdefs (struct mapelt *map, int archive_indesc)
1821
     struct mapelt *map;
1822
     int archive_indesc;
1823
{
1765
{
1824
  struct mapelt *tail;
1766
  struct mapelt *tail;
1825
  int pos;
1767
  int pos;
Lines 1987-1995 Link Here
1987
/* Print error message and usage message, and exit.  */
1929
/* Print error message and usage message, and exit.  */
1988
1930
1989
void
1931
void
1990
usage (s1, val)
1932
usage (char *s1, int val)
1991
     char *s1;
1992
     int val;
1993
{
1933
{
1994
  char vbuf[16];
1934
  char vbuf[16];
1995
  sprintf(vbuf, "%d", val);
1935
  sprintf(vbuf, "%d", val);
Lines 2003-2010 Link Here
2003
/* Print error message and exit.  */
1943
/* Print error message and exit.  */
2004
1944
2005
void
1945
void
2006
fatal (s1, s2)
1946
fatal (char *s1, char *s2)
2007
     char *s1, *s2;
2008
{
1947
{
2009
  error (s1, s2);
1948
  error (s1, s2);
2010
  exit (1);
1949
  exit (1);
Lines 2013-2020 Link Here
2013
/* Print error message.  `s1' is printf control string, the rest are args.  */
1952
/* Print error message.  `s1' is printf control string, the rest are args.  */
2014
1953
2015
void
1954
void
2016
error (s1, s2)
1955
error (char *s1, char *s2)
2017
     char *s1, *s2;
2018
{
1956
{
2019
  fprintf (stderr, "%s: ", program_name);
1957
  fprintf (stderr, "%s: ", program_name);
2020
  fprintf (stderr, s1, s2);
1958
  fprintf (stderr, s1, s2);
Lines 2022-2029 Link Here
2022
}
1960
}
2023
1961
2024
void
1962
void
2025
error3 (s1, s2, s3)
1963
error3 (char *s1, char *s2, char *s3)
2026
     char *s1, *s2, *s3;
2027
{
1964
{
2028
  fprintf (stderr, "%s: ", program_name);
1965
  fprintf (stderr, "%s: ", program_name);
2029
  fprintf (stderr, s1, s2, s3);
1966
  fprintf (stderr, s1, s2, s3);
Lines 2031-2039 Link Here
2031
}
1968
}
2032
1969
2033
void
1970
void
2034
error_with_file (string, mapelt)
1971
error_with_file (char *string, struct mapelt *mapelt)
2035
     char *string;
2036
     struct mapelt *mapelt;
2037
{
1972
{
2038
  fprintf (stderr, "%s: ", program_name);
1973
  fprintf (stderr, "%s: ", program_name);
2039
  fprintf (stderr, "%s", string);
1974
  fprintf (stderr, "%s", string);
Lines 2045-2059 Link Here
2045
}
1980
}
2046
1981
2047
void
1982
void
2048
perror_with_name (name)
1983
perror_with_name (char *name)
2049
     char *name;
2050
{
1984
{
2051
  error (concat ("", strerror(errno), " for %s"), name);
1985
  error (concat ("", strerror(errno), " for %s"), name);
2052
}
1986
}
2053
1987
2054
void
1988
void
2055
pfatal_with_name (name)
1989
pfatal_with_name (char *name)
2056
     char *name;
2057
{
1990
{
2058
  fatal (concat ("", strerror(errno), " for %s"), name);
1991
  fatal (concat ("", strerror(errno), " for %s"), name);
2059
}
1992
}
Lines 2062-2069 Link Here
2062
   concatenate those of S1, S2, and S3.  */
1995
   concatenate those of S1, S2, and S3.  */
2063
1996
2064
char *
1997
char *
2065
concat (s1, s2, s3)
1998
concat (const char *s1, const char *s2, const char *s3)
2066
     const char *s1, *s2, *s3;
2067
{
1999
{
2068
  int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
2000
  int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
2069
  char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
2001
  char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
Lines 2079-2086 Link Here
2079
/* Like malloc but get fatal error if memory is exhausted.  */
2011
/* Like malloc but get fatal error if memory is exhausted.  */
2080
2012
2081
char *
2013
char *
2082
xmalloc (size)
2014
xmalloc (unsigned int size)
2083
     unsigned int size;
2084
{
2015
{
2085
#ifdef MALLOC_0_RETURNS_NULL
2016
#ifdef MALLOC_0_RETURNS_NULL
2086
  char *result = malloc (size ? size : 1);
2017
  char *result = malloc (size ? size : 1);
Lines 2093-2101 Link Here
2093
}
2024
}
2094
2025
2095
char *
2026
char *
2096
xrealloc (ptr, size)
2027
xrealloc (char *ptr, unsigned int size)
2097
     char *ptr;
2098
     unsigned int size;
2099
{
2028
{
2100
  char *result = realloc (ptr, size);
2029
  char *result = realloc (ptr, size);
2101
  if (result == 0)
2030
  if (result == 0)
Lines 2106-2113 Link Here
2106
2035
2107
#ifndef HAVE_RENAME
2036
#ifndef HAVE_RENAME
2108
int
2037
int
2109
rename (from, to)
2038
rename (char *from, char *to)
2110
     char *from, *to;
2111
{
2039
{
2112
  (void)unlink (to);
2040
  (void)unlink (to);
2113
  if (link (from, to) < 0
2041
  if (link (from, to) < 0
(-)a/as/alloc.c (-5 / +2 lines)
Lines 53-60 Link Here
53
}
53
}
54
54
55
void * 
55
void * 
56
asalloc(size)
56
asalloc(unsigned int size)
57
unsigned int size;
58
{
57
{
59
    void * rv;
58
    void * rv;
60
#ifdef USE_FIXED_HEAP
59
#ifdef USE_FIXED_HEAP
Lines 75-83 Link Here
75
74
76
75
77
void * 
76
void * 
78
asrealloc(oldptr, size)
77
asrealloc(void * oldptr, unsigned int size)
79
void * oldptr;
80
unsigned int size;
81
{
78
{
82
    void * rv;
79
    void * rv;
83
#ifdef USE_FIXED_HEAP
80
#ifdef USE_FIXED_HEAP
(-)a/as/as.c (-15 / +6 lines)
Lines 37-45 Link Here
37
FORWARD void summ_number P((unsigned num));
37
FORWARD void summ_number P((unsigned num));
38
FORWARD void usage P((void));
38
FORWARD void usage P((void));
39
39
40
PUBLIC int main(argc, argv)
40
PUBLIC int main(int argc, char **argv)
41
int argc;
42
char **argv;
43
{
41
{
44
    init_heap();
42
    init_heap();
45
    initp1();
43
    initp1();
Lines 62-69 Link Here
62
    return 0;
60
    return 0;
63
}
61
}
64
62
65
PUBLIC void as_abort(message)
63
PUBLIC void as_abort(char *message)
66
char *message;
67
{
64
{
68
    write(STDOUT, "as: ", 4);
65
    write(STDOUT, "as: ", 4);
69
    write(STDOUT, message, strlen(message));
66
    write(STDOUT, message, strlen(message));
Lines 138-146 Link Here
138
      ptext();
135
      ptext();
139
}
136
}
140
137
141
PRIVATE int my_creat(name, message)
138
PRIVATE int my_creat(char *name, char *message)
142
char *name;
143
char *message;
144
{
139
{
145
    int fd;
140
    int fd;
146
141
Lines 153-161 Link Here
153
    return fd;
148
    return fd;
154
}
149
}
155
150
156
PRIVATE void process_args(argc, argv)
151
PRIVATE void process_args(int argc, char **argv)
157
int argc;
158
char **argv;
159
{
152
{
160
    char *arg;
153
    char *arg;
161
    bool_t isnextarg;
154
    bool_t isnextarg;
Lines 315-322 Link Here
315
    inidata = (~binaryg & inidata) | (RELBIT | UNDBIT);
308
    inidata = (~binaryg & inidata) | (RELBIT | UNDBIT);
316
}				/* IMPBIT from inidata unless binaryg */
309
}				/* IMPBIT from inidata unless binaryg */
317
310
318
PRIVATE void summary(fd)
311
PRIVATE void summary(int fd)
319
int fd;
320
{
312
{
321
    outfd = fd;
313
    outfd = fd;
322
    writenl();
314
    writenl();
Lines 326-333 Link Here
326
    writesn(" warnings");
318
    writesn(" warnings");
327
}
319
}
328
320
329
PRIVATE void summ_number(num)
321
PRIVATE void summ_number(unsigned num)
330
unsigned num;
331
{
322
{
332
    /* format number like line numbers */
323
    /* format number like line numbers */
333
    char buf[16];
324
    char buf[16];
(-)a/as/express.c (-2 / +1 lines)
Lines 33-40 Link Here
33
    }
33
    }
34
}
34
}
35
35
36
PRIVATE void experror(err_str)
36
PRIVATE void experror(char * err_str)
37
char * err_str;
38
{
37
{
39
    error(err_str);
38
    error(err_str);
40
    expundefined();
39
    expundefined();
(-)a/as/genbin.c (-5 / +2 lines)
Lines 192-199 Link Here
192
192
193
/* write char to binary file or directly to memory */
193
/* write char to binary file or directly to memory */
194
194
195
PUBLIC void putbin(ch)
195
PUBLIC void putbin(opcode_pt ch)
196
opcode_pt ch;
197
{
196
{
198
    if (binfil != 0x0)
197
    if (binfil != 0x0)
199
    {
198
    {
Lines 253-261 Link Here
253
252
254
/* write sized offset to binary file or directly to memory */
253
/* write sized offset to binary file or directly to memory */
255
254
256
PRIVATE void putbinoffset(offset, size)
255
PRIVATE void putbinoffset(offset_t offset, count_t size)
257
offset_t offset;
258
count_t size;
259
{
256
{
260
    char buf[sizeof offset];
257
    char buf[sizeof offset];
261
258
(-)a/as/genlist.c (-28 / +12 lines)
Lines 84-92 Link Here
84
84
85
/* format 1 byte number as 2 hex digits, return ptr to end */
85
/* format 1 byte number as 2 hex digits, return ptr to end */
86
86
87
PRIVATE char *build_1hex_number(num, where)
87
PRIVATE char *build_1hex_number(opcode_pt num, register char *where)
88
opcode_pt num;
89
register char *where;
90
{
88
{
91
    where[0] = hexdigit[((unsigned) num % 256) / 16];
89
    where[0] = hexdigit[((unsigned) num % 256) / 16];
92
    where[1] = hexdigit[(unsigned) num % 16];
90
    where[1] = hexdigit[(unsigned) num % 16];
Lines 95-103 Link Here
95
93
96
/* format 2 byte number as 4 hex digits, return ptr to end */
94
/* format 2 byte number as 4 hex digits, return ptr to end */
97
95
98
PUBLIC char *build_2hex_number(num, where)
96
PUBLIC char *build_2hex_number(unsigned num, char *where)
99
unsigned num;
100
char *where;
101
{
97
{
102
    return build_1hex_number((opcode_pt) num,
98
    return build_1hex_number((opcode_pt) num,
103
			     build_1hex_number((opcode_pt) (num / 256), where));
99
			     build_1hex_number((opcode_pt) (num / 256), where));
Lines 106-115 Link Here
106
/* format 2 byte number as decimal with given width (pad with leading '0's) */
102
/* format 2 byte number as decimal with given width (pad with leading '0's) */
107
/* return ptr to end */
103
/* return ptr to end */
108
104
109
PUBLIC char *build_number(num, width, where)
105
PUBLIC char *build_number(unsigned num, unsigned width, register char *where)
110
unsigned num;
111
unsigned width;
112
register char *where;
113
{
106
{
114
    static unsigned powers_of_10[] = {1, 10, 100, 1000, 10000,};
107
    static unsigned powers_of_10[] = {1, 10, 100, 1000, 10000,};
115
    unsigned char digit;
108
    unsigned char digit;
Lines 131-138 Link Here
131
124
132
/* record number and position of error (or error buffer overflow) */
125
/* record number and position of error (or error buffer overflow) */
133
126
134
PUBLIC void warning(err_str)
127
PUBLIC void warning(char * err_str)
135
char * err_str;
136
{
128
{
137
    if (!as_warn.current) return;
129
    if (!as_warn.current) return;
138
    ++totwarn;
130
    ++totwarn;
Lines 140-147 Link Here
140
    error(err_str);
132
    error(err_str);
141
}
133
}
142
134
143
PUBLIC void error(err_str)
135
PUBLIC void error(char * err_str)
144
char * err_str;
145
{
136
{
146
    register struct error_s *errptr;
137
    register struct error_s *errptr;
147
    register struct error_s *errptrlow;
138
    register struct error_s *errptrlow;
Lines 189-196 Link Here
189
180
190
/* list 1 line unconditionally */
181
/* list 1 line unconditionally */
191
182
192
PRIVATE void list1(fd)
183
PRIVATE void list1(fd_t fd)
193
fd_t fd;
194
{
184
{
195
    outfd = fd;
185
    outfd = fd;
196
    listcode();
186
    listcode();
Lines 413-420 Link Here
413
403
414
/* pad out error line to begin under 1st char of source listing */
404
/* pad out error line to begin under 1st char of source listing */
415
405
416
PRIVATE void paderrorline(nspaces)
406
PRIVATE void paderrorline(unsigned nspaces)
417
unsigned nspaces;
418
{
407
{
419
    int nstars = LINUM_LEN;
408
    int nstars = LINUM_LEN;
420
409
Lines 426-433 Link Here
426
415
427
/* write 1 character */
416
/* write 1 character */
428
417
429
PUBLIC void writec(ch)
418
PUBLIC void writec(char ch)
430
char ch;
431
{
419
{
432
    write(outfd, &ch, 1);
420
    write(outfd, &ch, 1);
433
}
421
}
Lines 441-448 Link Here
441
429
442
/* write 1 offset_t, order to suit target */
430
/* write 1 offset_t, order to suit target */
443
431
444
PUBLIC void writeoff(offset)
432
PUBLIC void writeoff(offset_t offset)
445
offset_t offset;
446
{
433
{
447
    char buf[sizeof offset];
434
    char buf[sizeof offset];
448
435
Lines 456-471 Link Here
456
443
457
/* write string */
444
/* write string */
458
445
459
PUBLIC void writes(s)
446
PUBLIC void writes(char *s)
460
char *s;
461
{
447
{
462
    write(outfd, s, strlen(s));
448
    write(outfd, s, strlen(s));
463
}
449
}
464
450
465
/* write string followed by newline */
451
/* write string followed by newline */
466
452
467
PUBLIC void writesn(s)
453
PUBLIC void writesn(char *s)
468
char *s;
469
{
454
{
470
    writes(s);
455
    writes(s);
471
    writenl();
456
    writenl();
Lines 473-480 Link Here
473
458
474
/* write 1 word, order to suit target */
459
/* write 1 word, order to suit target */
475
460
476
PUBLIC void writew(word)
461
PUBLIC void writew(unsigned word)
477
unsigned word;
478
{
462
{
479
    char buf[2];
463
    char buf[2];
480
464
(-)a/as/genobj.c (-22 / +10 lines)
Lines 28-34 Link Here
28
28
29
FORWARD void flushabs P((void));
29
FORWARD void flushabs P((void));
30
FORWARD void flushrmb P((void));
30
FORWARD void flushrmb P((void));
31
FORWARD void genobjadr P((struct address_s *adrptr, int size));
31
FORWARD void genobjadr P((struct address_s *adrptr, smallcount_t size));
32
FORWARD void putobj1 P((opcode_pt ch));
32
FORWARD void putobj1 P((opcode_pt ch));
33
FORWARD void putobj4 P((u32_T offset));
33
FORWARD void putobj4 P((u32_T offset));
34
FORWARD void putobjoffset P((offset_t offset, count_t size));
34
FORWARD void putobjoffset P((offset_t offset, count_t size));
Lines 37-44 Link Here
37
37
38
/* accumulate RMB requests into 1 (so + and - requests cancel) */
38
/* accumulate RMB requests into 1 (so + and - requests cancel) */
39
39
40
PUBLIC void accumulate_rmb(offset)
40
PUBLIC void accumulate_rmb(offset_t offset)
41
offset_t offset;
42
{
41
{
43
    if (objectc)
42
    if (objectc)
44
    {
43
    {
Lines 212-220 Link Here
212
211
213
/* generate object code for current address */
212
/* generate object code for current address */
214
213
215
PRIVATE void genobjadr(adrptr, size)
214
PRIVATE void genobjadr(struct address_s *adrptr, smallcount_t size)
216
struct address_s *adrptr;
217
smallcount_t size;
218
{
215
{
219
    unsigned char byte;
216
    unsigned char byte;
220
    unsigned symnum;
217
    unsigned symnum;
Lines 590-597 Link Here
590
587
591
/* write char to absolute object code buffer, flush if necessary */
588
/* write char to absolute object code buffer, flush if necessary */
592
589
593
PUBLIC void putabs(ch)
590
PUBLIC void putabs(opcode_pt ch)
594
opcode_pt ch;
595
{
591
{
596
    if (objectc)
592
    if (objectc)
597
    {
593
    {
Lines 605-612 Link Here
605
601
606
/* write char to object code buffer, flush if necessary */
602
/* write char to object code buffer, flush if necessary */
607
603
608
PUBLIC void putobj(ch)
604
PUBLIC void putobj(opcode_pt ch)
609
opcode_pt ch;
610
{
605
{
611
    if (objectc)
606
    if (objectc)
612
    {
607
    {
Lines 618-625 Link Here
618
613
619
/* write char to object code buffer assuming nothing in absolute & rmb bufs */
614
/* write char to object code buffer assuming nothing in absolute & rmb bufs */
620
615
621
PRIVATE void putobj1(ch)
616
PRIVATE void putobj1(opcode_pt ch)
622
opcode_pt ch;
623
{
617
{
624
    if (objbufptr >= objbufend)
618
    if (objbufptr >= objbufend)
625
	flushobj();
619
	flushobj();
Lines 628-635 Link Here
628
622
629
/* write 32 bit offset to object code buffer assuming ... */
623
/* write 32 bit offset to object code buffer assuming ... */
630
624
631
PRIVATE void putobj4(offset)
625
PRIVATE void putobj4(u32_T offset)
632
u32_T offset;
633
{
626
{
634
    char buf[sizeof offset];
627
    char buf[sizeof offset];
635
628
Lines 639-647 Link Here
639
632
640
/* write sized offset to object code buffer assuming ... */
633
/* write sized offset to object code buffer assuming ... */
641
634
642
PRIVATE void putobjoffset(offset, size)
635
PRIVATE void putobjoffset(offset_t offset, count_t size)
643
offset_t offset;
644
count_t size;
645
{
636
{
646
    char buf[sizeof offset];
637
    char buf[sizeof offset];
647
638
Lines 662-669 Link Here
662
653
663
/* write word to object code buffer assuming ... */
654
/* write word to object code buffer assuming ... */
664
655
665
PRIVATE void putobjword(word)
656
PRIVATE void putobjword(unsigned word)
666
unsigned word;
667
{
657
{
668
    char buf[sizeof word];
658
    char buf[sizeof word];
669
659
Lines 674-682 Link Here
674
664
675
/* write several bytes to object code buffer assuming ... */
665
/* write several bytes to object code buffer assuming ... */
676
666
677
PRIVATE void writeobj(buf, count)
667
PRIVATE void writeobj(char *buf, unsigned count)
678
char *buf;
679
unsigned count;
680
{
668
{
681
    do
669
    do
682
	putobj1(*buf++);
670
	putobj1(*buf++);
(-)a/as/gensym.c (-7 / +2 lines)
Lines 137-145 Link Here
137
137
138
/* print symbol nicely formatted for given column */
138
/* print symbol nicely formatted for given column */
139
139
140
PRIVATE int printsym(symptr, column)
140
PRIVATE int printsym(register struct sym_s *symptr, unsigned column)
141
register struct sym_s *symptr;
142
unsigned column;
143
{
141
{
144
    unsigned char length;
142
    unsigned char length;
145
    register struct sym_listing_s *listptr;
143
    register struct sym_listing_s *listptr;
Lines 187-196 Link Here
187
185
188
/* shell sort symbols */
186
/* shell sort symbols */
189
187
190
PRIVATE void sort(array, top, nameflag)
188
PRIVATE void sort(struct sym_s **array, struct sym_s **top, bool_pt nameflag)
191
struct sym_s **array;
192
struct sym_s **top;
193
bool_pt nameflag;
194
{
189
{
195
    int gap;
190
    int gap;
196
    int i;
191
    int i;
(-)a/as/macro.c (-2 / +1 lines)
Lines 15-22 Link Here
15
  next:string. The first string is the macro number in 4 bytes.
15
  next:string. The first string is the macro number in 4 bytes.
16
*/
16
*/
17
17
18
PUBLIC void entermac(symptr)
18
PUBLIC void entermac(struct sym_s *symptr)
19
struct sym_s *symptr;
20
{
19
{
21
    if (maclevel >= MAXMAC)
20
    if (maclevel >= MAXMAC)
22
	error(MACOV);
21
	error(MACOV);
(-)a/as/mops.c (-56 / +27 lines)
Lines 418-425 Link Here
418
FORWARD void yesimmed P((struct ea_s *eap));
418
FORWARD void yesimmed P((struct ea_s *eap));
419
FORWARD void yes_samesize P((void));
419
FORWARD void yes_samesize P((void));
420
420
421
PRIVATE void Eb(eap)
421
PRIVATE void Eb(register struct ea_s *eap)
422
register struct ea_s *eap;
423
{
422
{
424
    Ex(eap);
423
    Ex(eap);
425
    if (eap->size != 0x1)
424
    if (eap->size != 0x1)
Lines 433-440 Link Here
433
    }
432
    }
434
}
433
}
435
434
436
PRIVATE void Ew(eap)
435
PRIVATE void Ew(register struct ea_s *eap)
437
register struct ea_s *eap;
438
{
436
{
439
    Ex(eap);
437
    Ex(eap);
440
    if (eap->size != 0x2)
438
    if (eap->size != 0x2)
Lines 448-500 Link Here
448
    }
446
    }
449
}
447
}
450
448
451
PRIVATE void Ev(eap)
449
PRIVATE void Ev(register struct ea_s *eap)
452
register struct ea_s *eap;
453
{
450
{
454
    Ex(eap);
451
    Ex(eap);
455
    notbytesize(eap);
452
    notbytesize(eap);
456
}
453
}
457
454
458
PRIVATE void Ex(eap)
455
PRIVATE void Ex(register struct ea_s *eap)
459
register struct ea_s *eap;
460
{
456
{
461
    getea(eap);
457
    getea(eap);
462
    notimmed(eap);
458
    notimmed(eap);
463
    notsegorspecreg(eap);
459
    notsegorspecreg(eap);
464
}
460
}
465
461
466
PRIVATE void Gd(eap)
462
PRIVATE void Gd(register struct ea_s *eap)
467
register struct ea_s *eap;
468
{
463
{
469
    Gx(eap);
464
    Gx(eap);
470
    if (eap->size != 0x4)
465
    if (eap->size != 0x4)
471
	kgerror(ILL_SIZE);
466
	kgerror(ILL_SIZE);
472
}
467
}
473
468
474
PRIVATE void Gw(eap)
469
PRIVATE void Gw(register struct ea_s *eap)
475
register struct ea_s *eap;
476
{
470
{
477
    Gx(eap);
471
    Gx(eap);
478
    if (eap->size != 0x2)
472
    if (eap->size != 0x2)
479
	kgerror(ILL_SIZE);
473
	kgerror(ILL_SIZE);
480
}
474
}
481
475
482
PRIVATE void Gv(eap)
476
PRIVATE void Gv(register struct ea_s *eap)
483
register struct ea_s *eap;
484
{
477
{
485
    Gx(eap);
478
    Gx(eap);
486
    notbytesize(eap);
479
    notbytesize(eap);
487
}
480
}
488
481
489
PRIVATE void Gx(eap)
482
PRIVATE void Gx(register struct ea_s *eap)
490
register struct ea_s *eap;
491
{
483
{
492
    Ex(eap);
484
    Ex(eap);
493
    notindirect(eap);
485
    notindirect(eap);
494
}
486
}
495
487
496
PRIVATE void buildea(eap)
488
PRIVATE void buildea(register struct ea_s *eap)
497
register struct ea_s *eap;
498
{
489
{
499
    opsize_t asize;
490
    opsize_t asize;
500
491
Lines 586-594 Link Here
586
    opcode = ESCAPE_OPCODE_BASE | ((opcode & 0x70) >> 0x4);
577
    opcode = ESCAPE_OPCODE_BASE | ((opcode & 0x70) >> 0x4);
587
}
578
}
588
579
589
PRIVATE void buildimm(eap, signflag)
580
PRIVATE void buildimm(register struct ea_s *eap, bool_pt signflag)
590
register struct ea_s *eap;
591
bool_pt signflag;
592
{
581
{
593
    immadr = eap->displ;
582
    immadr = eap->displ;
594
    immcount = eap->size;
583
    immcount = eap->size;
Lines 623-630 Link Here
623
612
624
/* Check size and build segword. */
613
/* Check size and build segword. */
625
614
626
PRIVATE void buildsegword(eap)
615
PRIVATE void buildsegword(register struct ea_s *eap)
627
register struct ea_s *eap;
628
{
616
{
629
    if (eap->size == 0x0)
617
    if (eap->size == 0x0)
630
#ifdef NODEFAULTSIZE
618
#ifdef NODEFAULTSIZE
Lines 642-649 Link Here
642
	segword = regsegword[eap->base];
630
	segword = regsegword[eap->base];
643
}
631
}
644
632
645
PRIVATE void buildunary(opc)
633
PRIVATE void buildunary(opcode_pt opc)
646
opcode_pt opc;
647
{
634
{
648
    if (mcount != 0x0)
635
    if (mcount != 0x0)
649
    {
636
    {
Lines 653-660 Link Here
653
    }
640
    }
654
}
641
}
655
642
656
PRIVATE opsize_pt displsize(eap)
643
PRIVATE opsize_pt displsize(register struct ea_s *eap)
657
register struct ea_s *eap;
658
{
644
{
659
    opsize_t asize;
645
    opsize_t asize;
660
646
Lines 708-715 Link Here
708
    return fpreg;
694
    return fpreg;
709
}
695
}
710
696
711
PRIVATE bool_pt getaccumreg(eap)
697
PRIVATE bool_pt getaccumreg(register struct ea_s * eap)
712
register struct ea_s *eap;
713
{
698
{
714
    if ((eap->base = regchk()) != AXREG && eap->base != ALREG
699
    if ((eap->base = regchk()) != AXREG && eap->base != ALREG
715
	&& eap->base != EAXREG)
700
	&& eap->base != EAXREG)
Lines 769-776 Link Here
769
    buildsegword(&source);
754
    buildsegword(&source);
770
}
755
}
771
756
772
PRIVATE bool_pt getdxreg(eap)
757
PRIVATE bool_pt getdxreg(register struct ea_s *eap)
773
register struct ea_s *eap;
774
{
758
{
775
    if ((eap->base = regchk()) != DXREG)
759
    if ((eap->base = regchk()) != DXREG)
776
	return FALSE;
760
	return FALSE;
Lines 809-816 Link Here
809
  optional-imediate-prefix displ(scaled index)     -- anachronism
793
  optional-imediate-prefix displ(scaled index)     -- anachronism
810
*/
794
*/
811
795
812
PRIVATE void getea(eap)
796
PRIVATE void getea(register struct ea_s *eap)
813
register struct ea_s *eap;
814
{
797
{
815
    bool_t leading_displ;
798
    bool_t leading_displ;
816
    bool_t leading_immed;
799
    bool_t leading_immed;
Lines 967-975 Link Here
967
    needcpu(eap->size==4?3:0);
950
    needcpu(eap->size==4?3:0);
968
}
951
}
969
952
970
PRIVATE void getimmed(eap, immed_count)
953
PRIVATE void getimmed(struct ea_s *eap, count_t immed_count)
971
struct ea_s *eap; 
972
count_t immed_count;
973
{
954
{
974
    getea(eap);
955
    getea(eap);
975
    yesimmed(eap);
956
    yesimmed(eap);
Lines 980-995 Link Here
980
    }
961
    }
981
}
962
}
982
963
983
PRIVATE void getindirect(eap)
964
PRIVATE void getindirect(register struct ea_s *eap)
984
register struct ea_s *eap;
985
{
965
{
986
    getea(eap);
966
    getea(eap);
987
    if (eap->indcount == 0x0)
967
    if (eap->indcount == 0x0)
988
	kgerror(IND_REQ);
968
	kgerror(IND_REQ);
989
}
969
}
990
970
991
PRIVATE void getshift(eap)
971
PRIVATE void getshift(register struct ea_s *eap)
992
register struct ea_s *eap;
993
{
972
{
994
    getcomma();
973
    getcomma();
995
    getea(eap);
974
    getea(eap);
Lines 1003-1010 Link Here
1003
  Return register number (adjusted if necessary to a legal index) or NOREG.
982
  Return register number (adjusted if necessary to a legal index) or NOREG.
1004
*/
983
*/
1005
984
1006
PRIVATE reg_pt indregchk(matchreg)
985
PRIVATE reg_pt indregchk(reg_pt matchreg)
1007
reg_pt matchreg;
1008
{
986
{
1009
    reg_pt reg;
987
    reg_pt reg;
1010
988
Lines 1050-1064 Link Here
1050
    return reg;
1028
    return reg;
1051
}
1029
}
1052
1030
1053
PRIVATE void kgerror(err_str)
1031
PRIVATE void kgerror(char * err_str)
1054
char * err_str;
1055
{
1032
{
1056
    error(err_str);
1033
    error(err_str);
1057
    sprefix = oprefix = aprefix = mcount = 0x0;
1034
    sprefix = oprefix = aprefix = mcount = 0x0;
1058
}
1035
}
1059
1036
1060
PRIVATE void lbranch(backamount)
1037
PRIVATE void lbranch(int backamount)
1061
int backamount;
1062
{
1038
{
1063
    mcount += defsize + 0x1;
1039
    mcount += defsize + 0x1;
1064
    segadj();
1040
    segadj();
Lines 2314-2349 Link Here
2314
    buildregular();
2290
    buildregular();
2315
}
2291
}
2316
2292
2317
PRIVATE void notbytesize(eap)
2293
PRIVATE void notbytesize(register struct ea_s *eap)
2318
register struct ea_s *eap;
2319
{
2294
{
2320
    if (eap->size == 0x1)
2295
    if (eap->size == 0x1)
2321
	kgerror(ILL_SIZE);
2296
	kgerror(ILL_SIZE);
2322
}
2297
}
2323
2298
2324
PRIVATE void notimmed(eap)
2299
PRIVATE void notimmed(register struct ea_s *eap)
2325
register struct ea_s *eap;
2326
{
2300
{
2327
    if (eap->indcount == 0x0 && eap->base == NOREG)
2301
    if (eap->indcount == 0x0 && eap->base == NOREG)
2328
	kgerror(ILL_IMM_MODE);
2302
	kgerror(ILL_IMM_MODE);
2329
}
2303
}
2330
2304
2331
PRIVATE void notindirect(eap)
2305
PRIVATE void notindirect(register struct ea_s *eap)
2332
register struct ea_s *eap;
2333
{
2306
{
2334
    if (eap->indcount != 0x0)
2307
    if (eap->indcount != 0x0)
2335
	kgerror(ILL_IND);
2308
	kgerror(ILL_IND);
2336
}
2309
}
2337
2310
2338
PRIVATE void notsegorspecreg(eap)
2311
PRIVATE void notsegorspecreg(register struct ea_s *eap)
2339
register struct ea_s *eap;
2340
{
2312
{
2341
    if (regsegword[eap->base] >= SEGMOV)
2313
    if (regsegword[eap->base] >= SEGMOV)
2342
	kgerror(ILLREG);
2314
	kgerror(ILLREG);
2343
}
2315
}
2344
2316
2345
PRIVATE void yesimmed(eap)
2317
PRIVATE void yesimmed(register struct ea_s *eap)
2346
register struct ea_s *eap;
2347
{
2318
{
2348
    if (eap->indcount == 0x1)
2319
    if (eap->indcount == 0x1)
2349
	eap->indcount = 0x0;
2320
	eap->indcount = 0x0;
(-)a/as/pops.c (-24 / +12 lines)
Lines 17-33 Link Here
17
FORWARD void constdata P((unsigned size));
17
FORWARD void constdata P((unsigned size));
18
FORWARD void docomm P((void));
18
FORWARD void docomm P((void));
19
FORWARD void doelseif P((pfv func));
19
FORWARD void doelseif P((pfv func));
20
FORWARD void doequset P((int labits));
20
FORWARD void doequset P((unsigned char labits));
21
FORWARD void doentexp P((int entbits, int impbits));
21
FORWARD void doentexp P((unsigned char entbits, unsigned char impbits));
22
FORWARD void dofcc P((void));
22
FORWARD void dofcc P((void));
23
FORWARD void doif P((pfv func));
23
FORWARD void doif P((pfv func));
24
FORWARD struct sym_s *needlabel P((void));
24
FORWARD struct sym_s *needlabel P((void));
25
FORWARD void showredefinedlabel P((void));
25
FORWARD void showredefinedlabel P((void));
26
FORWARD void setloc P((unsigned seg));
26
FORWARD void setloc P((unsigned seg));
27
27
28
PRIVATE void bumpsem(flagptr, defval)
28
PRIVATE void bumpsem(register struct flags_s *flagptr, int defval)
29
register struct flags_s *flagptr;
30
int defval;
31
{
29
{
32
    int newcount;
30
    int newcount;
33
31
Lines 70-77 Link Here
70
/* check symbol is either undefined */
68
/* check symbol is either undefined */
71
/* or has the same segment & relocatability as lc */
69
/* or has the same segment & relocatability as lc */
72
70
73
PUBLIC bool_pt checksegrel(symptr)
71
PUBLIC bool_pt checksegrel(register struct sym_s *symptr)
74
register struct sym_s *symptr;
75
{
72
{
76
    if ((symptr->type & LABIT ||
73
    if ((symptr->type & LABIT ||
77
	(symptr->data & IMPBIT && !(symptr->data & UNDBIT))) &&
74
	(symptr->data & IMPBIT && !(symptr->data & UNDBIT))) &&
Lines 94-101 Link Here
94
91
95
/* allocate constant data (zero except for size 1), default zero for size 1 */
92
/* allocate constant data (zero except for size 1), default zero for size 1 */
96
93
97
PRIVATE void constdata(size)
94
PRIVATE void constdata(unsigned size)
98
unsigned size;
99
{
95
{
100
    offset_t remaining;
96
    offset_t remaining;
101
97
Lines 157-164 Link Here
157
153
158
/* common routine for ELSEIF/ELSEIFC */
154
/* common routine for ELSEIF/ELSEIFC */
159
155
160
PRIVATE void doelseif(func)
156
PRIVATE void doelseif(pfv func)
161
pfv func;
162
{
157
{
163
    if (iflevel == 0)
158
    if (iflevel == 0)
164
	error(ELSEIFBAD);
159
	error(ELSEIFBAD);
Lines 186-193 Link Here
186
181
187
/* common routine for EQU/SET */
182
/* common routine for EQU/SET */
188
183
189
PRIVATE void doequset(labits)
184
PRIVATE void doequset(unsigned char labits)
190
unsigned char labits;
191
{
185
{
192
    register struct sym_s *labptr;
186
    register struct sym_s *labptr;
193
    unsigned char olddata;
187
    unsigned char olddata;
Lines 230-238 Link Here
230
224
231
/* common routine for ENTRY/EXPORT */
225
/* common routine for ENTRY/EXPORT */
232
226
233
PRIVATE void doentexp(entbits, impbits)
227
PRIVATE void doentexp(unsigned char entbits, unsigned char impbits)
234
unsigned char entbits;
235
unsigned char impbits;
236
{
228
{
237
    struct sym_s *symptr;
229
    struct sym_s *symptr;
238
230
Lines 389-396 Link Here
389
381
390
/* common routine for IF/IFC */
382
/* common routine for IF/IFC */
391
383
392
PRIVATE void doif(func)
384
PRIVATE void doif(pfv func)
393
pfv func;
394
{
385
{
395
    if (iflevel >= MAXIF)
386
    if (iflevel >= MAXIF)
396
	error(IFOV);
387
	error(IFOV);
Lines 420-427 Link Here
420
    }
411
    }
421
}
412
}
422
413
423
PUBLIC void fatalerror(err_str)
414
PUBLIC void fatalerror(char * err_str)
424
char * err_str;
425
{
415
{
426
    error(err_str);
416
    error(err_str);
427
    skipline();
417
    skipline();
Lines 432-439 Link Here
432
/* swap position with label position, do error, put back posn */
422
/* swap position with label position, do error, put back posn */
433
/* also clear label ptr */
423
/* also clear label ptr */
434
424
435
PUBLIC void labelerror(err_str)
425
PUBLIC void labelerror(char * err_str)
436
char * err_str;
437
{
426
{
438
    struct sym_s *oldgsymptr;
427
    struct sym_s *oldgsymptr;
439
    char *oldlineptr;
428
    char *oldlineptr;
Lines 1095-1102 Link Here
1095
1084
1096
/* set location segment */
1085
/* set location segment */
1097
1086
1098
PRIVATE void setloc(seg)
1087
PRIVATE void setloc(unsigned seg)
1099
unsigned seg;
1100
{
1088
{
1101
    if (pass == last_pass && seg != (lcdata & SEGM))
1089
    if (pass == last_pass && seg != (lcdata & SEGM))
1102
	putobj((opcode_pt) (seg | OBJ_SET_SEG));
1090
	putobj((opcode_pt) (seg | OBJ_SET_SEG));
(-)a/as/proto.h (-1 / +1 lines)
Lines 34-40 Link Here
34
void warning P((char * errorstr));
34
void warning P((char * errorstr));
35
void error P((char * errorstr));
35
void error P((char * errorstr));
36
void listline P((void));
36
void listline P((void));
37
void writec P((int ch));
37
void writec P((char ch));
38
void writenl P((void));
38
void writenl P((void));
39
void writeoff P((offset_t offset));
39
void writeoff P((offset_t offset));
40
void writes P((char *s));
40
void writes P((char *s));
(-)a/as/readsrc.c (-11 / +4 lines)
Lines 87-94 Link Here
87
    clearsource();		/* sentinel to invoke blank skipping */
87
    clearsource();		/* sentinel to invoke blank skipping */
88
}
88
}
89
89
90
PUBLIC fd_t open_input(name)
90
PUBLIC fd_t open_input(char *name)
91
char *name;
92
{
91
{
93
    fd_t fd;
92
    fd_t fd;
94
#if BIGBUFFER == 1
93
#if BIGBUFFER == 1
Lines 455-464 Link Here
455
PRIVATE long ftpos = 0;
454
PRIVATE long ftpos = 0;
456
PRIVATE int  lastfd = -1;
455
PRIVATE int  lastfd = -1;
457
456
458
PRIVATE int inp_line(fd, buf, size)
457
PRIVATE int inp_line(int fd, char * buf, int size)
459
int fd;
460
char * buf;
461
int size;
462
{
458
{
463
   int offt = 0;
459
   int offt = 0;
464
   if( fd!=lastfd ) inp_seek(-1, 0L);
460
   if( fd!=lastfd ) inp_seek(-1, 0L);
Lines 479-486 Link Here
479
   return offt;
475
   return offt;
480
}
476
}
481
477
482
PRIVATE long inp_tell(fd)
478
PRIVATE long inp_tell(int fd)
483
int fd;
484
{
479
{
485
   if( fd != lastfd )
480
   if( fd != lastfd )
486
      return lseek(fd, 0L, 1);
481
      return lseek(fd, 0L, 1);
Lines 488-496 Link Here
488
      return ftpos + in_start;
483
      return ftpos + in_start;
489
}
484
}
490
485
491
PRIVATE void inp_seek(fd, posn)
486
PRIVATE void inp_seek(int fd, long posn)
492
int fd;
493
long posn;
494
{
487
{
495
   if( lastfd != -1 )
488
   if( lastfd != -1 )
496
      lseek(lastfd, ftpos+in_start, 0);
489
      lseek(lastfd, ftpos+in_start, 0);
(-)a/as/table.c (-4 / +2 lines)
Lines 30-36 Link Here
30
FORWARD void printchain P((void));
30
FORWARD void printchain P((void));
31
#endif
31
#endif
32
32
33
FORWARD void install P((register char *keyptr, int data));
33
FORWARD void install P((register char *keyptr, unsigned char data));
34
34
35
PUBLIC void inst_keywords()
35
PUBLIC void inst_keywords()
36
{
36
{
Lines 48-56 Link Here
48
#endif
48
#endif
49
}
49
}
50
50
51
PRIVATE void install(keyptr, data)
51
PRIVATE void install(register char *keyptr, unsigned char data)
52
register char *keyptr;
53
unsigned char data;
54
{
52
{
55
    char lowcasebuf[20];
53
    char lowcasebuf[20];
56
    unsigned namelength;
54
    unsigned namelength;
(-)a/as/typeconv.c (-28 / +10 lines)
Lines 11-17 Link Here
11
#include "globvar.h"
11
#include "globvar.h"
12
12
13
void xxerr P((char *));
13
void xxerr P((char *));
14
void xxerr(x) char * x; { write(2, x, strlen(x)); }
14
void xxerr(char *x) { write(2, x, strlen(x)); }
15
15
16
#ifdef __AS386_16__
16
#ifdef __AS386_16__
17
static int no_swap   = 1;
17
static int no_swap   = 1;
Lines 20-28 Link Here
20
static int long_off[4] = {0,1,2,3};
20
static int long_off[4] = {0,1,2,3};
21
static int int_off[2] = {0,1};
21
static int int_off[2] = {0,1};
22
22
23
PUBLIC bool_pt typeconv_init(big_endian, long_big_endian)
23
PUBLIC bool_pt typeconv_init(bool_pt big_endian, bool_pt long_big_endian)
24
bool_pt big_endian;
25
bool_pt long_big_endian;
26
{
24
{
27
   int i;
25
   int i;
28
#ifdef __AS386_16__
26
#ifdef __AS386_16__
Lines 47-55 Link Here
47
   return 1;
45
   return 1;
48
}
46
}
49
47
50
PUBLIC void u2c2(buf, offset)
48
PUBLIC void u2c2(char *buf, u2_pt offset)
51
char *buf;
52
u2_pt offset;
53
{
49
{
54
#ifdef __AS386_16__
50
#ifdef __AS386_16__
55
   if( no_swap )
51
   if( no_swap )
Lines 62-70 Link Here
62
   buf[int_off[1]] = (offset>>8);
58
   buf[int_off[1]] = (offset>>8);
63
}
59
}
64
60
65
PUBLIC void u4c4(buf, offset)
61
PUBLIC void u4c4(char *buf, u4_t offset)
66
char *buf;
67
u4_t offset;
68
{
62
{
69
   int i;
63
   int i;
70
#ifdef __AS386_16__
64
#ifdef __AS386_16__
Lines 81-90 Link Here
81
   }
75
   }
82
}
76
}
83
77
84
PUBLIC void u4cn(buf, offset, count)
78
PUBLIC void u4cn(char *buf, u4_t offset, unsigned count)
85
char *buf;
86
u4_t offset;
87
unsigned count;
88
{
79
{
89
    switch(count)
80
    switch(count)
90
    {
81
    {
Lines 103-112 Link Here
103
    }
94
    }
104
}
95
}
105
96
106
PUBLIC void u2cn(buf, offset, count)
97
PUBLIC void u2cn(char *buf, u2_pt offset, unsigned count)
107
char *buf;
108
u2_pt offset;
109
unsigned count;
110
{
98
{
111
    switch(count)
99
    switch(count)
112
    {
100
    {
Lines 125-132 Link Here
125
    }
113
    }
126
}
114
}
127
115
128
PUBLIC u2_pt c2u2(buf)
116
PUBLIC u2_pt c2u2(char *buf)
129
char *buf;
130
{
117
{
131
    u2_pt res;
118
    u2_pt res;
132
#ifdef __AS386_16__
119
#ifdef __AS386_16__
Lines 138-145 Link Here
138
    return res;
125
    return res;
139
}
126
}
140
127
141
PUBLIC u4_t c4u4(buf)
128
PUBLIC u4_t c4u4(char *buf)
142
char *buf;
143
{
129
{
144
    u4_t res;
130
    u4_t res;
145
    int i;
131
    int i;
Lines 154-162 Link Here
154
    return res;
140
    return res;
155
}
141
}
156
142
157
PUBLIC u4_t cnu4(buf, count)
143
PUBLIC u4_t cnu4(char *buf, unsigned count)
158
char *buf;
159
unsigned count;
160
{
144
{
161
    switch (count)
145
    switch (count)
162
    {
146
    {
Lines 174-182 Link Here
174
    }
158
    }
175
}
159
}
176
160
177
PUBLIC u2_pt cnu2(buf, count)
161
PUBLIC u2_pt cnu2(char *buf, unsigned count)
178
char *buf;
179
unsigned count;
180
{
162
{
181
    switch (count)
163
    switch (count)
182
    {
164
    {
(-)a/bcc/assign.c (-19 / +6 lines)
Lines 15-23 Link Here
15
		      struct symstruct *source, uoffset_T size));
15
		      struct symstruct *source, uoffset_T size));
16
FORWARD void fconvert P((struct symstruct *source, struct typestruct *type));
16
FORWARD void fconvert P((struct symstruct *source, struct typestruct *type));
17
17
18
PUBLIC void assign(source, target)
18
PUBLIC void assign(struct symstruct *source, struct symstruct *target)
19
struct symstruct *source;
20
struct symstruct *target;
21
{
19
{
22
    store_pt regpushed;
20
    store_pt regpushed;
23
    store_pt sourcereg;
21
    store_pt sourcereg;
Lines 148-156 Link Here
148
146
149
/* block move assumes itypesize == accregsize && BREG size == 1 */
147
/* block move assumes itypesize == accregsize && BREG size == 1 */
150
148
151
PRIVATE void blockmove(source, target)
149
PRIVATE void blockmove(struct symstruct *source, struct symstruct *target)
152
struct symstruct *source;
153
struct symstruct *target;
154
{
150
{
155
    struct symstruct oldtarget;
151
    struct symstruct oldtarget;
156
    uoffset_T typesize;
152
    uoffset_T typesize;
Lines 196-206 Link Here
196
    *target = oldtarget;
192
    *target = oldtarget;
197
}
193
}
198
194
199
PRIVATE void call3(funcname, target, source, size)
195
PRIVATE void call3(char *funcname, struct symstruct *target, struct symstruct *source, uoffset_T size)
200
char *funcname;
201
struct symstruct *target;
202
struct symstruct *source;
203
uoffset_T size;
204
{
196
{
205
    store_pt regpushed;
197
    store_pt regpushed;
206
    offset_T spmark;
198
    offset_T spmark;
Lines 222-230 Link Here
222
    }
214
    }
223
}
215
}
224
216
225
PUBLIC void cast(type, target)
217
PUBLIC void cast(struct typestruct *type, struct symstruct *target)
226
struct typestruct *type;
227
struct symstruct *target;
228
{
218
{
229
    scalar_t newscalar;
219
    scalar_t newscalar;
230
    uoffset_T newsize;
220
    uoffset_T newsize;
Lines 343-350 Link Here
343
333
344
/* extend char or short to int (unsigned if from unsigned) */
334
/* extend char or short to int (unsigned if from unsigned) */
345
335
346
PUBLIC void extend(target)
336
PUBLIC void extend(struct symstruct *target)
347
struct symstruct *target;
348
{
337
{
349
    scalar_t tscalar;
338
    scalar_t tscalar;
350
339
Lines 376-384 Link Here
376
    }
365
    }
377
}
366
}
378
367
379
PRIVATE void fconvert(source, type)
368
PRIVATE void fconvert(struct symstruct *source, struct typestruct *type)
380
struct symstruct *source;
381
struct typestruct *type;
382
{
369
{
383
    offset_T spmark;
370
    offset_T spmark;
384
371
(-)a/bcc/bcc.c (-54 / +23 lines)
Lines 191-199 Link Here
191
char * libc = "-lc";
191
char * libc = "-lc";
192
192
193
int
193
int
194
main(argc, argv)
194
main(int argc, char ** argv)
195
int argc;
196
char ** argv;
197
{
195
{
198
   struct file_list * next_file;
196
   struct file_list * next_file;
199
   char * temp;
197
   char * temp;
Lines 277-298 Link Here
277
}
275
}
278
276
279
char *
277
char *
280
copystr(str)
278
copystr(char * str)
281
char * str;
282
{
279
{
283
   return strcpy(xalloc(strlen(str)+1), str);
280
   return strcpy(xalloc(strlen(str)+1), str);
284
}
281
}
285
282
286
char *
283
char *
287
catstr(str, str2)
284
catstr(char * str, char * str2)
288
char * str, * str2;
289
{
285
{
290
   return strcat(strcpy(xalloc(strlen(str)+strlen(str2)+1), str), str2);
286
   return strcat(strcpy(xalloc(strlen(str)+strlen(str2)+1), str), str2);
291
}
287
}
292
288
293
void
289
void
294
run_aspreproc(file)
290
run_aspreproc(struct file_list * file)
295
struct file_list * file;
296
{
291
{
297
   static char cc1bcc[] = CC1BCC;
292
   static char cc1bcc[] = CC1BCC;
298
293
Lines 319-326 Link Here
319
}
314
}
320
315
321
void
316
void
322
run_preproc(file)
317
run_preproc(struct file_list * file)
323
struct file_list * file;
324
{
318
{
325
   int last_stage = 0;
319
   int last_stage = 0;
326
   int combined_cpp;
320
   int combined_cpp;
Lines 373-380 Link Here
373
}
367
}
374
368
375
void
369
void
376
run_unproto(file)
370
run_unproto(struct file_list * file)
377
struct file_list * file;
378
{
371
{
379
   command.cmd = UNPROTO;
372
   command.cmd = UNPROTO;
380
   command_reset();
373
   command_reset();
Lines 385-392 Link Here
385
}
378
}
386
379
387
void
380
void
388
run_compile(file)
381
run_compile(struct file_list * file)
389
struct file_list * file;
390
{
382
{
391
   if (opt_arch == 3)   command.cmd = CC1C386;
383
   if (opt_arch == 3)   command.cmd = CC1C386;
392
   else if (opt_arch<5) command.cmd = CC1BCC;
384
   else if (opt_arch<5) command.cmd = CC1BCC;
Lines 410-417 Link Here
410
}
402
}
411
403
412
void
404
void
413
run_optim(file)
405
run_optim(struct file_list * file)
414
struct file_list * file;
415
{
406
{
416
   char buf[32];
407
   char buf[32];
417
   if (opt_arch<5) command.cmd = OPTIM;
408
   if (opt_arch<5) command.cmd = OPTIM;
Lines 451-458 Link Here
451
}
442
}
452
443
453
void
444
void
454
run_as(file)
445
run_as(struct file_list * file)
455
struct file_list * file;
456
{
446
{
457
   char * buf;
447
   char * buf;
458
   switch(opt_arch)
448
   switch(opt_arch)
Lines 539-546 Link Here
539
}
529
}
540
530
541
void
531
void
542
validate_link_opt(option)
532
validate_link_opt(char * option)
543
char * option;
544
{
533
{
545
   int err = 0;
534
   int err = 0;
546
   if (option[0] != '-') return;
535
   if (option[0] != '-') return;
Lines 685-692 Link Here
685
}
674
}
686
675
687
void
676
void
688
command_opt(option)
677
command_opt(char * option)
689
char * option;
690
{
678
{
691
   if (command.maxargs <= command.numargs+1) {
679
   if (command.maxargs <= command.numargs+1) {
692
      char ** newbuf = xalloc(command.maxargs*2*sizeof(char**));
680
      char ** newbuf = xalloc(command.maxargs*2*sizeof(char**));
Lines 708-715 Link Here
708
}
696
}
709
697
710
void
698
void
711
command_opts(optkey)
699
command_opts(int optkey)
712
int optkey;
713
{
700
{
714
   struct opt_list * ol;
701
   struct opt_list * ol;
715
   for(ol=options; ol; ol=ol->next)
702
   for(ol=options; ol; ol=ol->next)
Lines 717-727 Link Here
717
	 command_opt(ol->opt);
704
	 command_opt(ol->opt);
718
}
705
}
719
706
720
void newfilename(file, last_stage, new_extn, use_o)
707
void newfilename(struct file_list * file, int last_stage, int new_extn, int use_o)
721
struct file_list * file;
722
int last_stage;
723
int new_extn;
724
int use_o;
725
{
708
{
726
   file->filetype = new_extn;
709
   file->filetype = new_extn;
727
   if (file->oldfile) free(file->oldfile);
710
   if (file->oldfile) free(file->oldfile);
Lines 787-795 Link Here
787
}
770
}
788
771
789
void
772
void
790
getargs(argc, argv)
773
getargs(int argc, char ** argv)
791
int argc;
792
char ** argv;
793
{
774
{
794
   int ar;
775
   int ar;
795
   char * pflag = 0;
776
   char * pflag = 0;
Lines 1122-1129 Link Here
1122
}
1103
}
1123
1104
1124
void
1105
void
1125
build_prefix(path1, path2, path3)
1106
build_prefix(char * path1, char * path2, char * path3)
1126
char * path1, * path2, * path3;
1127
{
1107
{
1128
   char * newstr;
1108
   char * newstr;
1129
   int l;
1109
   int l;
Lines 1142-1149 Link Here
1142
}
1122
}
1143
1123
1144
void
1124
void
1145
add_prefix(path)
1125
add_prefix(char * path)
1146
char * path;
1147
{
1126
{
1148
   char ** p; 
1127
   char ** p; 
1149
   if (!path || !*path) return;
1128
   if (!path || !*path) return;
Lines 1162-1170 Link Here
1162
   fatal("Too many -B options");
1141
   fatal("Too many -B options");
1163
}
1142
}
1164
1143
1165
void append_file (filename, ftype)
1144
void append_file (char * filename, int ftype)
1166
char * filename;
1167
int ftype;
1168
{
1145
{
1169
   struct file_list * newfile = xalloc(sizeof(struct file_list));
1146
   struct file_list * newfile = xalloc(sizeof(struct file_list));
1170
   char * s;
1147
   char * s;
Lines 1202-1210 Link Here
1202
}
1179
}
1203
1180
1204
void 
1181
void 
1205
append_option (option, otype)
1182
append_option (char * option, int otype)
1206
char * option;
1207
int otype;
1208
{
1183
{
1209
   struct opt_list * newopt = xalloc(sizeof(struct opt_list));
1184
   struct opt_list * newopt = xalloc(sizeof(struct opt_list));
1210
1185
Lines 1222-1230 Link Here
1222
}
1197
}
1223
1198
1224
void 
1199
void 
1225
prepend_option (option, otype)
1200
prepend_option (char * option, int otype)
1226
char * option;
1227
int otype;
1228
{
1201
{
1229
   struct opt_list * newopt = xalloc(sizeof(struct opt_list));
1202
   struct opt_list * newopt = xalloc(sizeof(struct opt_list));
1230
1203
Lines 1235-1242 Link Here
1235
   options = newopt;
1208
   options = newopt;
1236
}
1209
}
1237
1210
1238
char * build_libpath(opt, str, suffix)
1211
char * build_libpath(char * opt, char * str, char * suffix)
1239
char * opt, * str, * suffix;
1240
{
1212
{
1241
   char * newstr;
1213
   char * newstr;
1242
   newstr = xalloc(strlen(opt)+strlen(str)+strlen(prefix_path)+strlen(suffix)+1);
1214
   newstr = xalloc(strlen(opt)+strlen(str)+strlen(prefix_path)+strlen(suffix)+1);
Lines 1248-1255 Link Here
1248
}
1220
}
1249
1221
1250
void *
1222
void *
1251
xalloc (size)
1223
xalloc (int size)
1252
int size;
1253
{
1224
{
1254
   void * p = malloc(size);
1225
   void * p = malloc(size);
1255
   if (!p) fatal("Out of memory");
1226
   if (!p) fatal("Out of memory");
Lines 1273-1280 Link Here
1273
   exit(1);
1244
   exit(1);
1274
}
1245
}
1275
1246
1276
void fatal(str)
1247
void fatal(char * str)
1277
char * str;
1278
{
1248
{
1279
   fprintf(stderr, "%s: Fatal error: %s.\n", progname, str);
1249
   fprintf(stderr, "%s: Fatal error: %s.\n", progname, str);
1280
   exit(1);
1250
   exit(1);
Lines 1377-1384 Link Here
1377
#endif
1347
#endif
1378
1348
1379
void
1349
void
1380
run_command(file)
1350
run_command(struct file_list * file)
1381
struct file_list * file;
1382
{
1351
{
1383
#ifdef __BCC__
1352
#ifdef __BCC__
1384
static char ** minienviron[] = {
1353
static char ** minienviron[] = {
(-)a/bcc/bcc-cc1.c (-3 / +1 lines)
Lines 4-12 Link Here
4
4
5
#include "bcc.h"
5
#include "bcc.h"
6
6
7
PUBLIC int main(argc, argv)
7
PUBLIC int main(int argc, char **argv)
8
int argc;
9
char **argv;
10
{
8
{
11
    debug(1, "Start");
9
    debug(1, "Start");
12
    growheap(0);		/* init order is important */
10
    growheap(0);		/* init order is important */
(-)a/bcc/codefrag.c (-101 / +40 lines)
Lines 617-625 Link Here
617
617
618
/* add constant to register */
618
/* add constant to register */
619
619
620
PUBLIC void addconst(offset, reg)
620
PUBLIC void addconst(offset_T offset, store_pt reg)
621
offset_T offset;
622
store_pt reg;
623
{
621
{
624
#ifdef I8088
622
#ifdef I8088
625
#ifdef I80386
623
#ifdef I80386
Lines 670-678 Link Here
670
668
671
/* adjust lc for signed offset */
669
/* adjust lc for signed offset */
672
670
673
PUBLIC void adjlc(offset, reg)
671
PUBLIC void adjlc(offset_T offset, store_pt reg)
674
offset_T offset;
675
store_pt reg;
676
{
672
{
677
    if (!(reg & CHARREGS))
673
    if (!(reg & CHARREGS))
678
    {
674
    {
Lines 693-700 Link Here
693
689
694
/* adjust stack ptr by adding a labelled constant less current sp */
690
/* adjust stack ptr by adding a labelled constant less current sp */
695
691
696
PUBLIC void adjsp(label)
692
PUBLIC void adjsp(label_no label)
697
label_no label;
698
{
693
{
699
    outaddsp();
694
    outaddsp();
700
    outbyte(LOCALSTARTCHAR);
695
    outbyte(LOCALSTARTCHAR);
Lines 721-728 Link Here
721
716
722
/* and accumulator with constant */
717
/* and accumulator with constant */
723
718
724
PUBLIC void andconst(offset)
719
PUBLIC void andconst(offset_T offset)
725
offset_T offset;
726
{
720
{
727
    char_t botbits;
721
    char_t botbits;
728
    uoffset_T topbits;
722
    uoffset_T topbits;
Lines 805-820 Link Here
805
799
806
/* clear register to 0 */
800
/* clear register to 0 */
807
801
808
PRIVATE void clr(reg)
802
PRIVATE void clr(store_pt reg)
809
store_pt reg;
810
{
803
{
811
    loadconst((offset_T) 0, reg);
804
    loadconst((offset_T) 0, reg);
812
}
805
}
813
806
814
/* define common storage */
807
/* define common storage */
815
808
816
PUBLIC void common(name)
809
PUBLIC void common(char *name)
817
char *name;
818
{
810
{
819
#ifdef I8088
811
#ifdef I8088
820
    outcommon();
812
    outcommon();
Lines 840-847 Link Here
840
832
841
/* define long */
833
/* define long */
842
834
843
PUBLIC void deflong(value)
835
PUBLIC void deflong(uoffset_T value)
844
uoffset_T value;
845
{
836
{
846
    uoffset_T longhigh;
837
    uoffset_T longhigh;
847
    uoffset_T longlow;
838
    uoffset_T longlow;
Lines 877-884 Link Here
877
868
878
/* define null storage */
869
/* define null storage */
879
870
880
PUBLIC void defnulls(nullcount)
871
PUBLIC void defnulls(uoffset_T nullcount)
881
uoffset_T nullcount;
882
{
872
{
883
    if (nullcount != 0)
873
    if (nullcount != 0)
884
    {
874
    {
Lines 889-898 Link Here
889
879
890
/* define string */
880
/* define string */
891
881
892
PUBLIC label_no defstr(sptr, stop, dataflag)
882
PUBLIC label_no defstr(char *sptr, char *stop, bool_pt dataflag)
893
char *sptr;
894
char *stop;
895
bool_pt dataflag;
896
{
883
{
897
    int byte;			/* promoted char for output */
884
    int byte;			/* promoted char for output */
898
    label_no strlab;
885
    label_no strlab;
Lines 981-989 Link Here
981
968
982
/* divide D register by a constant if it is easy to do with shifts */
969
/* divide D register by a constant if it is easy to do with shifts */
983
970
984
PUBLIC bool_pt diveasy(divisor, uflag)
971
PUBLIC bool_pt diveasy(value_t divisor, bool_pt uflag)
985
value_t divisor;
986
bool_pt uflag;
987
{
972
{
988
    bool_t sign;
973
    bool_t sign;
989
974
Lines 1034-1042 Link Here
1034
1019
1035
/* equate a name to an EOL-terminated string */
1020
/* equate a name to an EOL-terminated string */
1036
1021
1037
PUBLIC void equ(name, string)
1022
PUBLIC void equ(char *name, char *string)
1038
char *name;
1039
char *string;
1040
{
1023
{
1041
    outstr(name);
1024
    outstr(name);
1042
    outequate();
1025
    outequate();
Lines 1045-1053 Link Here
1045
1028
1046
/* equate a local label to a value */
1029
/* equate a local label to a value */
1047
1030
1048
PUBLIC void equlab(label, offset)
1031
PUBLIC void equlab(label_no label, offset_T offset)
1049
label_no label;
1050
offset_T offset;
1051
{
1032
{
1052
    outbyte(LOCALSTARTCHAR);
1033
    outbyte(LOCALSTARTCHAR);
1053
    outlabel(label);
1034
    outlabel(label);
Lines 1058-1065 Link Here
1058
1039
1059
/* import or export a variable */
1040
/* import or export a variable */
1060
1041
1061
PUBLIC void globl(name)
1042
PUBLIC void globl(char *name)
1062
char *name;
1063
{
1043
{
1064
    outglobl();
1044
    outglobl();
1065
    outnccname(name);
1045
    outnccname(name);
Lines 1067-1074 Link Here
1067
1047
1068
/* import a variable */
1048
/* import a variable */
1069
1049
1070
PUBLIC void import(name)
1050
PUBLIC void import(char *name)
1071
char *name;
1072
{
1051
{
1073
    outimport();
1052
    outimport();
1074
    outnccname(name);
1053
    outnccname(name);
Lines 1076-1083 Link Here
1076
1055
1077
/* extend an int to a long */
1056
/* extend an int to a long */
1078
1057
1079
PUBLIC void itol(reg)
1058
PUBLIC void itol(store_pt reg)
1080
store_pt reg;
1081
{
1059
{
1082
#define TEMP_LABEL_FOR_REGRESSION_TESTS
1060
#define TEMP_LABEL_FOR_REGRESSION_TESTS
1083
#ifdef TEMP_LABEL_FOR_REGRESSION_TESTS
1061
#ifdef TEMP_LABEL_FOR_REGRESSION_TESTS
Lines 1108-1122 Link Here
1108
1086
1109
/* define local common storage */
1087
/* define local common storage */
1110
1088
1111
PUBLIC void lcommlab(label)
1089
PUBLIC void lcommlab(label_no label)
1112
label_no label;
1113
{
1090
{
1114
    outlabel(label);
1091
    outlabel(label);
1115
    outlcommon();
1092
    outlcommon();
1116
}
1093
}
1117
1094
1118
PUBLIC void lcommon(name)
1095
PUBLIC void lcommon(char *name)
1119
char *name;
1120
{
1096
{
1121
    outccname(name);
1097
    outccname(name);
1122
    outlcommon();
1098
    outlcommon();
Lines 1126-1135 Link Here
1126
1102
1127
/* load effective address */
1103
/* load effective address */
1128
1104
1129
PUBLIC void lea(offset, sourcereg, targreg)
1105
PUBLIC void lea(offset_T offset, store_pt sourcereg, store_pt targreg)
1130
offset_T offset;
1131
store_pt sourcereg;
1132
store_pt targreg;
1133
{
1106
{
1134
    outlea();
1107
    outlea();
1135
    outregname(targreg);
1108
    outregname(targreg);
Lines 1142-1150 Link Here
1142
1115
1143
/* load constant into given register */
1116
/* load constant into given register */
1144
1117
1145
PUBLIC void loadconst(offset, reg)
1118
PUBLIC void loadconst(offset_T offset, store_pt reg)
1146
offset_T offset;
1147
store_pt reg;
1148
{
1119
{
1149
#ifdef I8088
1120
#ifdef I8088
1150
    if (offset == 0)
1121
    if (offset == 0)
Lines 1200-1208 Link Here
1200
1171
1201
/* partially long shift left register by a constant (negative = infinity) */
1172
/* partially long shift left register by a constant (negative = infinity) */
1202
1173
1203
PUBLIC int lslconst(shift, reg)
1174
PUBLIC int lslconst(value_t shift, store_pt reg)
1204
value_t shift;
1205
store_pt reg;
1206
{
1175
{
1207
    if ((uvalue_t) shift >= INT16BITSTO)
1176
    if ((uvalue_t) shift >= INT16BITSTO)
1208
    {
1177
    {
Lines 1236-1245 Link Here
1236
1205
1237
/* partially long shift right register by a constant (negative = infinity) */
1206
/* partially long shift right register by a constant (negative = infinity) */
1238
1207
1239
PUBLIC int lsrconst(shift, reg, uflag)
1208
PUBLIC int lsrconst(value_t shift, store_pt reg, bool_pt uflag)
1240
value_t shift;
1241
store_pt reg;
1242
bool_pt uflag;
1243
{
1209
{
1244
    if ((uvalue_t) shift >= INT16BITSTO)
1210
    if ((uvalue_t) shift >= INT16BITSTO)
1245
    {
1211
    {
Lines 1287-1295 Link Here
1287
1253
1288
/* take D register modulo a constant if it is easy to do with a mask */
1254
/* take D register modulo a constant if it is easy to do with a mask */
1289
1255
1290
PUBLIC bool_pt modeasy(divisor, uflag)
1256
PUBLIC bool_pt modeasy(value_t divisor, bool_pt uflag)
1291
value_t divisor;
1292
bool_pt uflag;
1293
{
1257
{
1294
    bool_t sign;
1258
    bool_t sign;
1295
1259
Lines 1317-1325 Link Here
1317
1281
1318
/* multiply register by a constant if it is easy to do with shifts */
1282
/* multiply register by a constant if it is easy to do with shifts */
1319
1283
1320
PUBLIC bool_pt muleasy(factor, reg)
1284
PUBLIC bool_pt muleasy(uvalue_t factor, store_pt reg)
1321
uvalue_t factor;
1322
store_pt reg;
1323
{
1285
{
1324
    int mulstack[MAXINTBITSTO / 2 + 1];	/* must be signed, not a fastin_t */
1286
    int mulstack[MAXINTBITSTO / 2 + 1];	/* must be signed, not a fastin_t */
1325
    fastin_pt count;
1287
    fastin_pt count;
Lines 1397-1404 Link Here
1397
1359
1398
/* negate a register */
1360
/* negate a register */
1399
1361
1400
PUBLIC void negreg(reg)
1362
PUBLIC void negreg(store_pt reg)
1401
store_pt reg;
1402
{
1363
{
1403
    if ((store_t) reg == BREG)
1364
    if ((store_t) reg == BREG)
1404
	extBnegD();
1365
	extBnegD();
Lines 1408-1415 Link Here
1408
1369
1409
/* return string of operator */
1370
/* return string of operator */
1410
1371
1411
PUBLIC char *opstring(op)
1372
PUBLIC char *opstring(op_pt op)
1412
op_pt op;
1413
{
1373
{
1414
    switch (op)
1374
    switch (op)
1415
    {
1375
    {
Lines 1432-1439 Link Here
1432
1392
1433
/* print a c compiler name with leading CCNAMEPREXFIX */
1393
/* print a c compiler name with leading CCNAMEPREXFIX */
1434
1394
1435
PUBLIC void outccname(name)
1395
PUBLIC void outccname(char *name)
1436
char *name;
1437
{
1396
{
1438
    outbyte(CCNAMEPREFIX);
1397
    outbyte(CCNAMEPREFIX);
1439
    outstr(name);
1398
    outstr(name);
Lines 1448-1455 Link Here
1448
1407
1449
/* print immediate address */
1408
/* print immediate address */
1450
1409
1451
PUBLIC void outimmadr(offset)
1410
PUBLIC void outimmadr(offset_T offset)
1452
offset_T offset;
1453
{
1411
{
1454
#ifdef I8088
1412
#ifdef I8088
1455
    if (!isbyteoffset(offset))
1413
    if (!isbyteoffset(offset))
Lines 1464-1472 Link Here
1464
1422
1465
/* print register, comma, immediate address and adjust lc */
1423
/* print register, comma, immediate address and adjust lc */
1466
1424
1467
PUBLIC void outimadj(offset, targreg)
1425
PUBLIC void outimadj(offset_T offset, store_pt targreg)
1468
offset_T offset;
1469
store_pt targreg;
1470
{
1426
{
1471
    outregname(targreg);
1427
    outregname(targreg);
1472
    adjlc(offset, targreg);
1428
    adjlc(offset, targreg);
Lines 1491-1498 Link Here
1491
1447
1492
/* print cc name, then newline */
1448
/* print cc name, then newline */
1493
1449
1494
PUBLIC void outnccname(name)
1450
PUBLIC void outnccname(char *name)
1495
char *name;
1496
{
1451
{
1497
    outccname(name);
1452
    outccname(name);
1498
    outnl();
1453
    outnl();
Lines 1500-1507 Link Here
1500
1455
1501
/* print separator, immediate address, newline */
1456
/* print separator, immediate address, newline */
1502
1457
1503
PUBLIC void outncimmadr(offset)
1458
PUBLIC void outncimmadr(offset_T offset)
1504
offset_T offset;
1505
{
1459
{
1506
#ifdef I8088
1460
#ifdef I8088
1507
    outcomma();
1461
    outcomma();
Lines 1515-1522 Link Here
1515
1469
1516
/* print signed offset and adjust lc */
1470
/* print signed offset and adjust lc */
1517
1471
1518
PUBLIC void outoffset(offset)
1472
PUBLIC void outoffset(offset_T offset)
1519
offset_T offset;
1520
{
1473
{
1521
#ifdef MC6809
1474
#ifdef MC6809
1522
    if (!is5bitoffset(offset))
1475
    if (!is5bitoffset(offset))
Lines 1532-1539 Link Here
1532
    outstr(stackregstr);
1485
    outstr(stackregstr);
1533
}
1486
}
1534
1487
1535
PUBLIC void public(name)
1488
PUBLIC void public(char *name)
1536
char *name;
1537
{
1489
{
1538
#ifndef AS09
1490
#ifndef AS09
1539
    outexport();
1491
    outexport();
Lines 1545-1552 Link Here
1545
1497
1546
/* print cc name as a private label */
1498
/* print cc name as a private label */
1547
1499
1548
PUBLIC void private(name)
1500
PUBLIC void private(char *name)
1549
char *name;
1550
{
1501
{
1551
#ifdef LABELENDCHAR
1502
#ifdef LABELENDCHAR
1552
    outccname(name);
1503
    outccname(name);
Lines 1558-1566 Link Here
1558
1509
1559
/* exchange registers */
1510
/* exchange registers */
1560
1511
1561
PUBLIC void regexchange(sourcereg, targreg)
1512
PUBLIC void regexchange(store_pt sourcereg, store_pt targreg)
1562
store_pt sourcereg;
1563
store_pt targreg;
1564
{
1513
{
1565
    outexchange();
1514
    outexchange();
1566
    outregname(sourcereg);
1515
    outregname(sourcereg);
Lines 1573-1581 Link Here
1573
1522
1574
/* transfer a register */
1523
/* transfer a register */
1575
1524
1576
PUBLIC void regtransfer(sourcereg, targreg)
1525
PUBLIC void regtransfer(store_pt sourcereg, store_pt targreg)
1577
store_pt sourcereg;
1578
store_pt targreg;
1579
{
1526
{
1580
    outtransfer();
1527
    outtransfer();
1581
#ifdef TARGET_FIRST
1528
#ifdef TARGET_FIRST
Lines 1610-1618 Link Here
1610
1557
1611
/* set a name to a value */
1558
/* set a name to a value */
1612
1559
1613
PUBLIC void set(name, value)
1560
PUBLIC void set(char *name, offset_T value)
1614
char *name;
1615
offset_T value;
1616
{
1561
{
1617
    outccname(funcname);
1562
    outccname(funcname);
1618
    outbyte(LOCALSTARTCHAR);
1563
    outbyte(LOCALSTARTCHAR);
Lines 1658-1665 Link Here
1658
1603
1659
/* shift left register by 1 */
1604
/* shift left register by 1 */
1660
1605
1661
PUBLIC void sl1(reg)
1606
PUBLIC void sl1(store_pt reg)
1662
store_pt reg;
1663
{
1607
{
1664
    outsl();
1608
    outsl();
1665
#ifdef I8088
1609
#ifdef I8088
Lines 1674-1682 Link Here
1674
1618
1675
/* shift left register by a constant (negative = infinity) */
1619
/* shift left register by a constant (negative = infinity) */
1676
1620
1677
PUBLIC void slconst(shift, reg)
1621
PUBLIC void slconst(value_t shift, store_pt reg)
1678
value_t shift;
1679
store_pt reg;
1680
{
1622
{
1681
#ifdef I80386
1623
#ifdef I80386
1682
    if (i386_32)
1624
    if (i386_32)
Lines 1725-1733 Link Here
1725
1667
1726
/* shift right D register by a constant (negative = infinity) */
1668
/* shift right D register by a constant (negative = infinity) */
1727
1669
1728
PUBLIC void srconst(shift, uflag)
1670
PUBLIC void srconst(value_t shift, bool_pt uflag)
1729
value_t shift;
1730
bool_pt uflag;
1731
{
1671
{
1732
#ifdef I80386
1672
#ifdef I80386
1733
    if (i386_32)
1673
    if (i386_32)
Lines 1795-1802 Link Here
1795
1735
1796
/* extend an unsigned in DREG to a long */
1736
/* extend an unsigned in DREG to a long */
1797
1737
1798
PUBLIC void uitol(reg)
1738
PUBLIC void uitol(store_pt reg)
1799
store_pt reg;
1800
{
1739
{
1801
    if (lowregisDreg())
1740
    if (lowregisDreg())
1802
	clr(reg);
1741
	clr(reg);
(-)a/bcc/dbnode.c (-9 / +4 lines)
Lines 44-51 Link Here
44
44
45
FORWARD void outindchars P((int byte, indn_pt count));
45
FORWARD void outindchars P((int byte, indn_pt count));
46
46
47
PUBLIC void dbitem(item)
47
PUBLIC void dbitem(struct symstruct *item)
48
struct symstruct *item;
49
{
48
{
50
    dbtype(item->type);
49
    dbtype(item->type);
51
    if (item->storage == NOSTORAGE)
50
    if (item->storage == NOSTORAGE)
Lines 126-133 Link Here
126
    outindchars(']', item->indcount);
125
    outindchars(']', item->indcount);
127
}
126
}
128
127
129
PUBLIC void dbtype(type)
128
PUBLIC void dbtype(struct typestruct *type)
130
struct typestruct *type;
131
{
129
{
132
    for ( ; type != NULL; type = type->nexttype)
130
    for ( ; type != NULL; type = type->nexttype)
133
    {
131
    {
Lines 156-163 Link Here
156
    }
154
    }
157
}
155
}
158
156
159
PUBLIC void dbnode(exp)		/* sub-nodes must be leaves */
157
PUBLIC void dbnode(struct nodestruct *exp)		/* sub-nodes must be leaves */
160
struct nodestruct *exp;
161
{
158
{
162
    if (!dbnodeon)
159
    if (!dbnodeon)
163
	return;
160
	return;
Lines 189-197 Link Here
189
	outnstr("! Debug: expression subtree swapping");
186
	outnstr("! Debug: expression subtree swapping");
190
}
187
}
191
188
192
PRIVATE void outindchars(byte, count)
189
PRIVATE void outindchars(int byte, indn_pt count)
193
int byte;
194
indn_pt count;
195
{
190
{
196
    while (count--)
191
    while (count--)
197
	outbyte(byte);
192
	outbyte(byte);
(-)a/bcc/dbprintf.c (-3 / +5 lines)
Lines 1-6 Link Here
1
1
2
#include <sys/types.h>
2
#include <sys/types.h>
3
#include <fcntl.h>
3
#include <fcntl.h>
4
#include <string.h>
5
#include <unistd.h>
4
6
5
#if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__)
7
#if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__)
6
#include <stdarg.h>
8
#include <stdarg.h>
Lines 10-15 Link Here
10
#define va_strt(p,i) va_start(p)
12
#define va_strt(p,i) va_start(p)
11
#endif
13
#endif
12
14
15
int vdbprintf(register __const char *fmt, register va_list ap);
16
13
#if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__)
17
#if defined(__STDC__) && !defined(__FIRST_ARG_IN_AX__)
14
int dbprintf(const char * fmt, ...)
18
int dbprintf(const char * fmt, ...)
15
#else
19
#else
Lines 30-38 Link Here
30
static void putch(int ch) { static char buf[2]; *buf = ch; write(2,buf,1); }
34
static void putch(int ch) { static char buf[2]; *buf = ch; write(2,buf,1); }
31
35
32
int
36
int
33
vdbprintf(fmt, ap)
37
vdbprintf(register __const char *fmt, register va_list ap)
34
register __const char *fmt;
35
register va_list ap;
36
{
38
{
37
   int c;
39
   int c;
38
   int count = 0;
40
   int count = 0;
(-)a/bcc/declare.c (-20 / +8 lines)
Lines 54-62 Link Here
54
FORWARD void rdeclarator P((void));
54
FORWARD void rdeclarator P((void));
55
FORWARD bool_pt regdecl P((void));
55
FORWARD bool_pt regdecl P((void));
56
56
57
PRIVATE struct typestruct *chainprefix(pretype, sufftype)
57
PRIVATE struct typestruct *chainprefix(struct typestruct *pretype, struct typestruct *sufftype)
58
struct typestruct *pretype;
59
struct typestruct *sufftype;
60
{
58
{
61
    if (pretype->nexttype != NULL)
59
    if (pretype->nexttype != NULL)
62
    {
60
    {
Lines 324-333 Link Here
324
322
325
/* declselt - get list of declarations for a structure/union member */
323
/* declselt - get list of declarations for a structure/union member */
326
324
327
PRIVATE void declselt(structype, psoffset, ptypelist)
325
PRIVATE void declselt(struct typestruct *structype, offset_T *psoffset, struct typelist **ptypelist)
328
struct typestruct *structype;
329
offset_T *psoffset;
330
struct typelist **ptypelist;
331
{
326
{
332
    struct typestruct *basetype;
327
    struct typestruct *basetype;
333
    value_t fieldwidth;
328
    value_t fieldwidth;
Lines 959-966 Link Here
959
    argsallowed = FALSE;
954
    argsallowed = FALSE;
960
}
955
}
961
956
962
PRIVATE void initarray(type)
957
PRIVATE void initarray(struct typestruct *type)
963
struct typestruct *type;
964
{
958
{
965
    uoffset_T basesize;
959
    uoffset_T basesize;
966
    struct typestruct *basetype;
960
    struct typestruct *basetype;
Lines 1001-1008 Link Here
1001
	defnulls(remaining * basesize);
995
	defnulls(remaining * basesize);
1002
}
996
}
1003
997
1004
PRIVATE void inititem(type)
998
PRIVATE void inititem(struct typestruct *type)
1005
struct typestruct *type;
1006
{
999
{
1007
    sym_t startsym;
1000
    sym_t startsym;
1008
1001
Lines 1034-1041 Link Here
1034
    }
1027
    }
1035
}
1028
}
1036
1029
1037
PRIVATE void initstruct(type)
1030
PRIVATE void initstruct(struct typestruct *type)
1038
struct typestruct *type;
1039
{
1031
{
1040
    struct typestruct *memtype;
1032
    struct typestruct *memtype;
1041
    uoffset_T newoffset;
1033
    uoffset_T newoffset;
Lines 1074-1087 Link Here
1074
	nextsym();
1066
	nextsym();
1075
}
1067
}
1076
1068
1077
PRIVATE void multidecl(sname)
1069
PRIVATE void multidecl(char *sname)
1078
char *sname;
1079
{
1070
{
1080
    error2error(sname, " already declared");
1071
    error2error(sname, " already declared");
1081
}
1072
}
1082
1073
1083
PRIVATE void need(charneeded)
1074
PRIVATE void need(int charneeded)
1084
int charneeded;
1085
{
1075
{
1086
    static char message[] = "need 'x'";
1076
    static char message[] = "need 'x'";
1087
1077
Lines 1240-1248 Link Here
1240
    return anons;
1230
    return anons;
1241
}
1231
}
1242
1232
1243
PUBLIC void anonname(name, i)
1233
PUBLIC void anonname(char *name, int i)
1244
char *name;
1245
int i;
1246
{
1234
{
1247
    if (i == 0xfff)
1235
    if (i == 0xfff)
1248
        fatalerror("Too many anonymous structs/unions");
1236
        fatalerror("Too many anonymous structs/unions");
(-)a/bcc/express.c (-4 / +2 lines)
Lines 98-105 Link Here
98
    return lhs;
98
    return lhs;
99
}
99
}
100
100
101
PRIVATE struct nodestruct *exp3to12(lprecedence)
101
PRIVATE struct nodestruct *exp3to12(fastin_pt lprecedence)
102
fastin_pt lprecedence;
103
{
102
{
104
    struct nodestruct *lhs;
103
    struct nodestruct *lhs;
105
    op_pt op;
104
    op_pt op;
Lines 206-213 Link Here
206
    return parent;
205
    return parent;
207
}
206
}
208
207
209
PRIVATE struct nodestruct *postfix_exp(seenlp)
208
PRIVATE struct nodestruct *postfix_exp(bool_pt seenlp)
210
bool_pt seenlp;
211
{
209
{
212
    struct nodestruct *nodeptr;
210
    struct nodestruct *nodeptr;
213
    struct symstruct *symptr;
211
    struct symstruct *symptr;
(-)a/bcc/exptree.c (-35 / +16 lines)
Lines 39-53 Link Here
39
FORWARD int redscalar P((struct nodestruct *nodeptr));
39
FORWARD int redscalar P((struct nodestruct *nodeptr));
40
FORWARD struct nodestruct *unconvert P((struct nodestruct *nodeptr));
40
FORWARD struct nodestruct *unconvert P((struct nodestruct *nodeptr));
41
41
42
PRIVATE void badlvalue(nodeptr)
42
PRIVATE void badlvalue(struct nodestruct *nodeptr)
43
struct nodestruct *nodeptr;
44
{
43
{
45
    error("invalid lvalue");
44
    error("invalid lvalue");
46
    fixnode(nodeptr);
45
    fixnode(nodeptr);
47
}
46
}
48
47
49
PRIVATE void binconvert(nodeptr)
48
PRIVATE void binconvert(register struct nodestruct *nodeptr)
50
register struct nodestruct *nodeptr;
51
{
49
{
52
    bool_t bothscalar;
50
    bool_t bothscalar;
53
    value_t divisor;
51
    value_t divisor;
Lines 118-132 Link Here
118
	nodeptr->nodetype = itype;
116
	nodeptr->nodetype = itype;
119
}
117
}
120
118
121
PRIVATE void castiright(nodeptr)
119
PRIVATE void castiright(struct nodestruct *nodeptr)
122
struct nodestruct *nodeptr;
123
{
120
{
124
    nodeptr->right = castnode(itype, nodeptr->right);
121
    nodeptr->right = castnode(itype, nodeptr->right);
125
}
122
}
126
123
127
PUBLIC struct nodestruct *castnode(type, nodeptr)
124
PUBLIC struct nodestruct *castnode(struct typestruct *type, struct nodestruct *nodeptr)
128
struct typestruct *type;
129
struct nodestruct *nodeptr;
130
{
125
{
131
    struct symstruct *symptr;
126
    struct symstruct *symptr;
132
127
Lines 148-155 Link Here
148
    ettop = (etptr = etree) + ETREESIZE;
143
    ettop = (etptr = etree) + ETREESIZE;
149
}
144
}
150
145
151
PRIVATE void fixnode(nodeptr)
146
PRIVATE void fixnode(register struct nodestruct *nodeptr)
152
register struct nodestruct *nodeptr;
153
{
147
{
154
    nodeptr->tag = LEAF;
148
    nodeptr->tag = LEAF;
155
    nodeptr->flags = nodeptr->weight = 0;
149
    nodeptr->flags = nodeptr->weight = 0;
Lines 157-164 Link Here
157
    nodeptr->nodetype = errtype;
151
    nodeptr->nodetype = errtype;
158
}
152
}
159
153
160
PRIVATE bool_pt isconst0(nodeptr)
154
PRIVATE bool_pt isconst0(register struct nodestruct *nodeptr)
161
register struct nodestruct *nodeptr;
162
{
155
{
163
    register struct symstruct *symptr;
156
    register struct symstruct *symptr;
164
157
Lines 168-175 Link Here
168
	   symptr->type->scalar & ISCALAR;
161
	   symptr->type->scalar & ISCALAR;
169
}
162
}
170
163
171
PRIVATE bool_pt isnodecharconst(nodeptr)
164
PRIVATE bool_pt isnodecharconst(register struct nodestruct *nodeptr)
172
register struct nodestruct *nodeptr;
173
{
165
{
174
    register struct symstruct *symptr;
166
    register struct symstruct *symptr;
175
167
Lines 181-188 Link Here
181
    return FALSE;
173
    return FALSE;
182
}
174
}
183
175
184
PUBLIC struct nodestruct *leafnode(source)
176
PUBLIC struct nodestruct *leafnode(struct symstruct *source)
185
struct symstruct *source;
186
{
177
{
187
    register struct nodestruct *leafptr;
178
    register struct nodestruct *leafptr;
188
179
Lines 196-203 Link Here
196
    return leafptr;
187
    return leafptr;
197
}
188
}
198
189
199
PRIVATE void needint(nodeptr)
190
PRIVATE void needint(struct nodestruct *nodeptr)
200
struct nodestruct *nodeptr;
201
{
191
{
202
    if (!(nodeptr->nodetype->scalar & ISCALAR))
192
    if (!(nodeptr->nodetype->scalar & ISCALAR))
203
    {
193
    {
Lines 206-213 Link Here
206
    }
196
    }
207
}
197
}
208
198
209
PRIVATE void neednonstruct(nodeptr)
199
PRIVATE void neednonstruct(struct nodestruct *nodeptr)
210
struct nodestruct *nodeptr;
211
{
200
{
212
    if (nodeptr->nodetype->constructor & STRUCTU)
201
    if (nodeptr->nodetype->constructor & STRUCTU)
213
    {
202
    {
Lines 216-223 Link Here
216
    }
205
    }
217
}
206
}
218
207
219
PRIVATE void needscalar(nodeptr)
208
PRIVATE void needscalar(struct nodestruct *nodeptr)
220
struct nodestruct *nodeptr;
221
{
209
{
222
    if (!nodeptr->nodetype->scalar)
210
    if (!nodeptr->nodetype->scalar)
223
    {
211
    {
Lines 226-233 Link Here
226
    }
214
    }
227
}
215
}
228
216
229
PRIVATE void needspv(nodeptr)
217
PRIVATE void needspv(struct nodestruct *nodeptr)
230
struct nodestruct *nodeptr;
231
{
218
{
232
    if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION | STRUCTU))
219
    if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION | STRUCTU))
233
    {
220
    {
Lines 236-245 Link Here
236
    }
223
    }
237
}
224
}
238
225
239
PUBLIC struct nodestruct *node(t, p1, p2)
226
PUBLIC struct nodestruct *node(op_pt t, struct nodestruct *p1, struct nodestruct *p2)
240
op_pt t;
241
struct nodestruct *p1;
242
struct nodestruct *p2;
243
{
227
{
244
#if MAXREGS != 1
228
#if MAXREGS != 1
245
    weight_t rightweight;
229
    weight_t rightweight;
Lines 812-819 Link Here
812
    }
796
    }
813
}
797
}
814
798
815
PRIVATE struct typestruct *nodetype(nodeptr)
799
PRIVATE struct typestruct *nodetype(struct nodestruct *nodeptr)
816
struct nodestruct *nodeptr;
817
{
800
{
818
    scalar_t bothscalar;
801
    scalar_t bothscalar;
819
    scalar_t lscalar;
802
    scalar_t lscalar;
Lines 1097-1112 Link Here
1097
    return left->nodetype;
1080
    return left->nodetype;
1098
}
1081
}
1099
1082
1100
PRIVATE int redscalar(nodeptr)
1083
PRIVATE int redscalar(register struct nodestruct *nodeptr)
1101
register struct nodestruct *nodeptr;
1102
{
1084
{
1103
    if (isnodecharconst(nodeptr))
1085
    if (isnodecharconst(nodeptr))
1104
	return CHAR;
1086
	return CHAR;
1105
    return nodeptr->nodetype->scalar;
1087
    return nodeptr->nodetype->scalar;
1106
}
1088
}
1107
1089
1108
PRIVATE struct nodestruct *unconvert(nodeptr)
1090
PRIVATE struct nodestruct *unconvert(struct nodestruct *nodeptr)
1109
struct nodestruct *nodeptr;
1110
{
1091
{
1111
    if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION))
1092
    if (nodeptr->nodetype->constructor & (ARRAY | FUNCTION))
1112
	return castnode(pointype(nodeptr->nodetype->constructor & ARRAY ?
1093
	return castnode(pointype(nodeptr->nodetype->constructor & ARRAY ?
(-)a/bcc/floatop.c (-13 / +5 lines)
Lines 15-22 Link Here
15
	return nonzero iff the result is a temp double on the base of the stack
15
	return nonzero iff the result is a temp double on the base of the stack
16
-----------------------------------------------------------------------------*/
16
-----------------------------------------------------------------------------*/
17
17
18
PUBLIC bool_pt f_indirect(target)
18
PUBLIC bool_pt f_indirect(struct symstruct *target)
19
struct symstruct *target;
20
{
19
{
21
    if (target->indcount == 0)
20
    if (target->indcount == 0)
22
    {
21
    {
Lines 72-80 Link Here
72
	result is double on stack (or in condition codes for EQOP)
71
	result is double on stack (or in condition codes for EQOP)
73
-----------------------------------------------------------------------------*/
72
-----------------------------------------------------------------------------*/
74
73
75
PUBLIC void float1op(op, source)
74
PUBLIC void float1op(op_pt op, struct symstruct *source)
76
op_pt op;
77
struct symstruct *source;
78
{
75
{
79
    saveopreg();
76
    saveopreg();
80
    pointat(source);
77
    pointat(source);
Lines 94-103 Link Here
94
	result is double on stack (or in condition codes for EQOP)
91
	result is double on stack (or in condition codes for EQOP)
95
----------------------------------------------------------------------------*/
92
----------------------------------------------------------------------------*/
96
93
97
PUBLIC void floatop(op, source, target)
94
PUBLIC void floatop(op_pt op, struct symstruct *source, struct symstruct *target)
98
op_pt op;
99
struct symstruct *source;
100
struct symstruct *target;
101
{
95
{
102
    store_t regmark;
96
    store_t regmark;
103
    bool_t sflag;
97
    bool_t sflag;
Lines 156-163 Link Here
156
	OPREG must be free
150
	OPREG must be free
157
-----------------------------------------------------------------------------*/
151
-----------------------------------------------------------------------------*/
158
152
159
PUBLIC void fpush(source)
153
PUBLIC void fpush(struct symstruct *source)
160
struct symstruct *source;
161
{
154
{
162
    scalar_t scalar;
155
    scalar_t scalar;
163
156
Lines 183-190 Link Here
183
	records that target has just been pushed to a double on the stack
176
	records that target has just been pushed to a double on the stack
184
-----------------------------------------------------------------------------*/
177
-----------------------------------------------------------------------------*/
185
178
186
PUBLIC void justpushed(target)
179
PUBLIC void justpushed(struct symstruct *target)
187
struct symstruct *target;
188
{
180
{
189
    sp -= dtypesize;
181
    sp -= dtypesize;
190
    onstack(target);
182
    onstack(target);
(-)a/bcc/function.c (-9 / +4 lines)
Lines 24-38 Link Here
24
24
25
/* call a named (assembly interface) procedure, don't print newline after */
25
/* call a named (assembly interface) procedure, don't print newline after */
26
26
27
PUBLIC void call(name)
27
PUBLIC void call(char *name)
28
char *name;
29
{
28
{
30
    out_callstring();
29
    out_callstring();
31
    outstr(name);
30
    outstr(name);
32
}
31
}
33
32
34
PUBLIC void function(source)
33
PUBLIC void function(struct symstruct *source)
35
struct symstruct *source;
36
{
34
{
37
    if (source->indcount == 0 && source->storage == GLOBAL &&
35
    if (source->indcount == 0 && source->storage == GLOBAL &&
38
	!(source->flags & LABELLED) && *source->name.namep != 0)
36
	!(source->flags & LABELLED) && *source->name.namep != 0)
Lines 223-231 Link Here
223
    }
221
    }
224
}
222
}
225
223
226
PUBLIC void listo(target, lastargsp)
224
PUBLIC void listo(struct symstruct *target, offset_T lastargsp)
227
struct symstruct *target;
228
offset_T lastargsp;
229
{
225
{
230
    extend(target);
226
    extend(target);
231
    push(target);
227
    push(target);
Lines 246-253 Link Here
246
    }
242
    }
247
}
243
}
248
244
249
PUBLIC void listroot(target)
245
PUBLIC void listroot(struct symstruct *target)
250
struct symstruct *target;
251
{
246
{
252
    extend(target);
247
    extend(target);
253
    /* necessary regs are free since they were saved for function */
248
    /* necessary regs are free since they were saved for function */
(-)a/bcc/gencode.c (-16 / +7 lines)
Lines 149-158 Link Here
149
FORWARD void smakeleaf P((struct nodestruct *exp));
149
FORWARD void smakeleaf P((struct nodestruct *exp));
150
FORWARD void tcheck P((struct nodestruct *exp));
150
FORWARD void tcheck P((struct nodestruct *exp));
151
151
152
PRIVATE void abop(op, source, target)
152
PRIVATE void abop(op_pt op, struct symstruct *source, struct symstruct *target)
153
op_pt op;
154
struct symstruct *source;
155
struct symstruct *target;
156
{
153
{
157
    store_pt regmark;
154
    store_pt regmark;
158
    store_pt regpushed;
155
    store_pt regpushed;
Lines 210-217 Link Here
210
    recovlist(regpushed);
207
    recovlist(regpushed);
211
}
208
}
212
209
213
PUBLIC void bileaf(exp)
210
PUBLIC void bileaf(struct nodestruct *exp)
214
struct nodestruct *exp;
215
{
211
{
216
    bool_t commutop;
212
    bool_t commutop;
217
    bool_t tookaddress;
213
    bool_t tookaddress;
Lines 367-374 Link Here
367
    }
363
    }
368
}
364
}
369
365
370
PUBLIC fastin_pt bitcount(number)
366
PUBLIC fastin_pt bitcount(register uvalue_t number)
371
register uvalue_t number;
372
{
367
{
373
    register fastin_pt count;
368
    register fastin_pt count;
374
369
Lines 457-464 Link Here
457
#endif
452
#endif
458
}
453
}
459
454
460
PUBLIC fastin_pt highbit(number)
455
PUBLIC fastin_pt highbit(register uvalue_t number)
461
register uvalue_t number;
462
{
456
{
463
    register fastin_pt bit;
457
    register fastin_pt bit;
464
458
Lines 467-474 Link Here
467
    return bit;
461
    return bit;
468
}
462
}
469
463
470
PUBLIC void makeleaf(exp)
464
PUBLIC void makeleaf(struct nodestruct *exp)
471
struct nodestruct *exp;
472
{
465
{
473
    ccode_t condtrue;
466
    ccode_t condtrue;
474
    op_pt op;
467
    op_pt op;
Lines 690-697 Link Here
690
#endif
683
#endif
691
}
684
}
692
685
693
PRIVATE void smakeleaf(exp)
686
PRIVATE void smakeleaf(struct nodestruct *exp)
694
struct nodestruct *exp;
695
{
687
{
696
    struct nodestruct *left;
688
    struct nodestruct *left;
697
689
Lines 714-721 Link Here
714
706
715
#ifdef SELFTYPECHECK
707
#ifdef SELFTYPECHECK
716
708
717
PRIVATE void tcheck(exp)
709
PRIVATE void tcheck(register struct nodestruct *exp)
718
register struct nodestruct *exp;
719
{
710
{
720
    register struct symstruct *target;
711
    register struct symstruct *target;
721
712
(-)a/bcc/genloads.c (-73 / +31 lines)
Lines 20-27 Link Here
20
FORWARD void outnnadr P((struct symstruct *adr));
20
FORWARD void outnnadr P((struct symstruct *adr));
21
FORWARD fastin_pt pushpull P((store_pt reglist, bool_pt pushflag));
21
FORWARD fastin_pt pushpull P((store_pt reglist, bool_pt pushflag));
22
22
23
PUBLIC void addoffset(source)
23
PUBLIC void addoffset(struct symstruct *source)
24
struct symstruct *source;
25
{
24
{
26
#ifdef I8088
25
#ifdef I8088
27
    if (source->level == OFFKLUDGELEVEL)
26
    if (source->level == OFFKLUDGELEVEL)
Lines 47-54 Link Here
47
    }
46
    }
48
}
47
}
49
48
50
PUBLIC void address(source)
49
PUBLIC void address(struct symstruct *source)
51
struct symstruct *source;
52
{
50
{
53
    if (source->indcount == 0)
51
    if (source->indcount == 0)
54
	bugerror("taking address of non-lvalue");
52
	bugerror("taking address of non-lvalue");
Lines 68-75 Link Here
68
    bugerror("bad address");
66
    bugerror("bad address");
69
}
67
}
70
68
71
PRIVATE void blockpush(source)
69
PRIVATE void blockpush(struct symstruct *source)
72
struct symstruct *source;
73
{
70
{
74
    struct symstruct *length;
71
    struct symstruct *length;
75
    offset_T spmark;
72
    offset_T spmark;
Lines 98-106 Link Here
98
    indirec(source);
95
    indirec(source);
99
}
96
}
100
97
101
PUBLIC void exchange(source, target)
98
PUBLIC void exchange(struct symstruct *source, struct symstruct *target)
102
struct symstruct *source;
103
struct symstruct *target;
104
{
99
{
105
    store_t tempreg;
100
    store_t tempreg;
106
101
Lines 151-159 Link Here
151
	(except for PC register direct, since there is no LEAX D,PC)
146
	(except for PC register direct, since there is no LEAX D,PC)
152
-----------------------------------------------------------------------------*/
147
-----------------------------------------------------------------------------*/
153
148
154
PUBLIC void indexadr(source, target)
149
PUBLIC void indexadr(struct symstruct *source, struct symstruct *target)
155
struct symstruct *source;
156
struct symstruct *target;
157
{
150
{
158
#ifdef MC6809
151
#ifdef MC6809
159
    bool_t canABX;
152
    bool_t canABX;
Lines 289-296 Link Here
289
    target->storage = targreg;
282
    target->storage = targreg;
290
}
283
}
291
284
292
PUBLIC void indirec(source)
285
PUBLIC void indirec(struct symstruct *source)
293
struct symstruct *source;
294
{
286
{
295
    if (!(source->type->constructor & (ARRAY | POINTER)))
287
    if (!(source->type->constructor & (ARRAY | POINTER)))
296
	bugerror("illegal indirection");
288
	bugerror("illegal indirection");
Lines 315-323 Link Here
315
	the result has no offset
307
	the result has no offset
316
-----------------------------------------------------------------------------*/
308
-----------------------------------------------------------------------------*/
317
309
318
PUBLIC void load(source, targreg)
310
PUBLIC void load(struct symstruct *source, store_pt targreg)
319
struct symstruct *source;
320
store_pt targreg;
321
{
311
{
322
    if (source->type->scalar & DLONG)
312
    if (source->type->scalar & DLONG)
323
    {
313
    {
Lines 422-430 Link Here
422
	bugerror("attempting to load non-scalar non-pointer");
412
	bugerror("attempting to load non-scalar non-pointer");
423
}
413
}
424
414
425
PRIVATE void loadadr(source, targreg)
415
PRIVATE void loadadr(struct symstruct *source, store_pt targreg)
426
struct symstruct *source;
427
store_pt targreg;
428
{
416
{
429
    if ((store_t) targreg & ALLDATREGS)
417
    if ((store_t) targreg & ALLDATREGS)
430
    {
418
    {
Lines 468-475 Link Here
468
	loadreg(source, targreg);
456
	loadreg(source, targreg);
469
}
457
}
470
458
471
PUBLIC void loadany(source)
459
PUBLIC void loadany(struct symstruct *source)
472
struct symstruct *source;
473
{
460
{
474
    if (source->indcount != 0 || source->offset.offi != 0 || /* kludge u cmp */
461
    if (source->indcount != 0 || source->offset.offi != 0 || /* kludge u cmp */
475
	source->level == OFFKLUDGELEVEL || !(source->storage & allregs))
462
	source->level == OFFKLUDGELEVEL || !(source->storage & allregs))
Lines 492-500 Link Here
492
    }
479
    }
493
}
480
}
494
481
495
PRIVATE void loadlongindirect(source, targreg)
482
PRIVATE void loadlongindirect(struct symstruct *source, store_pt targreg)
496
struct symstruct *source;
497
store_pt targreg;
498
{
483
{
499
    sc_t flags;
484
    sc_t flags;
500
    offset_T offset;
485
    offset_T offset;
Lines 517-525 Link Here
517
    source->type = type;
502
    source->type = type;
518
}
503
}
519
504
520
PUBLIC void loadreg(source, targreg)
505
PUBLIC void loadreg(struct symstruct *source, store_pt targreg)
521
struct symstruct *source;
522
store_pt targreg;
523
{
506
{
524
    offset_T longhigh;
507
    offset_T longhigh;
525
    offset_T longlow;
508
    offset_T longlow;
Lines 629-636 Link Here
629
    }
612
    }
630
}
613
}
631
614
632
PUBLIC void makelessindirect(source)
615
PUBLIC void makelessindirect(struct symstruct *source)
633
struct symstruct *source;
634
{
616
{
635
    store_pt lreg;
617
    store_pt lreg;
636
618
Lines 650-658 Link Here
650
#endif
632
#endif
651
}
633
}
652
634
653
PUBLIC void movereg(source, targreg)
635
PUBLIC void movereg(struct symstruct *source, store_pt targreg)
654
struct symstruct *source;
655
store_pt targreg;
656
{
636
{
657
    if ((store_t) targreg & ALLDATREGS && source->type->scalar & CHAR)
637
    if ((store_t) targreg & ALLDATREGS && source->type->scalar & CHAR)
658
	targreg = BREG;
638
	targreg = BREG;
Lines 685-692 Link Here
685
    source->offset.offi = 0;	/* indcount was adjusted by outadr */
665
    source->offset.offi = 0;	/* indcount was adjusted by outadr */
686
}
666
}
687
667
688
PUBLIC void onstack(target)
668
PUBLIC void onstack(register struct symstruct *target)
689
register struct symstruct *target;
690
{
669
{
691
    target->storage = LOCAL;
670
    target->storage = LOCAL;
692
    target->flags = TEMP;
671
    target->flags = TEMP;
Lines 696-717 Link Here
696
    target->offset.offi = sp;
675
    target->offset.offi = sp;
697
}
676
}
698
677
699
PUBLIC void outadr(adr)
678
PUBLIC void outadr(struct symstruct *adr)
700
struct symstruct *adr;
701
{
679
{
702
    outnnadr(adr);
680
    outnnadr(adr);
703
    outnl();
681
    outnl();
704
}
682
}
705
683
706
PUBLIC void outcregname(reg)
684
PUBLIC void outcregname(store_pt reg)
707
store_pt reg;
708
{
685
{
709
    outcomma();
686
    outcomma();
710
    outregname(reg);
687
    outregname(reg);
711
}
688
}
712
689
713
PRIVATE void outnamoffset(adr)
690
PRIVATE void outnamoffset(struct symstruct *adr)
714
struct symstruct *adr;
715
{
691
{
716
    if (adr->flags & LABELLED)
692
    if (adr->flags & LABELLED)
717
	outlabel(adr->name.label);
693
	outlabel(adr->name.label);
Lines 732-746 Link Here
732
708
733
/* print comma, then register name, then newline */
709
/* print comma, then register name, then newline */
734
710
735
PUBLIC void outncregname(reg)
711
PUBLIC void outncregname(store_pt reg)
736
store_pt reg;
737
{
712
{
738
    outcomma();
713
    outcomma();
739
    outnregname(reg);
714
    outnregname(reg);
740
}
715
}
741
716
742
PRIVATE void outnnadr(adr)
717
PRIVATE void outnnadr(struct symstruct *adr)
743
struct symstruct *adr;
744
{
718
{
745
    bool_t indflag;
719
    bool_t indflag;
746
720
Lines 971-978 Link Here
971
945
972
/* print register name, then newline */
946
/* print register name, then newline */
973
947
974
PUBLIC void outnregname(reg)
948
PUBLIC void outnregname(store_pt reg)
975
store_pt reg;
976
{
949
{
977
    outregname(reg);
950
    outregname(reg);
978
    outnl();
951
    outnl();
Lines 980-987 Link Here
980
953
981
/* print register name */
954
/* print register name */
982
955
983
PUBLIC void outregname(reg)
956
PUBLIC void outregname(store_pt reg)
984
store_pt reg;
985
{
957
{
986
    switch ((store_t) reg)
958
    switch ((store_t) reg)
987
    {
959
    {
Lines 1053-1060 Link Here
1053
#if defined(I8088) && defined(I80386)
1025
#if defined(I8088) && defined(I80386)
1054
/* print register name for short type */
1026
/* print register name for short type */
1055
1027
1056
PUBLIC void outshortregname(reg)
1028
PUBLIC void outshortregname(store_pt reg)
1057
store_pt reg;
1058
{
1029
{
1059
    switch ((store_t) reg)
1030
    switch ((store_t) reg)
1060
    {
1031
    {
Lines 1090-1097 Link Here
1090
	target must be singly indirect or float or double
1061
	target must be singly indirect or float or double
1091
-----------------------------------------------------------------------------*/
1062
-----------------------------------------------------------------------------*/
1092
1063
1093
PUBLIC void pointat(target)
1064
PUBLIC void pointat(struct symstruct *target)
1094
struct symstruct *target;
1095
{
1065
{
1096
    if (target->type->scalar & RSCALAR)
1066
    if (target->type->scalar & RSCALAR)
1097
	(void) f_indirect(target);
1067
	(void) f_indirect(target);
Lines 1100-1114 Link Here
1100
    target->type = target->type->nexttype;
1070
    target->type = target->type->nexttype;
1101
}
1071
}
1102
1072
1103
PUBLIC void poplist(reglist)
1073
PUBLIC void poplist(store_pt reglist)
1104
store_pt reglist;
1105
{
1074
{
1106
    if (reglist)
1075
    if (reglist)
1107
	sp += pushpull(reglist, FALSE);
1076
	sp += pushpull(reglist, FALSE);
1108
}
1077
}
1109
1078
1110
PUBLIC void push(source)
1079
PUBLIC void push(struct symstruct *source)
1111
struct symstruct *source;
1112
{
1080
{
1113
    store_t reg;
1081
    store_t reg;
1114
#ifdef I8088
1082
#ifdef I8088
Lines 1192-1207 Link Here
1192
    onstack(source);
1160
    onstack(source);
1193
}
1161
}
1194
1162
1195
PUBLIC void pushlist(reglist)
1163
PUBLIC void pushlist(store_pt reglist)
1196
store_pt reglist;
1197
{
1164
{
1198
    if ((store_t) reglist)
1165
    if ((store_t) reglist)
1199
	sp -= pushpull(reglist, TRUE);
1166
	sp -= pushpull(reglist, TRUE);
1200
}
1167
}
1201
1168
1202
PRIVATE fastin_pt pushpull(reglist, pushflag)
1169
PRIVATE fastin_pt pushpull(store_pt reglist, bool_pt pushflag)
1203
store_pt reglist;
1204
bool_pt pushflag;
1205
{
1170
{
1206
    store_pt lastregbit;
1171
    store_pt lastregbit;
1207
    void (*ppfunc) P((void));
1172
    void (*ppfunc) P((void));
Lines 1290-1297 Link Here
1290
    return bytespushed;
1255
    return bytespushed;
1291
}
1256
}
1292
1257
1293
PUBLIC void pushreg(reg)
1258
PUBLIC void pushreg(store_pt reg)
1294
store_pt reg;
1295
{
1259
{
1296
    outpshs();
1260
    outpshs();
1297
    outtab();
1261
    outtab();
Lines 1299-1307 Link Here
1299
    sp -= pshregsize;
1263
    sp -= pshregsize;
1300
}
1264
}
1301
1265
1302
PUBLIC void storereg(sourcereg, target)
1266
PUBLIC void storereg(store_pt sourcereg, struct symstruct *target)
1303
store_pt sourcereg;
1304
struct symstruct *target;
1305
{
1267
{
1306
    store_pt targreg;
1268
    store_pt targreg;
1307
1269
Lines 1373-1381 Link Here
1373
		structure.element
1335
		structure.element
1374
-----------------------------------------------------------------------------*/
1336
-----------------------------------------------------------------------------*/
1375
1337
1376
PUBLIC void struc(source, target)
1338
PUBLIC void struc(struct symstruct *source, struct symstruct *target)
1377
struct symstruct *source;
1378
struct symstruct *target;
1379
{
1339
{
1380
    address(target);
1340
    address(target);
1381
    if (source->offset.offi != 0 || source->level == OFFKLUDGELEVEL)
1341
    if (source->offset.offi != 0 || source->level == OFFKLUDGELEVEL)
Lines 1393-1401 Link Here
1393
    }
1353
    }
1394
}
1354
}
1395
1355
1396
PUBLIC void transfer(source, targreg)
1356
PUBLIC void transfer(struct symstruct *source, store_pt targreg)
1397
struct symstruct *source;
1398
store_pt targreg;
1399
{
1357
{
1400
    regtransfer(source->storage, targreg);
1358
    regtransfer(source->storage, targreg);
1401
    source->storage = targreg;
1359
    source->storage = targreg;
(-)a/bcc/glogcode.c (-57 / +31 lines)
Lines 54-63 Link Here
54
FORWARD void testcond P((struct nodestruct *exp, label_no truelab,
54
FORWARD void testcond P((struct nodestruct *exp, label_no truelab,
55
			  label_no falselab, bool_pt nojump));
55
			  label_no falselab, bool_pt nojump));
56
56
57
PUBLIC void cmp(source, target, pcondtrue)
57
PUBLIC void cmp(struct symstruct *source, struct symstruct *target, ccode_t *pcondtrue)
58
struct symstruct *source;
59
struct symstruct *target;
60
ccode_t *pcondtrue;
61
{
58
{
62
    label_no falselab;
59
    label_no falselab;
63
60
Lines 93-102 Link Here
93
    loadlogical(target, falselab);
90
    loadlogical(target, falselab);
94
}
91
}
95
92
96
PRIVATE void cmplocal(source, target, pcondtrue)
93
PRIVATE void cmplocal(struct symstruct *source, struct symstruct *target, ccode_t *pcondtrue)
97
struct symstruct *source;
98
struct symstruct *target;
99
ccode_t *pcondtrue;
100
{
94
{
101
    scalar_t sscalar;
95
    scalar_t sscalar;
102
    scalar_t tempscalar;
96
    scalar_t tempscalar;
Lines 189-196 Link Here
189
183
190
#ifdef MC6809
184
#ifdef MC6809
191
185
192
PRIVATE void cmporsub(target)
186
PRIVATE void cmporsub(struct symstruct *target)
193
struct symstruct *target;
194
{
187
{
195
    if (target->storage & ALLDATREGS)
188
    if (target->storage & ALLDATREGS)
196
	outsub();
189
	outsub();
Lines 202-211 Link Here
202
    }
195
    }
203
}
196
}
204
197
205
PRIVATE bool_pt cmpsmallconst(intconst, target, pcondtrue)
198
PRIVATE bool_pt cmpsmallconst(value_t intconst, struct symstruct *target, ccode_t *pcondtrue)
206
value_t intconst;
207
struct symstruct *target;
208
ccode_t *pcondtrue;
209
{
199
{
210
    store_pt targreg;
200
    store_pt targreg;
211
201
Lines 228-238 Link Here
228
218
229
#endif
219
#endif
230
220
231
PRIVATE void comparecond(exp, truelab, falselab, nojump)
221
PRIVATE void comparecond(struct nodestruct *exp,
232
struct nodestruct *exp;
222
                         label_no truelab,
233
label_no truelab;
223
                         label_no falselab,
234
label_no falselab;
224
                         bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */)
235
bool_pt nojump;			/* NB if nonzero, is ~0 so complement is 0 */
236
{
225
{
237
    ccode_t condtrue;
226
    ccode_t condtrue;
238
    store_t regmark;
227
    store_t regmark;
Lines 275-282 Link Here
275
	lbranch(condtrue, truelab);
264
	lbranch(condtrue, truelab);
276
}
265
}
277
266
278
PUBLIC void condop(exp)
267
PUBLIC void condop(struct nodestruct *exp)
279
struct nodestruct *exp;
280
{
268
{
281
    label_no exitlab;
269
    label_no exitlab;
282
    label_no falselab;
270
    label_no falselab;
Lines 316-326 Link Here
316
    exp->left.symptr = truesym;
304
    exp->left.symptr = truesym;
317
}
305
}
318
306
319
PRIVATE void jumpcond(exp, truelab, falselab, nojump)
307
PRIVATE void jumpcond(struct nodestruct *exp,
320
struct nodestruct *exp;
308
                      label_no truelab,
321
label_no truelab;
309
                      label_no falselab,
322
label_no falselab;
310
                      bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */)
323
bool_pt nojump;			/* NB if nonzero, is ~0 so complement is 0 */
324
{
311
{
325
    switch (exp->tag)
312
    switch (exp->tag)
326
    {
313
    {
Lines 347-355 Link Here
347
    }
334
    }
348
}
335
}
349
336
350
PUBLIC void jumpfalse(exp, label)
337
PUBLIC void jumpfalse(struct nodestruct *exp, label_no label)
351
struct nodestruct *exp;
352
label_no label;
353
{
338
{
354
    label_no truelab;
339
    label_no truelab;
355
340
Lines 357-365 Link Here
357
    deflabel(truelab);
342
    deflabel(truelab);
358
}
343
}
359
344
360
PUBLIC void jumptrue(exp, label)
345
PUBLIC void jumptrue(struct nodestruct *exp, label_no label)
361
struct nodestruct *exp;
362
label_no label;
363
{
346
{
364
    label_no falselab;
347
    label_no falselab;
365
348
Lines 367-375 Link Here
367
    deflabel(falselab);
350
    deflabel(falselab);
368
}
351
}
369
352
370
PRIVATE void loadlogical(source, falselab)
353
PRIVATE void loadlogical(struct symstruct *source, label_no falselab)
371
struct symstruct *source;
372
label_no falselab;
373
{
354
{
374
    label_no exitlab;
355
    label_no exitlab;
375
    struct symstruct *target;
356
    struct symstruct *target;
Lines 386-396 Link Here
386
    outnlabel(exitlab);
367
    outnlabel(exitlab);
387
}
368
}
388
369
389
PRIVATE void logandcond(exp, truelab, falselab, nojump)
370
PRIVATE void logandcond(struct nodestruct *exp,
390
struct nodestruct *exp;
371
                        label_no truelab,
391
label_no truelab;
372
                        label_no falselab,
392
label_no falselab;
373
                        bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */)
393
bool_pt nojump;			/* NB if nonzero, is ~0 so complement is 0 */
394
{
374
{
395
    label_no andlab;
375
    label_no andlab;
396
376
Lines 400-407 Link Here
400
    jumpcond(exp->right, truelab, falselab, nojump);
380
    jumpcond(exp->right, truelab, falselab, nojump);
401
}
381
}
402
382
403
PUBLIC void logop(exp)
383
PUBLIC void logop(struct nodestruct *exp)
404
struct nodestruct *exp;
405
{
384
{
406
    label_no falselab;
385
    label_no falselab;
407
    struct symstruct *target;
386
    struct symstruct *target;
Lines 416-426 Link Here
416
    exp->left.symptr = target;
395
    exp->left.symptr = target;
417
}
396
}
418
397
419
PRIVATE void logorcond(exp, truelab, falselab, nojump)
398
PRIVATE void logorcond(struct nodestruct *exp,
420
struct nodestruct *exp;
399
                       label_no truelab,
421
label_no truelab;
400
                       label_no falselab,
422
label_no falselab;
401
                       bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */)
423
bool_pt nojump;			/* NB if nonzero, is ~0 so complement is 0 */
424
{
402
{
425
    label_no orlab;
403
    label_no orlab;
426
404
Lines 430-437 Link Here
430
    jumpcond(exp->right, truelab, falselab, nojump);
408
    jumpcond(exp->right, truelab, falselab, nojump);
431
}
409
}
432
410
433
PRIVATE void reduceconst(source)
411
PRIVATE void reduceconst(struct symstruct *source)
434
struct symstruct *source;
435
{
412
{
436
    if (source->storage == CONSTANT && ischarconst(source->offset.offv) &&
413
    if (source->storage == CONSTANT && ischarconst(source->offset.offv) &&
437
	(source->type->scalar & (CHAR | SHORT | INT | DLONG)) != DLONG)
414
	(source->type->scalar & (CHAR | SHORT | INT | DLONG)) != DLONG)
Lines 443-451 Link Here
443
    }
420
    }
444
}
421
}
445
422
446
PRIVATE void test(target, pcondtrue)
423
PRIVATE void test(struct symstruct *target, ccode_t *pcondtrue)
447
struct symstruct *target;
448
ccode_t *pcondtrue;
449
{
424
{
450
#ifdef I8088
425
#ifdef I8088
451
    store_t targreg;
426
    store_t targreg;
Lines 530-540 Link Here
530
505
531
/* test expression and jump depending on NE/EQ */
506
/* test expression and jump depending on NE/EQ */
532
507
533
PRIVATE void testcond(exp, truelab, falselab, nojump)
508
PRIVATE void testcond(struct nodestruct *exp,
534
struct nodestruct *exp;
509
                      label_no truelab,
535
label_no truelab;
510
                      label_no falselab,
536
label_no falselab;
511
                      bool_pt nojump /* NB if nonzero, is ~0 so complement is 0 */)
537
bool_pt nojump;			/* NB if nonzero, is ~0 so complement is 0 */
538
{
512
{
539
    ccode_t condtrue;
513
    ccode_t condtrue;
540
    struct symstruct *source;
514
    struct symstruct *source;
(-)a/bcc/hardop.c (-23 / +8 lines)
Lines 14-22 Link Here
14
14
15
FORWARD void sub1 P((struct symstruct *source, struct symstruct *target));
15
FORWARD void sub1 P((struct symstruct *source, struct symstruct *target));
16
16
17
PUBLIC void add(source, target)
17
PUBLIC void add(struct symstruct *source, struct symstruct *target)
18
struct symstruct *source;
19
struct symstruct *target;
20
{
18
{
21
    scalar_t sscalar;
19
    scalar_t sscalar;
22
20
Lines 60-68 Link Here
60
    target->type = iscalartotype(target->type->scalar | sscalar);
58
    target->type = iscalartotype(target->type->scalar | sscalar);
61
}
59
}
62
60
63
PUBLIC void incdec(op, source)
61
PUBLIC void incdec(op_pt op, struct symstruct *source)
64
op_pt op;
65
struct symstruct *source;
66
{
62
{
67
    offset_T bump;
63
    offset_T bump;
68
    bool_t postflag;
64
    bool_t postflag;
Lines 182-189 Link Here
182
#endif
178
#endif
183
}
179
}
184
180
185
PUBLIC void neg(target)
181
PUBLIC void neg(struct symstruct *target)
186
struct symstruct *target;
187
{
182
{
188
    scalar_t scalar;
183
    scalar_t scalar;
189
    struct symstruct *source;
184
    struct symstruct *source;
Lines 213-220 Link Here
213
    }
208
    }
214
}
209
}
215
210
216
PUBLIC void not(target)
211
PUBLIC void not(struct symstruct *target)
217
struct symstruct *target;
218
{
212
{
219
    if (target->type->scalar & DLONG)
213
    if (target->type->scalar & DLONG)
220
	long1op(NOTOP, target);
214
	long1op(NOTOP, target);
Lines 228-237 Link Here
228
222
229
/* 1-byte ops like AND acting on integers (not both constant) */
223
/* 1-byte ops like AND acting on integers (not both constant) */
230
224
231
PUBLIC void op1(op, source, target)
225
PUBLIC void op1(op_pt op, struct symstruct *source, struct symstruct *target)
232
op_pt op;
233
struct symstruct *source;
234
struct symstruct *target;
235
{
226
{
236
    char *opstr;
227
    char *opstr;
237
#ifdef OP1
228
#ifdef OP1
Lines 424-432 Link Here
424
    }
415
    }
425
}
416
}
426
417
427
PUBLIC void ptrsub(source, target)
418
PUBLIC void ptrsub(struct symstruct *source, struct symstruct *target)
428
struct symstruct *source;
429
struct symstruct *target;
430
{
419
{
431
    label_no exitlab;
420
    label_no exitlab;
432
    uoffset_T factor;
421
    uoffset_T factor;
Lines 461-469 Link Here
461
    }
450
    }
462
}
451
}
463
452
464
PUBLIC void sub(source, target)
453
PUBLIC void sub(struct symstruct *source, struct symstruct *target)
465
struct symstruct *source;
466
struct symstruct *target;
467
{
454
{
468
    scalar_t sscalar;
455
    scalar_t sscalar;
469
456
Lines 489-497 Link Here
489
    target->type = iscalartotype(target->type->scalar | sscalar);
476
    target->type = iscalartotype(target->type->scalar | sscalar);
490
}
477
}
491
478
492
PRIVATE void sub1(source, target)
479
PRIVATE void sub1(struct symstruct *source, struct symstruct *target)
493
struct symstruct *source;
494
struct symstruct *target;
495
{
480
{
496
    if (source->storage == CONSTANT)
481
    if (source->storage == CONSTANT)
497
	source->type = itype;
482
	source->type = itype;
(-)a/bcc/input.c (-8 / +3 lines)
Lines 153-160 Link Here
153
}
153
}
154
154
155
#ifdef BUILTIN_CPP
155
#ifdef BUILTIN_CPP
156
PRIVATE void definefile(fname)
156
PRIVATE void definefile(char *fname)
157
char *fname;
158
{
157
{
159
    char *def;
158
    char *def;
160
159
Lines 366-374 Link Here
366
365
367
/* initialise current input file */
366
/* initialise current input file */
368
367
369
PRIVATE void inputinit(fname, fd)
368
PRIVATE void inputinit(char *fname, fd_t fd)
370
char *fname;
371
fd_t fd;
372
{
369
{
373
    register struct fbufstruct *newinputbuf;
370
    register struct fbufstruct *newinputbuf;
374
371
Lines 478-486 Link Here
478
475
479
/* open input and output files and get options */
476
/* open input and output files and get options */
480
477
481
PUBLIC void openio(argc, argv)
478
PUBLIC void openio(int argc, char *argv[])
482
int argc;
483
char *argv[];
484
{
479
{
485
    register char *arg;
480
    register char *arg;
486
    int argn;
481
    int argn;
(-)a/bcc/label.c (-25 / +10 lines)
Lines 70-79 Link Here
70
70
71
/* add label to circular list */
71
/* add label to circular list */
72
72
73
PRIVATE void addlabel(cond, label, patch)
73
PRIVATE void addlabel(ccode_pt cond, label_no label, char *patch)
74
ccode_pt cond;
75
label_no label;
76
char *patch;
77
{
74
{
78
    register struct labdatstruct *labptr;
75
    register struct labdatstruct *labptr;
79
76
Lines 128-136 Link Here
128
125
129
/* clear out labels no longer in buffer */
126
/* clear out labels no longer in buffer */
130
127
131
PUBLIC void clearlabels(patchbuf, patchtop)
128
PUBLIC void clearlabels(char *patchbuf, char *patchtop)
132
char *patchbuf;
133
char *patchtop;
134
{
129
{
135
    register struct labdatstruct *labptr;
130
    register struct labdatstruct *labptr;
136
    struct labdatstruct *labtop;
131
    struct labdatstruct *labtop;
Lines 166-173 Link Here
166
161
167
/* define location of label and backpatch references to it */
162
/* define location of label and backpatch references to it */
168
163
169
PUBLIC void deflabel(label)
164
PUBLIC void deflabel(label_no label)
170
label_no label;
171
{
165
{
172
    char *cnameptr;
166
    char *cnameptr;
173
    struct labdatstruct *labmin;
167
    struct labdatstruct *labmin;
Lines 240-247 Link Here
240
    addlabel((ccode_pt) 0, label, (char *) NULL);
234
    addlabel((ccode_pt) 0, label, (char *) NULL);
241
}
235
}
242
236
243
PRIVATE struct labdatstruct *findlabel(label)
237
PRIVATE struct labdatstruct *findlabel(label_no label)
244
label_no label;
245
{
238
{
246
    register struct labdatstruct *labptr;
239
    register struct labdatstruct *labptr;
247
    struct labdatstruct *labtop;
240
    struct labdatstruct *labtop;
Lines 273-289 Link Here
273
266
274
/* jump to label */
267
/* jump to label */
275
268
276
PUBLIC void jump(label)
269
PUBLIC void jump(label_no label)
277
label_no label;
278
{
270
{
279
    lbranch(RA, label);
271
    lbranch(RA, label);
280
}
272
}
281
273
282
/* long branch on condition to label */
274
/* long branch on condition to label */
283
275
284
PUBLIC void lbranch(cond, label)
276
PUBLIC void lbranch(ccode_pt cond, label_no label)
285
ccode_pt cond;
286
label_no label;
287
{
277
{
288
#ifdef I8088
278
#ifdef I8088
289
    char *cnameptr;
279
    char *cnameptr;
Lines 361-368 Link Here
361
351
362
/* print condition code name */
352
/* print condition code name */
363
353
364
PUBLIC void outcond(cond)
354
PUBLIC void outcond(ccode_pt cond)
365
ccode_pt cond;
366
{
355
{
367
    char *cnameptr;
356
    char *cnameptr;
368
357
Lines 375-382 Link Here
375
364
376
/* print label */
365
/* print label */
377
366
378
PUBLIC void outlabel(label)
367
PUBLIC void outlabel(label_no label)
379
label_no label;
380
{
368
{
381
    outbyte(LABELSTARTCHAR);
369
    outbyte(LABELSTARTCHAR);
382
    outhexdigs((uoffset_T) label);
370
    outhexdigs((uoffset_T) label);
Lines 384-391 Link Here
384
372
385
/* print label and newline */
373
/* print label and newline */
386
374
387
PUBLIC void outnlabel(label)
375
PUBLIC void outnlabel(label_no label)
388
label_no label;
389
{
376
{
390
    outlabel(label);
377
    outlabel(label);
391
#ifdef LABELENDCHAR
378
#ifdef LABELENDCHAR
Lines 397-405 Link Here
397
384
398
/* short branch on condition to label */
385
/* short branch on condition to label */
399
386
400
PUBLIC void sbranch(cond, label)
387
PUBLIC void sbranch(ccode_pt cond, label_no label)
401
ccode_pt cond;
402
label_no label;
403
{
388
{
404
#ifdef I8088
389
#ifdef I8088
405
    char *cnameptr;
390
    char *cnameptr;
(-)a/bcc/loadexp.c (-5 / +2 lines)
Lines 32-39 Link Here
32
    return 1;
32
    return 1;
33
}
33
}
34
34
35
PUBLIC void initexpression(type)
35
PUBLIC void initexpression(struct typestruct *type)
36
struct typestruct *type;
37
{
36
{
38
    struct nodestruct *etmark;
37
    struct nodestruct *etmark;
39
    struct nodestruct *exp;
38
    struct nodestruct *exp;
Lines 142-150 Link Here
142
    exprptr = exprmark;
141
    exprptr = exprmark;
143
}
142
}
144
143
145
PUBLIC struct typestruct *loadexpression(targreg, targtype)
144
PUBLIC struct typestruct *loadexpression(store_pt targreg, struct typestruct *targtype)
146
store_pt targreg;
147
struct typestruct *targtype;
148
{
145
{
149
    struct nodestruct *etmark;
146
    struct nodestruct *etmark;
150
    struct nodestruct *exp;
147
    struct nodestruct *exp;
(-)a/bcc/longop.c (-7 / +2 lines)
Lines 18-27 Link Here
18
	or singly indirect (local, global, or from an index reg)
18
	or singly indirect (local, global, or from an index reg)
19
-----------------------------------------------------------------------------*/
19
-----------------------------------------------------------------------------*/
20
20
21
PUBLIC void longop(op, source, target)
21
PUBLIC void longop(op_pt op, struct symstruct *source, struct symstruct *target)
22
op_pt op;
23
struct symstruct *source;
24
struct symstruct *target;
25
{
22
{
26
    store_pt reglist;
23
    store_pt reglist;
27
    store_t regmark;
24
    store_t regmark;
Lines 138-146 Link Here
138
	or singly indirect (local, global, or from an index reg)
135
	or singly indirect (local, global, or from an index reg)
139
-----------------------------------------------------------------------------*/
136
-----------------------------------------------------------------------------*/
140
137
141
PUBLIC void long1op(op, target)
138
PUBLIC void long1op(op_pt op, struct symstruct *target)
142
op_pt op;
143
struct symstruct *target;
144
{
139
{
145
    pushlist(reguse & OPREG);
140
    pushlist(reguse & OPREG);
146
    load(target, OPREG);
141
    load(target, OPREG);
(-)a/bcc/output.c (-58 / +27 lines)
Lines 37-44 Link Here
37
#endif
37
#endif
38
#endif
38
#endif
39
39
40
PUBLIC void bugerror(message)
40
PUBLIC void bugerror(char *message)
41
char *message;
42
{
41
{
43
    error2error("compiler bug? - ", message);
42
    error2error("compiler bug? - ", message);
44
}
43
}
Lines 60-76 Link Here
60
59
61
/* error handler */
60
/* error handler */
62
61
63
PUBLIC void error(message)
62
PUBLIC void error(char *message)
64
char *message;
65
{
63
{
66
    error2error(message, "");
64
    error2error(message, "");
67
}
65
}
68
66
69
/* error handler - concatenate 2 messages */
67
/* error handler - concatenate 2 messages */
70
68
71
PUBLIC void error2error(message1, message2)
69
PUBLIC void error2error(char *message1, char *message2)
72
char *message1;
73
char *message2;
74
{
70
{
75
    char *warning;
71
    char *warning;
76
72
Lines 147-154 Link Here
147
143
148
/* fatal error, exit early */
144
/* fatal error, exit early */
149
145
150
PUBLIC void fatalerror(message)
146
PUBLIC void fatalerror(char *message)
151
char *message;
152
{
147
{
153
    error(message);
148
    error(message);
154
    finishup();
149
    finishup();
Lines 233-247 Link Here
233
    output = 1;			/* standard output */
228
    output = 1;			/* standard output */
234
}
229
}
235
230
236
PUBLIC void limiterror(message)
231
PUBLIC void limiterror(char *message)
237
char *message;
238
{
232
{
239
    error2error("compiler limit exceeded - ", message);
233
    error2error("compiler limit exceeded - ", message);
240
    finishup();
234
    finishup();
241
}
235
}
242
236
243
PUBLIC void openout(oname)
237
PUBLIC void openout(char *oname)
244
char *oname;
245
{
238
{
246
    if (output != 1)
239
    if (output != 1)
247
	fatalerror("more than one output file");
240
	fatalerror("more than one output file");
Lines 254-261 Link Here
254
247
255
/* print character */
248
/* print character */
256
249
257
PUBLIC void outbyte(c)
250
PUBLIC void outbyte(int c)
258
int c;
259
{
251
{
260
#if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1
252
#if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1
261
    register char *outp;
253
    register char *outp;
Lines 343-352 Link Here
343
335
344
/* print line number in format ("# %u \"%s\"%s", nr, fname, str) */
336
/* print line number in format ("# %u \"%s\"%s", nr, fname, str) */
345
337
346
PUBLIC void outcpplinenumber(nr, fname, str)
338
PUBLIC void outcpplinenumber(unsigned nr, char *fname, char *str)
347
unsigned nr;
348
char *fname;
349
char *str;
350
{
339
{
351
    outstr("# ");
340
    outstr("# ");
352
    outudec(nr);
341
    outudec(nr);
Lines 358-365 Link Here
358
347
359
/* print unsigned offset, hex format */
348
/* print unsigned offset, hex format */
360
349
361
PUBLIC void outhex(num)
350
PUBLIC void outhex(uoffset_T num)
362
uoffset_T num;
363
{
351
{
364
#ifdef HEXSTARTCHAR
352
#ifdef HEXSTARTCHAR
365
    if (num >= 10)
353
    if (num >= 10)
Lines 374-381 Link Here
374
362
375
/* print unsigned offset, hex format with digits only (no hex designator) */
363
/* print unsigned offset, hex format with digits only (no hex designator) */
376
364
377
PUBLIC void outhexdigs(num)
365
PUBLIC void outhexdigs(register uoffset_T num)
378
register uoffset_T num;
379
{
366
{
380
    if (num >= 0x10)
367
    if (num >= 0x10)
381
    {
368
    {
Lines 387-394 Link Here
387
374
388
/* print string terminated by EOL */
375
/* print string terminated by EOL */
389
376
390
PUBLIC void outline(s)
377
PUBLIC void outline(char *s)
391
char *s;
392
{
378
{
393
    register char *outp;
379
    register char *outp;
394
    register char *rs;
380
    register char *rs;
Lines 426-433 Link Here
426
412
427
/* print character, then newline */
413
/* print character, then newline */
428
414
429
PUBLIC void outnbyte(byte)
415
PUBLIC void outnbyte(int byte)
430
int byte;
431
{
416
{
432
    outbyte(byte);
417
    outbyte(byte);
433
    outnl();
418
    outnl();
Lines 435-442 Link Here
435
420
436
/* print unsigned offset, hex format, then newline */
421
/* print unsigned offset, hex format, then newline */
437
422
438
PUBLIC void outnhex(num)
423
PUBLIC void outnhex(uoffset_T num)
439
uoffset_T num;
440
{
424
{
441
    outhex(num);
425
    outhex(num);
442
    outnl();
426
    outnl();
Lines 457-464 Link Here
457
441
458
/* print opcode and newline, bump lc by 1 */
442
/* print opcode and newline, bump lc by 1 */
459
443
460
PUBLIC void outnop1str(s)
444
PUBLIC void outnop1str(char *s)
461
char *s;
462
{
445
{
463
    opcodeleadin();
446
    opcodeleadin();
464
    outstr(s);
447
    outstr(s);
Lines 468-475 Link Here
468
451
469
/* print opcode and newline, bump lc by 2 */
452
/* print opcode and newline, bump lc by 2 */
470
453
471
PUBLIC void outnop2str(s)
454
PUBLIC void outnop2str(char *s)
472
char *s;
473
{
455
{
474
    opcodeleadin();
456
    opcodeleadin();
475
    outstr(s);
457
    outstr(s);
Lines 479-486 Link Here
479
461
480
/* print string, then newline */
462
/* print string, then newline */
481
463
482
PUBLIC void outnstr(s)
464
PUBLIC void outnstr(char *s)
483
char *s;
484
{
465
{
485
    outstr(s);
466
    outstr(s);
486
    outnl();
467
    outnl();
Lines 488-495 Link Here
488
469
489
/* print opcode */
470
/* print opcode */
490
471
491
PUBLIC void outop0str(s)
472
PUBLIC void outop0str(char *s)
492
char *s;
493
{
473
{
494
    opcodeleadin();
474
    opcodeleadin();
495
    outstr(s);
475
    outstr(s);
Lines 497-504 Link Here
497
477
498
/* print opcode, bump lc by 1 */
478
/* print opcode, bump lc by 1 */
499
479
500
PUBLIC void outop1str(s)
480
PUBLIC void outop1str(char *s)
501
char *s;
502
{
481
{
503
    opcodeleadin();
482
    opcodeleadin();
504
    outstr(s);
483
    outstr(s);
Lines 507-514 Link Here
507
486
508
/* print opcode, bump lc by 2 */
487
/* print opcode, bump lc by 2 */
509
488
510
PUBLIC void outop2str(s)
489
PUBLIC void outop2str(char *s)
511
char *s;
512
{
490
{
513
    opcodeleadin();
491
    opcodeleadin();
514
    outstr(s);
492
    outstr(s);
Lines 517-524 Link Here
517
495
518
/* print opcode, bump lc by 3 */
496
/* print opcode, bump lc by 3 */
519
497
520
PUBLIC void outop3str(s)
498
PUBLIC void outop3str(char *s)
521
char *s;
522
{
499
{
523
    opcodeleadin();
500
    opcodeleadin();
524
    outstr(s);
501
    outstr(s);
Lines 534-541 Link Here
534
511
535
/* print signed offset, hex format */
512
/* print signed offset, hex format */
536
513
537
PUBLIC void outshex(num)
514
PUBLIC void outshex(offset_T num)
538
offset_T num;
539
{
515
{
540
    if (num >= -(maxoffsetto + 1))
516
    if (num >= -(maxoffsetto + 1))
541
    {
517
    {
Lines 547-554 Link Here
547
523
548
/* print string  */
524
/* print string  */
549
525
550
PUBLIC void outstr(s)
526
PUBLIC void outstr(char *s)
551
char *s;
552
{
527
{
553
#if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1
528
#if C_CODE || __AS09__ + __AS386_16__ + __AS386_32__ != 1
554
    register char *outp;
529
    register char *outp;
Lines 725-732 Link Here
725
700
726
/* print unsigned, decimal format */
701
/* print unsigned, decimal format */
727
702
728
PUBLIC void outudec(num)
703
PUBLIC void outudec(unsigned num)
729
unsigned num;
730
{
704
{
731
    char str[10 + 1];
705
    char str[10 + 1];
732
706
Lines 739-746 Link Here
739
713
740
/* print unsigned value, hex format (like outhex except value_t is larger) */
714
/* print unsigned value, hex format (like outhex except value_t is larger) */
741
715
742
PUBLIC void outuvalue(num)
716
PUBLIC void outuvalue(uvalue_t num)
743
uvalue_t num;
744
{
717
{
745
#ifdef HEXSTARTCHAR
718
#ifdef HEXSTARTCHAR
746
    if (num >= 10)
719
    if (num >= 10)
Lines 755-762 Link Here
755
728
756
/* print unsigned value, hex format with digits only (no hex designator) */
729
/* print unsigned value, hex format with digits only (no hex designator) */
757
730
758
PRIVATE void outvaldigs(num)
731
PRIVATE void outvaldigs(register uvalue_t num)
759
register uvalue_t num;
760
{
732
{
761
    if (num >= 0x10)
733
    if (num >= 0x10)
762
    {
734
    {
Lines 768-775 Link Here
768
740
769
/* print signed value, hex format (like outshex except value_t is larger) */
741
/* print signed value, hex format (like outshex except value_t is larger) */
770
742
771
PUBLIC void outvalue(num)
743
PUBLIC void outvalue(register value_t num)
772
register value_t num;
773
{
744
{
774
    if (num < 0)
745
    if (num < 0)
775
    {
746
    {
Lines 784-792 Link Here
784
755
785
/* push decimal digits of an unsigned onto a stack of chars */
756
/* push decimal digits of an unsigned onto a stack of chars */
786
757
787
PUBLIC char *pushudec(s, num)
758
PUBLIC char *pushudec(register char *s, register unsigned num)
788
register char *s;
789
register unsigned num;
790
{
759
{
791
    register unsigned reduction;
760
    register unsigned reduction;
792
761
(-)a/bcc/preproc.c (-9 / +5 lines)
Lines 477-485 Link Here
477
    symptr->prev = hashptr;
477
    symptr->prev = hashptr;
478
}
478
}
479
479
480
PRIVATE void defineorundefinestring(str, defineflag)
480
PRIVATE void defineorundefinestring(char *str /* "name[=def]" or "name def" */,
481
char *str;			/* "name[=def]" or "name def" */
481
									bool_pt defineflag)
482
bool_pt defineflag;
483
{
482
{
484
    char *fakeline;
483
    char *fakeline;
485
    unsigned len;
484
    unsigned len;
Lines 531-538 Link Here
531
    ourfree(fakeline - 3);
530
    ourfree(fakeline - 3);
532
}
531
}
533
532
534
PUBLIC void definestring(str)
533
PUBLIC void definestring(char *str /* "name[=def]" or "name def" */)
535
char *str;			/* "name[=def]" or "name def" */
536
{
534
{
537
    defineorundefinestring(str, TRUE);
535
    defineorundefinestring(str, TRUE);
538
}
536
}
Lines 873-880 Link Here
873
871
874
/* ifcontrol - process #if, #ifdef, #ifndef */
872
/* ifcontrol - process #if, #ifdef, #ifndef */
875
873
876
PRIVATE void ifcontrol(ifcase)
874
PRIVATE void ifcontrol(sym_pt ifcase)
877
sym_pt ifcase;
878
{
875
{
879
    bool_t iftrue;
876
    bool_t iftrue;
880
    struct symstruct *symptr;
877
    struct symstruct *symptr;
Lines 1073-1080 Link Here
1073
	delsym(symptr);
1070
	delsym(symptr);
1074
}
1071
}
1075
1072
1076
PUBLIC void undefinestring(str)
1073
PUBLIC void undefinestring(char *str)
1077
char *str;
1078
{
1074
{
1079
    defineorundefinestring(str, FALSE);
1075
    defineorundefinestring(str, FALSE);
1080
}
1076
}
(-)a/bcc/preserve.c (-21 / +8 lines)
Lines 10-18 Link Here
10
10
11
/* change stack ptr without changing condition codes */
11
/* change stack ptr without changing condition codes */
12
12
13
PUBLIC void changesp(newsp, absflag)
13
PUBLIC void changesp(offset_T newsp, bool_pt absflag)
14
offset_T newsp;
15
bool_pt absflag;
16
{
14
{
17
    if (newsp != sp || ((bool_t) absflag && switchnow != NULL))
15
    if (newsp != sp || ((bool_t) absflag && switchnow != NULL))
18
    {
16
    {
Lines 56-64 Link Here
56
54
57
/* load source to any while preserving target */
55
/* load source to any while preserving target */
58
56
59
PUBLIC void loadpres(source, target)
57
PUBLIC void loadpres(struct symstruct *source, struct symstruct *target)
60
struct symstruct *source;
61
struct symstruct *target;
62
{
58
{
63
    store_t regmark;
59
    store_t regmark;
64
60
Lines 83-90 Link Here
83
79
84
/* change stack ptr */
80
/* change stack ptr */
85
81
86
PUBLIC void modstk(newsp)
82
PUBLIC void modstk(offset_T newsp)
87
offset_T newsp;
88
{
83
{
89
    if (newsp != sp)
84
    if (newsp != sp)
90
    {
85
    {
Lines 108-116 Link Here
108
103
109
/* preserve target without changing source */
104
/* preserve target without changing source */
110
105
111
PUBLIC void pres2(source, target)
106
PUBLIC void pres2(struct symstruct *source, struct symstruct *target)
112
struct symstruct *source;
113
struct symstruct *target;
114
{
107
{
115
    if (target->storage & allregs)
108
    if (target->storage & allregs)
116
    {
109
    {
Lines 130-137 Link Here
130
123
131
/* preserve source */
124
/* preserve source */
132
125
133
PUBLIC void preserve(source)
126
PUBLIC void preserve(struct symstruct *source)
134
struct symstruct *source;
135
{
127
{
136
    if (source->storage & allregs)
128
    if (source->storage & allregs)
137
    {
129
    {
Lines 145-153 Link Here
145
137
146
/* preserve lvalue target without changing source or target */
138
/* preserve lvalue target without changing source or target */
147
139
148
PUBLIC store_pt preslval(source, target)
140
PUBLIC store_pt preslval(struct symstruct *source, struct symstruct *target)
149
struct symstruct *source;
150
struct symstruct *target;
151
{
141
{
152
    store_pt regpushed;
142
    store_pt regpushed;
153
143
Lines 164-171 Link Here
164
    return regpushed;
154
    return regpushed;
165
}
155
}
166
156
167
PUBLIC void recovlist(reglist)
157
PUBLIC void recovlist(store_pt reglist)
168
store_pt reglist;
169
{
158
{
170
    poplist(reglist);
159
    poplist(reglist);
171
    reguse |= (store_t) reglist;
160
    reguse |= (store_t) reglist;
Lines 181-189 Link Here
181
 /* CONSTANT, BREG, DREG, XREG = INDREG0, UREG = INDREG1, YREG = INDREG2 */
170
 /* CONSTANT, BREG, DREG, XREG = INDREG0, UREG = INDREG1, YREG = INDREG2 */
182
#endif
171
#endif
183
172
184
PUBLIC void savereturn(savelist, saveoffset)
173
PUBLIC void savereturn(store_pt savelist, offset_T saveoffset)
185
store_pt savelist;
186
offset_T saveoffset;
187
{
174
{
188
    store_t reg;
175
    store_t reg;
189
    smalin_t *regoffptr;
176
    smalin_t *regoffptr;
(-)a/bcc/scan.c (-4 / +2 lines)
Lines 141-148 Link Here
141
    }
141
    }
142
}
142
}
143
143
144
PUBLIC void cppscan(asm_only)
144
PUBLIC void cppscan(int asm_only)
145
int asm_only;
146
{
145
{
147
    int start_of_line = 1;
146
    int start_of_line = 1;
148
#ifndef ASM_BARE
147
#ifndef ASM_BARE
Lines 290-297 Link Here
290
    }
289
    }
291
}
290
}
292
291
293
PUBLIC void eofin(message)
292
PUBLIC void eofin(char *message)
294
char *message;
295
{
293
{
296
    error2error("end of file in ", message);
294
    error2error("end of file in ", message);
297
}
295
}
(-)a/bcc/softop.c (-4 / +1 lines)
Lines 19-28 Link Here
19
	considerable effort goes into avoiding unnecessary pushes
19
	considerable effort goes into avoiding unnecessary pushes
20
-----------------------------------------------------------------------------*/
20
-----------------------------------------------------------------------------*/
21
21
22
PUBLIC void softop(op, source, target)
22
PUBLIC void softop(op_pt op, struct symstruct *source, struct symstruct *target)
23
op_pt op;
24
struct symstruct *source;
25
struct symstruct *target;
26
{
23
{
27
    store_t regpushed;
24
    store_t regpushed;
28
    store_t regmark;
25
    store_t regmark;
(-)a/bcc/state.c (-11 / +5 lines)
Lines 75-82 Link Here
75
75
76
/* --- utility routines --- */
76
/* --- utility routines --- */
77
77
78
PRIVATE void addloop(newloop)
78
PRIVATE void addloop(struct loopstruct *newloop)
79
struct loopstruct *newloop;
80
{
79
{
81
    newloop->breaklab = getlabel();
80
    newloop->breaklab = getlabel();
82
    newloop->contlab = getlabel();
81
    newloop->contlab = getlabel();
Lines 101-108 Link Here
101
    loopnow = loopnow->prevloop;
100
    loopnow = loopnow->prevloop;
102
}
101
}
103
102
104
PRIVATE void evalexpression(exp)
103
PRIVATE void evalexpression(struct nodestruct *exp)
105
struct nodestruct *exp;
106
{
104
{
107
    offset_T spmark;
105
    offset_T spmark;
108
106
Lines 123-139 Link Here
123
    exprptr = exprmark;
121
    exprptr = exprmark;
124
}
122
}
125
123
126
PRIVATE bool_pt isforever(exp)
124
PRIVATE bool_pt isforever(register struct nodestruct *exp)
127
register struct nodestruct *exp;
128
{
125
{
129
    return exp == NULL ||
126
    return exp == NULL ||
130
	(exp->tag == LEAF && exp->left.symptr->storage == CONSTANT &&
127
	(exp->tag == LEAF && exp->left.symptr->storage == CONSTANT &&
131
	exp->left.symptr->offset.offv != 0);
128
	exp->left.symptr->offset.offv != 0);
132
}
129
}
133
130
134
PRIVATE void sort(caselist, count)	/* shell sort */
131
PRIVATE void sort(struct casestruct *caselist, int count)	/* shell sort */
135
struct casestruct *caselist;
136
int count;
137
{
132
{
138
    register int gap;
133
    register int gap;
139
    register int i;
134
    register int i;
Lines 668-675 Link Here
668
	jump(dfaultlab);
663
	jump(dfaultlab);
669
}
664
}
670
665
671
PUBLIC void outswoffset (offset)
666
PUBLIC void outswoffset (offset_T offset)
672
offset_T offset;
673
{
667
{
674
#ifdef FRAMEPOINTER
668
#ifdef FRAMEPOINTER
675
    outoffset(offset - softsp - framep);
669
    outoffset(offset - softsp - framep);
(-)a/bcc/table.c (-50 / +20 lines)
Lines 154-162 Link Here
154
FORWARD struct symstruct *addkeyword P((char *name, sym_pt code));
154
FORWARD struct symstruct *addkeyword P((char *name, sym_pt code));
155
FORWARD void heapcorrupterror P((void));
155
FORWARD void heapcorrupterror P((void));
156
156
157
PUBLIC struct symstruct *addglb(name, type)
157
PUBLIC struct symstruct *addglb(char *name, struct typestruct *type)
158
char *name;
159
struct typestruct *type;
160
{
158
{
161
    struct symstruct **hashptr;
159
    struct symstruct **hashptr;
162
    struct symstruct *oldsymptr = NULL; /* for -Wall */
160
    struct symstruct *oldsymptr = NULL; /* for -Wall */
Lines 190-198 Link Here
190
    return symptr;
188
    return symptr;
191
}
189
}
192
190
193
PRIVATE struct symstruct *addkeyword(name, code)
191
PRIVATE struct symstruct *addkeyword(char *name, sym_pt code)
194
char *name;
195
sym_pt code;
196
{
192
{
197
    struct symstruct *symptr;
193
    struct symstruct *symptr;
198
194
Lines 201-209 Link Here
201
    return symptr;
197
    return symptr;
202
}
198
}
203
199
204
PUBLIC struct symstruct *addloc(name, type)
200
PUBLIC struct symstruct *addloc(char *name, struct typestruct *type)
205
char *name;
206
struct typestruct *type;
207
{
201
{
208
    struct symstruct **hashptr;
202
    struct symstruct **hashptr;
209
    register struct symstruct *symptr;
203
    register struct symstruct *symptr;
Lines 232-250 Link Here
232
    return symptr;
226
    return symptr;
233
}
227
}
234
228
235
PUBLIC struct symstruct *addlorg(name, type)
229
PUBLIC struct symstruct *addlorg(char *name, struct typestruct *type)
236
char *name;
237
struct typestruct *type;
238
{
230
{
239
    if (level != GLBLEVEL)
231
    if (level != GLBLEVEL)
240
	return addloc(name, type);
232
	return addloc(name, type);
241
    return addglb(name, type);
233
    return addglb(name, type);
242
}
234
}
243
235
244
PUBLIC void addsym(name, type, symptr)
236
PUBLIC void addsym(char *name, struct typestruct *type, register struct symstruct *symptr)
245
char *name;
246
struct typestruct *type;
247
register struct symstruct *symptr;
248
{
237
{
249
    if (type->constructor & (ARRAY | FUNCTION))
238
    if (type->constructor & (ARRAY | FUNCTION))
250
	symptr->indcount = 0;
239
	symptr->indcount = 0;
Lines 257-264 Link Here
257
    strcpy(symptr->name.namea, name);
246
    strcpy(symptr->name.namea, name);
258
}
247
}
259
248
260
PUBLIC struct symstruct *constsym(longconst)
249
PUBLIC struct symstruct *constsym(value_t longconst)
261
value_t longconst;
262
{
250
{
263
    register struct symstruct *symptr;
251
    register struct symstruct *symptr;
264
252
Lines 267-274 Link Here
267
    return symptr;
255
    return symptr;
268
}
256
}
269
257
270
PUBLIC void delsym(symptr)
258
PUBLIC void delsym(register struct symstruct *symptr)
271
register struct symstruct *symptr;
272
{
259
{
273
    if ((*(symptr->prev) = symptr->next) != NULL)
260
    if ((*(symptr->prev) = symptr->next) != NULL)
274
	symptr->next->prev = symptr->prev;
261
	symptr->next->prev = symptr->prev;
Lines 432-439 Link Here
432
419
433
#endif
420
#endif
434
421
435
PUBLIC struct symstruct *exprsym(symptr)
422
PUBLIC struct symstruct *exprsym(struct symstruct *symptr)
436
struct symstruct *symptr;
437
{
423
{
438
    register struct symstruct *newsymptr;
424
    register struct symstruct *newsymptr;
439
425
Lines 450-457 Link Here
450
    return newsymptr;
436
    return newsymptr;
451
}
437
}
452
438
453
PUBLIC struct symstruct *findlorg(name)
439
PUBLIC struct symstruct *findlorg(char *name)
454
char *name;
455
{
440
{
456
    struct symstruct *symptr;
441
    struct symstruct *symptr;
457
442
Lines 462-469 Link Here
462
    return symptr;
447
    return symptr;
463
}
448
}
464
449
465
PUBLIC struct symstruct *findstruct(name)
450
PUBLIC struct symstruct *findstruct(char *name)
466
char *name;
467
{
451
{
468
    struct symstruct *symptr;
452
    struct symstruct *symptr;
469
453
Lines 476-483 Link Here
476
460
477
/* convert name to a hash table ptr */
461
/* convert name to a hash table ptr */
478
462
479
PUBLIC struct symstruct **gethashptr(sname)
463
PUBLIC struct symstruct **gethashptr(char *sname)
480
char *sname;
481
{
464
{
482
    register int hashval;
465
    register int hashval;
483
    register char *rsname;
466
    register char *rsname;
Lines 506-514 Link Here
506
489
507
/* hold string for dumping at end, to avoid mixing it with other data */
490
/* hold string for dumping at end, to avoid mixing it with other data */
508
491
509
PUBLIC label_no holdstr(sptr, stop)
492
PUBLIC label_no holdstr(char *sptr, char *stop)
510
char *sptr;
511
char *stop;
512
{
493
{
513
    register struct string *stringp;
494
    register struct string *stringp;
514
495
Lines 553-566 Link Here
553
	    delsym(symptr);
534
	    delsym(symptr);
554
}
535
}
555
536
556
PUBLIC void ourfree(ptr)
537
PUBLIC void ourfree(void *ptr)
557
void *ptr;
558
{
538
{
559
    free(ptr);
539
    free(ptr);
560
}
540
}
561
541
562
PUBLIC void *ourmalloc(nbytes)
542
PUBLIC void *ourmalloc(unsigned nbytes)
563
unsigned nbytes;
564
{
543
{
565
    void *ptr;
544
    void *ptr;
566
545
Lines 569-576 Link Here
569
    return ptr;
548
    return ptr;
570
}
549
}
571
550
572
PUBLIC void outofmemoryerror(message)
551
PUBLIC void outofmemoryerror(char *message)
573
char *message;
574
{
552
{
575
    error2error("compiler out of memory", message);
553
    error2error("compiler out of memory", message);
576
554
Lines 594-602 Link Here
594
    finishup();
572
    finishup();
595
}
573
}
596
574
597
PUBLIC void *growobject(object, extra)
575
PUBLIC void *growobject(void *object, unsigned extra)
598
void *object;
599
unsigned extra;
600
{
576
{
601
    /* size_t */ unsigned oblength;
577
    /* size_t */ unsigned oblength;
602
578
Lines 627-634 Link Here
627
#define ALLOC_OVERHEAD (sizeof (unsigned))
603
#define ALLOC_OVERHEAD (sizeof (unsigned))
628
#endif
604
#endif
629
605
630
PUBLIC void growheap(size)
606
PUBLIC void growheap(unsigned size)
631
unsigned size;
632
{
607
{
633
    register char *newptr;
608
    register char *newptr;
634
609
Lines 647-654 Link Here
647
    *(unsigned *) newptr = MARKER;
622
    *(unsigned *) newptr = MARKER;
648
}
623
}
649
624
650
PUBLIC void *qmalloc(size)
625
PUBLIC void *qmalloc(unsigned size)
651
unsigned size;
652
{
626
{
653
    register char *ptr;
627
    register char *ptr;
654
628
Lines 659-667 Link Here
659
    return ptr;
633
    return ptr;
660
}
634
}
661
635
662
PUBLIC void swapsym(sym1, sym2)
636
PUBLIC void swapsym(struct symstruct *sym1, struct symstruct *sym2)
663
struct symstruct *sym1;
664
struct symstruct *sym2;
665
{
637
{
666
    struct symstruct swaptemp;
638
    struct symstruct swaptemp;
667
639
Lines 693-701 Link Here
693
}
665
}
694
666
695
#ifndef VERY_SMALL_MEMORY
667
#ifndef VERY_SMALL_MEMORY
696
PUBLIC struct symstruct *findstrm(type, name)
668
PUBLIC struct symstruct *findstrm(struct typestruct *type, char *name)
697
struct typestruct *type;
698
char *name;
699
{
669
{
700
    struct symstruct *symptr;
670
    struct symstruct *symptr;
701
    int i;
671
    int i;
(-)a/bcc/type.c (-18 / +8 lines)
Lines 23-30 Link Here
23
PRIVATE char skey0;
23
PRIVATE char skey0;
24
PRIVATE char skey1;
24
PRIVATE char skey1;
25
25
26
PUBLIC struct typestruct *addstruct(structname)
26
PUBLIC struct typestruct *addstruct(char *structname)
27
char *structname;
28
{
27
{
29
    unsigned namelength;
28
    unsigned namelength;
30
    struct symstruct *symptr;
29
    struct symstruct *symptr;
Lines 64-71 Link Here
64
}
63
}
65
#endif
64
#endif
66
65
67
PUBLIC struct typestruct *iscalartotype(scalar)
66
PUBLIC struct typestruct *iscalartotype(scalar_pt scalar)
68
scalar_pt scalar;
69
{
67
{
70
    if (scalar & LONG)
68
    if (scalar & LONG)
71
    {
69
    {
Lines 99-120 Link Here
99
    return type;
97
    return type;
100
}
98
}
101
99
102
PUBLIC void outntypechar(type)
100
PUBLIC void outntypechar(struct typestruct *type)
103
struct typestruct *type;
104
{
101
{
105
    outnbyte(*type->tname);
102
    outnbyte(*type->tname);
106
}
103
}
107
104
108
PUBLIC struct typestruct *pointype(type)
105
PUBLIC struct typestruct *pointype(struct typestruct *type)
109
struct typestruct *type;
110
{
106
{
111
    return prefix(POINTER, ptypesize, type);
107
    return prefix(POINTER, ptypesize, type);
112
}
108
}
113
109
114
PUBLIC struct typestruct *prefix(constructor, size, type)
110
PUBLIC struct typestruct *prefix(constr_pt constructor, uoffset_T size, struct typestruct *type)
115
constr_pt constructor;
116
uoffset_T size;
117
struct typestruct *type;
118
{
111
{
119
    register struct typestruct *searchtype;
112
    register struct typestruct *searchtype;
120
113
Lines 145-152 Link Here
145
    return type->prevtype = searchtype;
138
    return type->prevtype = searchtype;
146
}
139
}
147
140
148
PUBLIC struct typestruct *promote(type)
141
PUBLIC struct typestruct *promote(struct typestruct *type)
149
struct typestruct *type;
150
{
142
{
151
    scalar_t scalar;
143
    scalar_t scalar;
152
144
Lines 165-172 Link Here
165
    return type;
157
    return type;
166
}
158
}
167
159
168
PUBLIC struct typestruct *tosigned(type)
160
PUBLIC struct typestruct *tosigned(struct typestruct *type)
169
struct typestruct *type;
170
{
161
{
171
    switch (type->scalar & ~(UNSIGNED | DLONG))
162
    switch (type->scalar & ~(UNSIGNED | DLONG))
172
    {
163
    {
Lines 184-191 Link Here
184
    }
175
    }
185
}
176
}
186
177
187
PUBLIC struct typestruct *tounsigned(type)
178
PUBLIC struct typestruct *tounsigned(struct typestruct *type)
188
struct typestruct *type;
189
{
179
{
190
    switch (type->scalar & ~(UNSIGNED | DLONG))
180
    switch (type->scalar & ~(UNSIGNED | DLONG))
191
    {
181
    {
(-)a/bootblocks/makeboot.c (-32 / +47 lines)
Lines 183-193 Link Here
183
unsigned char bpb_flags[100];
183
unsigned char bpb_flags[100];
184
int has_bpb_overrides = 0;
184
int has_bpb_overrides = 0;
185
185
186
// Forward declarations
186
static void check_msdos();
187
static void check_msdos();
188
int set_superfield(char * setstr);
189
int Usage();
190
int open_disk(char * diskname);
191
int read_sector(int sectno, char * loadaddr);
192
int check_simpledos(int bb_fatbits);
193
int check_tar();
194
int check_zapped();
195
int check_mbr();
196
int copy_tarblock();
197
int copy_mbr(char * boot_data, int boot_size);
198
int copy_superfields(char * bootsect);
199
int save_super(char * bootsect);
200
int print_super(char * bootsect);
201
int close_disk();
202
int set_dosname(int boot_name);
203
int set_asciz(int boot_name);
204
int write_sector(int sectno, char * loadaddr);
187
205
188
main(argc, argv)
206
int
189
int argc;
207
main(int argc, char ** argv)
190
char ** argv;
191
{
208
{
192
   FILE * fd;
209
   FILE * fd;
193
   struct bblist *ptr = bblocks;
210
   struct bblist *ptr = bblocks;
Lines 368-373 Link Here
368
   exit(0);
385
   exit(0);
369
}
386
}
370
387
388
int
371
Usage()
389
Usage()
372
{
390
{
373
   struct bblist *ptr = bblocks;
391
   struct bblist *ptr = bblocks;
Lines 392-399 Link Here
392
/**************************************************************************/
410
/**************************************************************************/
393
411
394
int
412
int
395
open_disk(diskname)
413
open_disk(char * diskname)
396
char * diskname;
397
{
414
{
398
#ifdef __MSDOS__
415
#ifdef __MSDOS__
399
   /* Freedos fix */
416
   /* Freedos fix */
Lines 423-428 Link Here
423
   return 0;
440
   return 0;
424
}
441
}
425
442
443
int
426
close_disk()
444
close_disk()
427
{
445
{
428
   if( diskfd && disktype == 0 ) fclose(diskfd);
446
   if( diskfd && disktype == 0 ) fclose(diskfd);
Lines 431-439 Link Here
431
}
449
}
432
450
433
int
451
int
434
write_sector(sectno, loadaddr)
452
write_sector(int sectno, char * loadaddr)
435
int sectno;
436
char * loadaddr;
437
{
453
{
438
#ifdef __MSDOS__
454
#ifdef __MSDOS__
439
   if( disktype == 1 || disktype == 2 || disktype == 129 )
455
   if( disktype == 1 || disktype == 2 || disktype == 129 )
Lines 489-497 Link Here
489
}
505
}
490
506
491
int
507
int
492
read_sector(sectno, loadaddr)
508
read_sector(int sectno, char * loadaddr)
493
int sectno;
494
char * loadaddr;
495
{
509
{
496
   int cc;
510
   int cc;
497
#ifdef __MSDOS__
511
#ifdef __MSDOS__
Lines 709-714 Link Here
709
#endif
723
#endif
710
/**************************************************************************/
724
/**************************************************************************/
711
725
726
int
712
check_zapped()
727
check_zapped()
713
{
728
{
714
   int i;
729
   int i;
Lines 746-753 Link Here
746
#define buff_tar	(*(struct tar_head*) buffer)
761
#define buff_tar	(*(struct tar_head*) buffer)
747
#define boot_tar	(*(struct tar_head*) tarboot_data)
762
#define boot_tar	(*(struct tar_head*) tarboot_data)
748
763
749
unsigned int oct(s)
764
unsigned int oct(char *s)
750
char *s;
751
{
765
{
752
   unsigned int val = 0;
766
   unsigned int val = 0;
753
   int i;
767
   int i;
Lines 756-761 Link Here
756
   return val;
770
   return val;
757
}
771
}
758
772
773
int
759
check_tar()
774
check_tar()
760
{
775
{
761
   char vbuf[100];
776
   char vbuf[100];
Lines 799-804 Link Here
799
   return 0;
814
   return 0;
800
}
815
}
801
816
817
int
802
copy_tarblock()
818
copy_tarblock()
803
{
819
{
804
   char lbuf[20];
820
   char lbuf[20];
Lines 931-938 Link Here
931
   { 0, -1,0,0}
947
   { 0, -1,0,0}
932
};
948
};
933
949
934
print_super(bootsect)
950
int
935
char * bootsect;
951
print_super(char * bootsect)
936
{
952
{
937
static char * fieldnames[] = {
953
static char * fieldnames[] = {
938
   "System ID",
954
   "System ID",
Lines 1020-1027 Link Here
1020
   }
1036
   }
1021
}
1037
}
1022
1038
1023
decode_super(bootsect)
1039
int
1024
char * bootsect;
1040
decode_super(char * bootsect)
1025
{
1041
{
1026
   int i;
1042
   int i;
1027
1043
Lines 1054-1061 Link Here
1054
     copy_zero = 0;
1070
     copy_zero = 0;
1055
}
1071
}
1056
1072
1057
save_super(bootsect)
1073
int
1058
char * bootsect;
1074
save_super(char * bootsect)
1059
{
1075
{
1060
   FILE * fd;
1076
   FILE * fd;
1061
   char * fname = "makeboot.sav";
1077
   char * fname = "makeboot.sav";
Lines 1067-1074 Link Here
1067
   fclose(fd);
1083
   fclose(fd);
1068
}
1084
}
1069
1085
1070
set_superfield(setstr)
1086
int set_superfield(char * setstr)
1071
char * setstr;
1072
{
1087
{
1073
   int i, l;
1088
   int i, l;
1074
   char * av;
1089
   char * av;
Lines 1087-1094 Link Here
1087
   }
1102
   }
1088
}
1103
}
1089
1104
1090
copy_superfields(bootsect)
1105
int
1091
char * bootsect;
1106
copy_superfields(char * bootsect)
1092
{
1107
{
1093
   int i, j;
1108
   int i, j;
1094
1109
Lines 1150-1157 Link Here
1150
   if(!force) exit(2);
1165
   if(!force) exit(2);
1151
}
1166
}
1152
1167
1153
check_simpledos(bb_fatbits)
1168
int
1154
int bb_fatbits;
1169
check_simpledos(int bb_fatbits)
1155
{
1170
{
1156
   long numclust = 0xFFFF;
1171
   long numclust = 0xFFFF;
1157
   char * err = 0;
1172
   char * err = 0;
Lines 1226-1233 Link Here
1226
   }
1241
   }
1227
}
1242
}
1228
1243
1229
set_dosname(boot_name)
1244
int
1230
int boot_name;
1245
set_dosname(int boot_name)
1231
{
1246
{
1232
   char dos_name[20];
1247
   char dos_name[20];
1233
   int i,j;
1248
   int i,j;
Lines 1248-1255 Link Here
1248
   memcpy(buffer+boot_name, dos_name, 11);
1263
   memcpy(buffer+boot_name, dos_name, 11);
1249
}
1264
}
1250
1265
1251
set_asciz(boot_name)
1266
int
1252
int boot_name;
1267
set_asciz(int boot_name)
1253
{
1268
{
1254
   int i, j;
1269
   int i, j;
1255
1270
Lines 1290-1295 Link Here
1290
   }
1305
   }
1291
}
1306
}
1292
1307
1308
int
1293
check_mbr()
1309
check_mbr()
1294
{
1310
{
1295
   int i = 0;
1311
   int i = 0;
Lines 1321-1329 Link Here
1321
   }
1337
   }
1322
}
1338
}
1323
1339
1324
copy_mbr(boot_data, boot_size)
1340
int
1325
char * boot_data;
1341
copy_mbr(char * boot_data, int boot_size)
1326
int boot_size;
1327
{
1342
{
1328
   int boot_to_copy = 446;
1343
   int boot_to_copy = 446;
1329
1344
(-)a/cpp/cpp.c (-16 / +6 lines)
Lines 189-196 Link Here
189
{ int rv; dont_subst++; rv=get_onetok(SKIP_SPACE); dont_subst--; return rv; }
189
{ int rv; dont_subst++; rv=get_onetok(SKIP_SPACE); dont_subst--; return rv; }
190
190
191
static int
191
static int
192
get_onetok(keep)
192
get_onetok(int keep)
193
int keep;
194
{
193
{
195
   char * p;
194
   char * p;
196
   int state;
195
   int state;
Lines 545-551 Link Here
545
}
544
}
546
545
547
static void 
546
static void 
548
unchget(ch)
547
unchget(int ch)
549
{
548
{
550
#if CPP_DEBUG
549
#if CPP_DEBUG
551
   fprintf(stderr, "\b", ch);
550
   fprintf(stderr, "\b", ch);
Lines 914-921 Link Here
914
}
913
}
915
914
916
static int
915
static int
917
do_proc_if(type)
916
do_proc_if(int type)
918
int type;
919
{
917
{
920
   int ch = 0;
918
   int ch = 0;
921
   if(if_false && if_hidden)
919
   if(if_false && if_hidden)
Lines 1042-1049 Link Here
1042
}
1040
}
1043
1041
1044
static int_type
1042
static int_type
1045
get_expression(prio)
1043
get_expression(int prio)
1046
int prio;
1047
{
1044
{
1048
   int_type lvalue;
1045
   int_type lvalue;
1049
   int_type rvalue;
1046
   int_type rvalue;
Lines 1255-1265 Link Here
1255
}
1252
}
1256
1253
1257
void
1254
void
1258
gen_substrings(macname, data_str, arg_count, is_vararg)
1255
gen_substrings(char * macname, char * data_str, int arg_count, int is_vararg)
1259
char * macname;
1260
char * data_str;
1261
int arg_count;
1262
int is_vararg;
1263
{
1256
{
1264
   char * mac_text = 0;
1257
   char * mac_text = 0;
1265
   struct arg_store *arg_list;
1258
   struct arg_store *arg_list;
Lines 1381-1390 Link Here
1381
}
1374
}
1382
1375
1383
static char * 
1376
static char * 
1384
insert_substrings(data_str, arg_list, arg_count)
1377
insert_substrings(char * data_str, struct arg_store *arg_list, int arg_count)
1385
char * data_str;
1386
struct arg_store *arg_list;
1387
int arg_count;
1388
{
1378
{
1389
   int ac, ch;
1379
   int ac, ch;
1390
   char * p, * s;
1380
   char * p, * s;
(-)a/cpp/hash.c (-10 / +3 lines)
Lines 31-39 Link Here
31
static int hashvalue P((int namespace, char * word));
31
static int hashvalue P((int namespace, char * word));
32
32
33
void *
33
void *
34
read_entry(namespace, word)
34
read_entry(int namespace, char * word)
35
int namespace;
36
char * word;
37
{
35
{
38
   int hash_val;
36
   int hash_val;
39
   struct hashentry * hashline;
37
   struct hashentry * hashline;
Lines 53-62 Link Here
53
}
51
}
54
52
55
char *
53
char *
56
set_entry(namespace, word, value)
54
set_entry(int namespace, char * word, void * value)
57
int namespace;
58
char * word;
59
void * value;
60
{
55
{
61
   int hash_val, i;
56
   int hash_val, i;
62
   struct hashentry * hashline, *prev;
57
   struct hashentry * hashline, *prev;
Lines 103-111 Link Here
103
   return hashline->word;
98
   return hashline->word;
104
}
99
}
105
100
106
static int hashvalue(namespace, word)
101
static int hashvalue(int namespace, char * word)
107
int namespace;
108
char * word;
109
{
102
{
110
   int val = namespace;
103
   int val = namespace;
111
   char *p = word;
104
   char *p = word;
(-)a/cpp/main.c (-24 / +10 lines)
Lines 38-46 Link Here
38
FILE * ofd = 0;
38
FILE * ofd = 0;
39
39
40
int
40
int
41
main(argc, argv)
41
main(int argc, char ** argv)
42
int argc;
43
char ** argv;
44
{
42
{
45
   int ar, i;
43
   int ar, i;
46
   char * p;
44
   char * p;
Lines 170-177 Link Here
170
}
168
}
171
169
172
void
170
void
173
undefine_macro(name)
171
undefine_macro(char * name)
174
char * name;
175
{
172
{
176
   struct define_item * ptr;
173
   struct define_item * ptr;
177
174
Lines 183-190 Link Here
183
}
180
}
184
181
185
void
182
void
186
define_macro(name)
183
define_macro(char * name)
187
char * name;
188
{
184
{
189
   char * p;
185
   char * p;
190
   char * value;
186
   char * value;
Lines 207-216 Link Here
207
}
203
}
208
204
209
FILE *
205
FILE *
210
open_include(fname, mode, checkrel)
206
open_include(char * fname, char * mode, int checkrel)
211
char * fname;
212
char * mode;
213
int checkrel;
214
{
207
{
215
   FILE * fd = 0;
208
   FILE * fd = 0;
216
   int i;
209
   int i;
Lines 247-255 Link Here
247
static int outpos = 0;
240
static int outpos = 0;
248
241
249
void
242
void
250
cmsg(mtype, str)
243
cmsg(char * mtype, char * str)
251
char * mtype;
252
char * str;
253
{
244
{
254
   if (c_fname && (*c_fname || c_lineno))
245
   if (c_fname && (*c_fname || c_lineno))
255
      fprintf(stderr, "%s:%d: ", c_fname, c_lineno);
246
      fprintf(stderr, "%s:%d: ", c_fname, c_lineno);
Lines 261-291 Link Here
261
}
252
}
262
253
263
void
254
void
264
cfatal(str)
255
cfatal(char * str)
265
char * str;
266
{
256
{
267
   cmsg("CPP-FATAL error", str);
257
   cmsg("CPP-FATAL error", str);
268
   exit(255);
258
   exit(255);
269
}
259
}
270
260
271
void
261
void
272
cerror(str)
262
cerror(char * str)
273
char * str;
274
{
263
{
275
   exit_code = 1;
264
   exit_code = 1;
276
   cmsg("error", str);
265
   cmsg("error", str);
277
}
266
}
278
267
279
void
268
void
280
cwarn(str)
269
cwarn(char * str)
281
char * str;
282
{
270
{
283
   cmsg("warning", str);
271
   cmsg("warning", str);
284
}
272
}
285
273
286
void
274
void
287
pr_indent(count)
275
pr_indent(int count)
288
int count;
289
{
276
{
290
   if(count>10) count=10;
277
   if(count>10) count=10;
291
   while(count>0) {fprintf(ofd, "\t"); count--; }
278
   while(count>0) {fprintf(ofd, "\t"); count--; }
Lines 439-446 Link Here
439
}
426
}
440
427
441
char *
428
char *
442
token_txn(token)
429
token_txn(int token)
443
int token;
444
{
430
{
445
   char * s = "UNKNOWN";
431
   char * s = "UNKNOWN";
446
   static char buf[17];
432
   static char buf[17];
(-)a/cpp/token1.h (-6 / +2 lines)
Lines 12-20 Link Here
12
__inline
12
__inline
13
#endif
13
#endif
14
static unsigned int
14
static unsigned int
15
hash1 (str, len)
15
hash1 (register const char *str, register unsigned int len)
16
     register const char *str;
17
     register unsigned int len;
18
{
16
{
19
  static unsigned char asso_values[] =
17
  static unsigned char asso_values[] =
20
    {
18
    {
Lines 52-60 Link Here
52
__inline
50
__inline
53
#endif
51
#endif
54
struct token_trans *
52
struct token_trans *
55
is_ctok (str, len)
53
is_ctok (register const char *str, register unsigned int len)
56
     register const char *str;
57
     register unsigned int len;
58
{
54
{
59
  static struct token_trans wordlist[] =
55
  static struct token_trans wordlist[] =
60
    {
56
    {
(-)a/cpp/token2.h (-6 / +2 lines)
Lines 12-20 Link Here
12
__inline
12
__inline
13
#endif
13
#endif
14
static unsigned int
14
static unsigned int
15
hash2 (str, len)
15
hash2 (register const char *str, register unsigned int len)
16
     register const char *str;
17
     register unsigned int len;
18
{
16
{
19
  static unsigned char asso_values[] =
17
  static unsigned char asso_values[] =
20
    {
18
    {
Lines 64-72 Link Here
64
__inline
62
__inline
65
#endif
63
#endif
66
struct token_trans *
64
struct token_trans *
67
is_ckey (str, len)
65
is_ckey (register const char *str, register unsigned int len)
68
     register const char *str;
69
     register unsigned int len;
70
{
66
{
71
  static struct token_trans wordlist[] =
67
  static struct token_trans wordlist[] =
72
    {
68
    {
(-)a/ifdef.c (-21 / +10 lines)
Lines 60-68 Link Here
60
void manifest_constant P((void));
60
void manifest_constant P((void));
61
61
62
int
62
int
63
main(argc, argv)
63
main(int argc, char ** argv)
64
int argc;
64
65
char ** argv;
66
{
65
{
67
   int ar;
66
   int ar;
68
   char * ptr;
67
   char * ptr;
Lines 106-113 Link Here
106
   exit(0);
105
   exit(0);
107
}
106
}
108
107
109
void Usage(prog)
108
void Usage(char * prog)
110
char * prog;
111
{
109
{
112
   fprintf(stderr, "Usage: %s [-DFLAG] [-UFLAG] [-blcrhMDU] [-C##] files\n",
110
   fprintf(stderr, "Usage: %s [-DFLAG] [-UFLAG] [-blcrhMDU] [-C##] files\n",
113
		   prog);
111
		   prog);
Lines 126-134 Link Here
126
}
124
}
127
125
128
void
126
void
129
save_name(varname, state)
127
save_name(char * varname, int state)
130
char * varname;
131
int state;
132
{
128
{
133
   struct varrec * curr;
129
   struct varrec * curr;
134
   struct varrec * prev = 0;
130
   struct varrec * prev = 0;
Lines 152-159 Link Here
152
}
148
}
153
149
154
void
150
void
155
do_file(fname)
151
do_file(char * fname)
156
char * fname;
157
{
152
{
158
   filename = fname;
153
   filename = fname;
159
   prline = lineno = 0;
154
   prline = lineno = 0;
Lines 192-199 Link Here
192
}
187
}
193
188
194
void
189
void
195
set_line(lineno)
190
set_line(int lineno)
196
int lineno;
197
{
191
{
198
   if( prline+2 == lineno )
192
   if( prline+2 == lineno )
199
      printf("\n");
193
      printf("\n");
Lines 253-261 Link Here
253
}
247
}
254
248
255
int
249
int
256
do_ifdef(p, which)
250
do_ifdef(char * p, int which)
257
char * p;
258
int which;
259
{
251
{
260
   char * nm;
252
   char * nm;
261
   char * s;
253
   char * s;
Lines 298-305 Link Here
298
290
299
#if 0
291
#if 0
300
292
301
do_if(p)
293
do_if(char * p)
302
char * p;
303
{
294
{
304
   /*
295
   /*
305
    * Look for:
296
    * Look for:
Lines 370-377 Link Here
370
#endif
361
#endif
371
362
372
void
363
void
373
check_name(nm)
364
check_name(char * nm)
374
char * nm;
375
{
365
{
376
   char * p;
366
   char * p;
377
   char * s;
367
   char * s;
Lines 396-403 Link Here
396
}
386
}
397
387
398
void
388
void
399
fatal(msg)
389
fatal(char * msg)
400
char * msg;
401
{
390
{
402
   fprintf(stderr, "Fatal error:%s\n", msg);
391
   fprintf(stderr, "Fatal error:%s\n", msg);
403
   exit(1);
392
   exit(1);
(-)a/ld/io.c (-77 / +32 lines)
Lines 60-67 Link Here
60
FORWARD void refer P((void));
60
FORWARD void refer P((void));
61
FORWARD void stderr_out P((void));
61
FORWARD void stderr_out P((void));
62
62
63
PUBLIC void ioinit(progname)
63
PUBLIC void ioinit(char *progname)
64
char *progname;
65
{
64
{
66
    infd = ERR;
65
    infd = ERR;
67
    if (*progname)
66
    if (*progname)
Lines 117-125 Link Here
117
#endif
116
#endif
118
}
117
}
119
118
120
PUBLIC void errtrace(name, level)
119
PUBLIC void errtrace(char *name, int level)
121
char *name;
122
int level;
123
{
120
{
124
    while (level-- > 0)
121
    while (level-- > 0)
125
	putbyte(' ');
122
	putbyte(' ');
Lines 174-181 Link Here
174
}
171
}
175
#endif
172
#endif
176
173
177
PUBLIC void openin(filename)
174
PUBLIC void openin(char *filename)
178
char *filename;
179
{
175
{
180
#if 0 /* XXX - this probably won't work with constructed lib names? */
176
#if 0 /* XXX - this probably won't work with constructed lib names? */
181
    if (infd == ERR || strcmp(inputname, filename) != 0)
177
    if (infd == ERR || strcmp(inputname, filename) != 0)
Lines 193-200 Link Here
193
    }
189
    }
194
}
190
}
195
191
196
PUBLIC void openout(filename)
192
PUBLIC void openout(char *filename)
197
char *filename;
198
{
193
{
199
    mode_t oldmask;
194
    mode_t oldmask;
200
195
Lines 228-235 Link Here
228
#endif
223
#endif
229
}
224
}
230
225
231
PRIVATE void outhexdigs(num)
226
PRIVATE void outhexdigs(register bin_off_t num)
232
register bin_off_t num;
233
{
227
{
234
    if (num >= 0x10)
228
    if (num >= 0x10)
235
    {
229
    {
Lines 239-246 Link Here
239
    putbyte(hexdigit[num]);
233
    putbyte(hexdigit[num]);
240
}
234
}
241
235
242
PRIVATE void put04x(num)
236
PRIVATE void put04x(register unsigned  num)
243
register unsigned num;
244
{
237
{
245
    putbyte(hexdigit[num / 0x1000]);
238
    putbyte(hexdigit[num / 0x1000]);
246
    putbyte(hexdigit[(num / 0x100) & 0x0F]);
239
    putbyte(hexdigit[(num / 0x100) & 0x0F]);
Lines 250-257 Link Here
250
243
251
#ifdef LONG_OFFSETS
244
#ifdef LONG_OFFSETS
252
245
253
PUBLIC void put08lx(num)
246
PUBLIC void put08lx(register bin_off_t num)
254
register bin_off_t num;
255
{
247
{
256
    put04x(num / 0x10000);
248
    put04x(num / 0x10000);
257
    put04x(num % 0x10000);
249
    put04x(num % 0x10000);
Lines 259-266 Link Here
259
251
260
#else /* not LONG_OFFSETS */
252
#else /* not LONG_OFFSETS */
261
253
262
PUBLIC void put08x(num)
254
PUBLIC void put08x(register bin_off_t num)
263
register bin_off_t num;
264
{
255
{
265
    putstr("0000");
256
    putstr("0000");
266
    put04x(num);
257
    put04x(num);
Lines 268-276 Link Here
268
259
269
#endif /* not LONG_OFFSETS */
260
#endif /* not LONG_OFFSETS */
270
261
271
PUBLIC void putbstr(width, str)
262
PUBLIC void putbstr(unsigned width, char *str)
272
unsigned width;
273
char *str;
274
{
263
{
275
    unsigned length;
264
    unsigned length;
276
    
265
    
Lines 279-286 Link Here
279
    putstr(str);
268
    putstr(str);
280
}
269
}
281
270
282
PUBLIC void putbyte(ch)
271
PUBLIC void putbyte(int ch)
283
int ch;
284
{
272
{
285
    register char *ebuf;
273
    register char *ebuf;
286
274
Lines 294-308 Link Here
294
    errbufptr = ebuf;
282
    errbufptr = ebuf;
295
}
283
}
296
284
297
PUBLIC void putstr(message)
285
PUBLIC void putstr(char *message)
298
char *message;
299
{
286
{
300
    while (*message != 0)
287
    while (*message != 0)
301
	putbyte(*message++);
288
	putbyte(*message++);
302
}
289
}
303
290
304
PRIVATE void putstrn(message)
291
PRIVATE void putstrn(char *message)
305
char *message;
306
{
292
{
307
    putstr(message);
293
    putstr(message);
308
    putbyte('\n');
294
    putbyte('\n');
Lines 333-341 Link Here
333
    return ch;
319
    return ch;
334
}
320
}
335
321
336
PUBLIC void readin(buf, count)
322
PUBLIC void readin(char *buf, unsigned count)
337
char *buf;
338
unsigned count;
339
{
323
{
340
    int ch;
324
    int ch;
341
    
325
    
Lines 347-355 Link Here
347
    }
331
    }
348
}
332
}
349
333
350
PUBLIC bool_pt readineofok(buf, count)
334
PUBLIC bool_pt readineofok(char *buf, unsigned count)
351
char *buf;
352
unsigned count;
353
{
335
{
354
    int ch;
336
    int ch;
355
    
337
    
Lines 362-377 Link Here
362
    return FALSE;
344
    return FALSE;
363
}
345
}
364
346
365
PUBLIC void seekin(offset)
347
PUBLIC void seekin(unsigned long offset)
366
unsigned long offset;
367
{
348
{
368
    inbufptr = inbufend = inbuf;
349
    inbufptr = inbufend = inbuf;
369
    if (lseek(infd, (off_t) offset, SEEK_SET) != offset)
350
    if (lseek(infd, (off_t) offset, SEEK_SET) != offset)
370
	prematureeof();
351
	prematureeof();
371
}
352
}
372
353
373
PUBLIC void seekout(offset)
354
PUBLIC void seekout(unsigned long offset)
374
unsigned long offset;
375
{
355
{
376
    flushout();
356
    flushout();
377
    if (lseek(outfd, (off_t) offset, SEEK_SET) != offset)
357
    if (lseek(outfd, (off_t) offset, SEEK_SET) != offset)
Lines 379-386 Link Here
379
}
359
}
380
360
381
#ifdef REL_OUTPUT
361
#ifdef REL_OUTPUT
382
PUBLIC void seektrel(offset)
362
PUBLIC void seektrel(unsigned long offset)
383
unsigned long offset;
384
{
363
{
385
    flushtrel();
364
    flushtrel();
386
    if (lseek(trelfd, (off_t) offset, SEEK_SET) != offset)
365
    if (lseek(trelfd, (off_t) offset, SEEK_SET) != offset)
Lines 388-395 Link Here
388
}
367
}
389
#endif
368
#endif
390
369
391
PUBLIC void writechar(ch)
370
PUBLIC void writechar(int ch)
392
int ch;
393
{
371
{
394
    register char *obuf;
372
    register char *obuf;
395
373
Lines 404-412 Link Here
404
}
382
}
405
383
406
#ifdef REL_OUTPUT
384
#ifdef REL_OUTPUT
407
PUBLIC void writedrel(buf, count)
385
PUBLIC void writedrel(register char *buf, unsigned count)
408
register char *buf;
409
unsigned count;
410
{
386
{
411
    register char *rbuf;
387
    register char *rbuf;
412
388
Lines 421-429 Link Here
421
}
397
}
422
#endif
398
#endif
423
399
424
PUBLIC void writeout(buf, count)
400
PUBLIC void writeout(register char *buf, unsigned count)
425
register char *buf;
426
unsigned count;
427
{
401
{
428
    register char *obuf;
402
    register char *obuf;
429
403
Lines 442-450 Link Here
442
}
416
}
443
417
444
#ifdef REL_OUTPUT
418
#ifdef REL_OUTPUT
445
PUBLIC void writetrel(buf, count)
419
PUBLIC void writetrel(register char *buf, unsigned count)
446
register char *buf;
447
unsigned count;
448
{
420
{
449
    register char *rbuf;
421
    register char *rbuf;
450
422
Lines 465-486 Link Here
465
437
466
/* error module */
438
/* error module */
467
439
468
PRIVATE void errexit(message)
440
PRIVATE void errexit(char *message)
469
char *message;
470
{
441
{
471
    putstrn(message);
442
    putstrn(message);
472
    exit(2);
443
    exit(2);
473
}
444
}
474
445
475
PUBLIC void fatalerror(message)
446
PUBLIC void fatalerror(char *message)
476
char *message;
477
{
447
{
478
    refer();
448
    refer();
479
    errexit(message);
449
    errexit(message);
480
}
450
}
481
451
482
PUBLIC void inputerror(message)
452
PUBLIC void inputerror(char *message)
483
char *message;
484
{
453
{
485
    refer();
454
    refer();
486
    putstr(message);
455
    putstr(message);
Lines 488-503 Link Here
488
    errexit(inputname);
457
    errexit(inputname);
489
}
458
}
490
459
491
PUBLIC void input1error(message)
460
PUBLIC void input1error(char *message)
492
char *message;
493
{
461
{
494
    refer();
462
    refer();
495
    putstr(inputname);
463
    putstr(inputname);
496
    errexit(message);
464
    errexit(message);
497
}
465
}
498
466
499
PRIVATE void outputerror(message)
467
PRIVATE void outputerror(char *message)
500
char *message;
501
{
468
{
502
    refer();
469
    refer();
503
    putstr(message);
470
    putstr(message);
Lines 515-526 Link Here
515
    inputerror("premature end of");
482
    inputerror("premature end of");
516
}
483
}
517
484
518
PUBLIC void redefined(name, message, archentry, deffilename, defarchentry)
485
PUBLIC void redefined(char *name, char *message, char *archentry, char *deffilename, char *defarchentry)
519
char *name;
520
char *message;
521
char *archentry;
522
char *deffilename;
523
char *defarchentry;
524
{
486
{
525
    ++warncount;
487
    ++warncount;
526
    refer();
488
    refer();
Lines 547-554 Link Here
547
    putstrn("");
509
    putstrn("");
548
}
510
}
549
511
550
PUBLIC void interseg(fname, aname, name)
512
PUBLIC void interseg(char *fname, char *aname, char *name)
551
char *fname, *aname, *name;
552
{
513
{
553
    ++errcount;
514
    ++errcount;
554
    refer();
515
    refer();
Lines 574-581 Link Here
574
    putstr(": ");
535
    putstr(": ");
575
}
536
}
576
537
577
PUBLIC void reserved(name)
538
PUBLIC void reserved(char *name)
578
char *name;
579
{
539
{
580
    ++errcount;
540
    ++errcount;
581
    stderr_out();
541
    stderr_out();
Lines 583-592 Link Here
583
    putstrn(name);
543
    putstrn(name);
584
}
544
}
585
545
586
PUBLIC void size_error(seg, count, size)
546
PUBLIC void size_error(int seg, bin_off_t count, bin_off_t size)
587
int seg;
588
bin_off_t count;
589
bin_off_t size;
590
{
547
{
591
    refer();
548
    refer();
592
    putstr("seg ");
549
    putstr("seg ");
Lines 598-605 Link Here
598
    errexit("");
555
    errexit("");
599
}
556
}
600
557
601
PUBLIC void undefined(name)
558
PUBLIC void undefined(char *name)
602
char *name;
603
{
559
{
604
    ++errcount;
560
    ++errcount;
605
    stderr_out();
561
    stderr_out();
Lines 634-641 Link Here
634
#endif
590
#endif
635
}
591
}
636
592
637
PUBLIC void use_error(message)
593
PUBLIC void use_error(char *message)
638
char *message;
639
{
594
{
640
    refer();
595
    refer();
641
    putstrn(message);
596
    putstrn(message);
(-)a/ld/ld.c (-9 / +3 lines)
Lines 39-48 Link Here
39
FORWARD char *buildname P((char *pre, char *mid, char *suf));
39
FORWARD char *buildname P((char *pre, char *mid, char *suf));
40
FORWARD char *expandlib P((char *fn));
40
FORWARD char *expandlib P((char *fn));
41
41
42
PRIVATE char *buildname(pre, mid, suf)
42
PRIVATE char *buildname(char *pre, char *mid, char *suf)
43
char *pre;
44
char *mid;
45
char *suf;
46
{
43
{
47
    char *name;
44
    char *name;
48
45
Lines 53-60 Link Here
53
    return name;
50
    return name;
54
}
51
}
55
52
56
PRIVATE char *expandlib(fn)
53
PRIVATE char *expandlib(char *fn)
57
char *fn;
58
{
54
{
59
    char *path, *s;
55
    char *path, *s;
60
    int i;
56
    int i;
Lines 73-81 Link Here
73
    return NUL_PTR;
69
    return NUL_PTR;
74
}
70
}
75
71
76
PUBLIC int main(argc, argv)
72
PUBLIC int main(int argc, char **argv)
77
int argc;
78
char **argv;
79
{
73
{
80
    register char *arg;
74
    register char *arg;
81
    int argn;
75
    int argn;
(-)a/ld/linksyms.c (-4 / +2 lines)
Lines 15-22 Link Here
15
15
16
/* link all symbols connected to entry symbols */
16
/* link all symbols connected to entry symbols */
17
17
18
PUBLIC void linksyms(argreloc_output)
18
PUBLIC void linksyms(bool_pt argreloc_output)
19
bool_pt argreloc_output;
20
{
19
{
21
    char needlink;
20
    char needlink;
22
    struct entrylist *elptr;
21
    struct entrylist *elptr;
Lines 70-77 Link Here
70
    while (needlink);
69
    while (needlink);
71
}
70
}
72
71
73
PRIVATE void linkrefs(modptr)
72
PRIVATE void linkrefs(struct modstruct *modptr)
74
struct modstruct *modptr;
75
{
73
{
76
    register struct symstruct **symparray;
74
    register struct symstruct **symparray;
77
    register struct symstruct *symptr;
75
    register struct symstruct *symptr;
(-)a/ld/objdump86.c (-16 / +7 lines)
Lines 90-98 Link Here
90
long tot_size_text=0, tot_size_data=0, tot_size_bss=0;
90
long tot_size_text=0, tot_size_data=0, tot_size_bss=0;
91
91
92
int
92
int
93
main(argc, argv)
93
main(int argc, char ** argv)
94
int argc;
95
char ** argv;
96
{
94
{
97
   int ar;
95
   int ar;
98
   char * p;
96
   char * p;
Lines 138-145 Link Here
138
}
136
}
139
137
140
void
138
void
141
do_file(fname)
139
do_file(char * fname)
142
char * fname;
143
{
140
{
144
   unsigned int magic;
141
   unsigned int magic;
145
   long 	filelength;
142
   long 	filelength;
Lines 184-191 Link Here
184
181
185
/* read archive header and return length */
182
/* read archive header and return length */
186
long
183
long
187
read_arheader(archentry)
184
read_arheader(char *archentry)
188
char *archentry;
189
{
185
{
190
   char *	  endptr;
186
   char *	  endptr;
191
   struct ar_hdr  arheader;
187
   struct ar_hdr  arheader;
Lines 203-211 Link Here
203
}
199
}
204
200
205
void
201
void
206
do_module(fname, archive)
202
do_module(char * fname, char * archive)
207
char * fname;
208
char * archive;
209
{
203
{
210
   int  modno, i;
204
   int  modno, i;
211
205
Lines 304-311 Link Here
304
}
298
}
305
299
306
int
300
int
307
error(str)
301
error(char * str)
308
char * str;
309
{
302
{
310
   switch( display_mode )
303
   switch( display_mode )
311
   {
304
   {
Lines 594-601 Link Here
594
}
587
}
595
588
596
long
589
long
597
get_sized(sz)
590
get_sized(int sz)
598
int sz;
599
{
591
{
600
   switch(sz)
592
   switch(sz)
601
   {
593
   {
Lines 651-658 Link Here
651
}
643
}
652
644
653
void
645
void
654
hex_output(ch)
646
hex_output(int ch)
655
int ch;
656
{
647
{
657
static char linebuf[80];
648
static char linebuf[80];
658
static char buf[20];
649
static char buf[20];
(-)a/ld/readobj.c (-26 / +10 lines)
Lines 49-57 Link Here
49
49
50
/* read all symbol definitions in an object file */
50
/* read all symbol definitions in an object file */
51
51
52
PUBLIC void readsyms(filename, trace)
52
PUBLIC void readsyms(char *filename, bool_pt trace)
53
char *filename;
54
bool_pt trace;
55
{
53
{
56
    char *archentry;
54
    char *archentry;
57
    long filelength;
55
    long filelength;
Lines 102-109 Link Here
102
100
103
/* read archive header and return length */
101
/* read archive header and return length */
104
102
105
PRIVATE long readarheader(parchentry)
103
PRIVATE long readarheader(char **parchentry)
106
char **parchentry;
107
{
104
{
108
    struct ar_hdr arheader;
105
    struct ar_hdr arheader;
109
    char *endptr;
106
    char *endptr;
Lines 141-149 Link Here
141
138
142
/* read the next module */
139
/* read the next module */
143
140
144
PRIVATE void readmodule(filename, archentry)
141
PRIVATE void readmodule(char *filename, char *archentry)
145
char *filename;
146
char *archentry;
147
{
142
{
148
    struct symdstruct		/* to save parts of symbol before name known */
143
    struct symdstruct		/* to save parts of symbol before name known */
149
    {
144
    {
Lines 224-231 Link Here
224
219
225
/* put symbol on entry symbol list if it is not already */
220
/* put symbol on entry symbol list if it is not already */
226
221
227
PUBLIC void entrysym(symptr)
222
PUBLIC void entrysym(struct symstruct *symptr)
228
struct symstruct *symptr;
229
{
223
{
230
    register struct entrylist *elptr;
224
    register struct entrylist *elptr;
231
225
Lines 287-295 Link Here
287
    modlast = modptr;
281
    modlast = modptr;
288
}
282
}
289
283
290
PRIVATE bool_pt redsym(symptr, value)
284
PRIVATE bool_pt redsym(register struct symstruct *symptr, bin_off_t value)
291
register struct symstruct *symptr;
292
bin_off_t value;
293
{
285
{
294
    register struct redlist *rlptr;
286
    register struct redlist *rlptr;
295
    char class;
287
    char class;
Lines 329-337 Link Here
329
    return TRUE;
321
    return TRUE;
330
}
322
}
331
323
332
PRIVATE unsigned checksum(string, length)
324
PRIVATE unsigned checksum(char *string, unsigned length)
333
char *string;
334
unsigned length;
335
{
325
{
336
    unsigned char sum;		/* this is a 1-byte checksum */
326
    unsigned char sum;		/* this is a 1-byte checksum */
337
327
Lines 340-353 Link Here
340
    return sum;
330
    return sum;
341
}
331
}
342
332
343
PUBLIC bin_off_t readconvsize(countindex)
333
PUBLIC bin_off_t readconvsize(unsigned countindex)
344
unsigned countindex;
345
{
334
{
346
    return readsize(convertsize[countindex]);
335
    return readsize(convertsize[countindex]);
347
}
336
}
348
337
349
PUBLIC bin_off_t readsize(count)
338
PUBLIC bin_off_t readsize(unsigned count)
350
unsigned count;
351
{
339
{
352
    char buf[MAX_OFFSET_SIZE];
340
    char buf[MAX_OFFSET_SIZE];
353
341
Lines 357-373 Link Here
357
    return cntooffset(buf, count);
345
    return cntooffset(buf, count);
358
}
346
}
359
347
360
PRIVATE unsigned segbits(seg, sizedesc)
348
PRIVATE unsigned segbits(unsigned seg, char *sizedesc)
361
unsigned seg;
362
char *sizedesc;
363
{
349
{
364
    return 3 & ((unsigned) sizedesc[((NSEG - 1) - seg) / 4] >> (2 * (seg % 4)));
350
    return 3 & ((unsigned) sizedesc[((NSEG - 1) - seg) / 4] >> (2 * (seg % 4)));
365
    /* unsigned to give logical shift */
351
    /* unsigned to give logical shift */
366
}
352
}
367
353
368
PUBLIC unsigned segsizecount(seg, modptr)
354
PUBLIC unsigned segsizecount(unsigned seg, struct modstruct *modptr)
369
unsigned seg;
370
struct modstruct *modptr;
371
{
355
{
372
    return convertsize[segbits(seg, modptr->segsizedesc)];
356
    return convertsize[segbits(seg, modptr->segsizedesc)];
373
}
357
}
(-)a/ld/table.c (-16 / +8 lines)
Lines 45-52 Link Here
45
/* add named symbol to end of table - initialise only name and next fields */
45
/* add named symbol to end of table - initialise only name and next fields */
46
/* caller must not duplicate names of externals for findsym() to work */
46
/* caller must not duplicate names of externals for findsym() to work */
47
47
48
PUBLIC struct symstruct *addsym(name)
48
PUBLIC struct symstruct *addsym(char *name)
49
char *name;
50
{
49
{
51
    struct symstruct **hashptr;
50
    struct symstruct **hashptr;
52
    struct symstruct *oldsymptr = 0;
51
    struct symstruct *oldsymptr = 0;
Lines 76-83 Link Here
76
75
77
/* lookup named symbol */
76
/* lookup named symbol */
78
77
79
PUBLIC struct symstruct *findsym(name)
78
PUBLIC struct symstruct *findsym(char *name)
80
char *name;
81
{
79
{
82
    struct symstruct *symptr;
80
    struct symstruct *symptr;
83
81
Lines 90-97 Link Here
90
88
91
/* convert name to a hash table ptr */
89
/* convert name to a hash table ptr */
92
90
93
PRIVATE struct symstruct **gethashptr(name)
91
PRIVATE struct symstruct **gethashptr(char *name)
94
register char *name;
95
{
92
{
96
    register unsigned hashval;
93
    register unsigned hashval;
97
94
Lines 131-138 Link Here
131
128
132
/* move symbol descriptor entries to top of table (no error checking) */
129
/* move symbol descriptor entries to top of table (no error checking) */
133
130
134
PUBLIC char *moveup(nbytes)
131
PUBLIC char *moveup(unsigned nbytes)
135
unsigned nbytes;
136
{
132
{
137
    register char *source;
133
    register char *source;
138
    register char *target;
134
    register char *target;
Lines 150-157 Link Here
150
146
151
/* our version of malloc */
147
/* our version of malloc */
152
148
153
PUBLIC char *ourmalloc(nbytes)
149
PUBLIC char *ourmalloc(unsigned nbytes)
154
unsigned nbytes;
155
{
150
{
156
    char *allocptr;
151
    char *allocptr;
157
152
Lines 164-171 Link Here
164
159
165
/* our version of free (release from bottom of table) */
160
/* our version of free (release from bottom of table) */
166
161
167
PUBLIC void ourfree(cptr)
162
PUBLIC void ourfree(char *cptr)
168
char *cptr;
169
{
163
{
170
    check_used();
164
    check_used();
171
    tableptr = cptr;
165
    tableptr = cptr;
Lines 197-204 Link Here
197
191
198
/* release from top of table */
192
/* release from top of table */
199
193
200
PUBLIC void release(cptr)
194
PUBLIC void release(char *cptr)
201
char *cptr;
202
{
195
{
203
    check_used();
196
    check_used();
204
    mainavail += cptr - tableend;
197
    mainavail += cptr - tableend;
Lines 223-230 Link Here
223
216
224
/* allocate space for string */
217
/* allocate space for string */
225
218
226
PUBLIC char *stralloc(s)
219
PUBLIC char *stralloc(char *s)
227
char *s;
228
{
220
{
229
    return strcpy(ourmalloc((unsigned) strlen(s) + 1), s);
221
    return strcpy(ourmalloc((unsigned) strlen(s) + 1), s);
230
}
222
}
(-)a/ld/typeconv.c (-28 / +10 lines)
Lines 11-26 Link Here
11
#include "globvar.h"
11
#include "globvar.h"
12
12
13
void xxerr P((char *));
13
void xxerr P((char *));
14
void xxerr(x) char * x; { write(2, x, strlen(x)); }
14
void xxerr(char * x) { write(2, x, strlen(x)); }
15
15
16
static int no_swap   = 1;
16
static int no_swap   = 1;
17
17
18
static int long_off[4] = {0,1,2,3};
18
static int long_off[4] = {0,1,2,3};
19
static int int_off[2] = {0,1};
19
static int int_off[2] = {0,1};
20
20
21
PUBLIC bool_pt typeconv_init(big_endian, long_big_endian)
21
PUBLIC bool_pt typeconv_init(bool_pt big_endian, bool_pt long_big_endian)
22
bool_pt big_endian;
23
bool_pt long_big_endian;
24
{
22
{
25
   int i;
23
   int i;
26
   no_swap = (!big_endian && !long_big_endian);
24
   no_swap = (!big_endian && !long_big_endian);
Lines 43-51 Link Here
43
   return 1;
41
   return 1;
44
}
42
}
45
43
46
PUBLIC void u2c2(buf, offset)
44
PUBLIC void u2c2(char *buf, u2_pt offset)
47
char *buf;
48
u2_pt offset;
49
{
45
{
50
#ifdef __AS386_16__
46
#ifdef __AS386_16__
51
   if( no_swap )
47
   if( no_swap )
Lines 58-66 Link Here
58
   buf[int_off[1]] = (offset>>8);
54
   buf[int_off[1]] = (offset>>8);
59
}
55
}
60
56
61
PUBLIC void u4c4(buf, offset)
57
PUBLIC void u4c4(char *buf, u4_t offset)
62
char *buf;
63
u4_t offset;
64
{
58
{
65
   int i;
59
   int i;
66
#ifdef __AS386_16__
60
#ifdef __AS386_16__
Lines 77-86 Link Here
77
   }
71
   }
78
}
72
}
79
73
80
PUBLIC void u4cn(buf, offset, count)
74
PUBLIC void u4cn(char *buf, u4_t offset, unsigned count)
81
char *buf;
82
u4_t offset;
83
unsigned count;
84
{
75
{
85
    switch(count)
76
    switch(count)
86
    {
77
    {
Lines 99-108 Link Here
99
    }
90
    }
100
}
91
}
101
92
102
PUBLIC void u2cn(buf, offset, count)
93
PUBLIC void u2cn(char *buf, u2_pt offset, unsigned count)
103
char *buf;
104
u2_pt offset;
105
unsigned count;
106
{
94
{
107
    switch(count)
95
    switch(count)
108
    {
96
    {
Lines 121-128 Link Here
121
    }
109
    }
122
}
110
}
123
111
124
PUBLIC u2_pt c2u2(buf)
112
PUBLIC u2_pt c2u2(char *buf)
125
char *buf;
126
{
113
{
127
    u2_pt res;
114
    u2_pt res;
128
#ifdef __AS386_16__
115
#ifdef __AS386_16__
Lines 134-141 Link Here
134
    return res;
121
    return res;
135
}
122
}
136
123
137
PUBLIC u4_t c4u4(buf)
124
PUBLIC u4_t c4u4(char *buf)
138
char *buf;
139
{
125
{
140
    u4_t res;
126
    u4_t res;
141
    int i;
127
    int i;
Lines 150-158 Link Here
150
    return res;
136
    return res;
151
}
137
}
152
138
153
PUBLIC u4_t cnu4(buf, count)
139
PUBLIC u4_t cnu4(char *buf, unsigned count)
154
char *buf;
155
unsigned count;
156
{
140
{
157
    switch (count)
141
    switch (count)
158
    {
142
    {
Lines 170-178 Link Here
170
    }
154
    }
171
}
155
}
172
156
173
PUBLIC u2_pt cnu2(buf, count)
157
PUBLIC u2_pt cnu2(char *buf, unsigned count)
174
char *buf;
175
unsigned count;
176
{
158
{
177
    switch (count)
159
    switch (count)
178
    {
160
    {
(-)a/ld/writebin.c (-29 / +12 lines)
Lines 121-132 Link Here
121
#define FUNCNAME writebin
121
#define FUNCNAME writebin
122
#endif
122
#endif
123
123
124
PUBLIC void FUNCNAME(outfilename, argsepid, argbits32, argstripflag, arguzp)
124
PUBLIC void FUNCNAME(char *outfilename, bool_pt argsepid, bool_pt argbits32,
125
char *outfilename;
125
					 bool_pt argstripflag, bool_pt arguzp)
126
bool_pt argsepid;
127
bool_pt argbits32;
128
bool_pt argstripflag;
129
bool_pt arguzp;
130
{
126
{
131
    char buf4[4];
127
    char buf4[4];
132
#ifdef EDOS
128
#ifdef EDOS
Lines 644-651 Link Here
644
640
645
#endif /* EDOS */
641
#endif /* EDOS */
646
642
647
PRIVATE void linkmod(modptr)
643
PRIVATE void linkmod(struct modstruct *modptr)
648
struct modstruct *modptr;
649
{
644
{
650
    char buf[ABS_TEXT_MAX];
645
    char buf[ABS_TEXT_MAX];
651
    int command;
646
    int command;
Lines 820-827 Link Here
820
    }
815
    }
821
}
816
}
822
817
823
PRIVATE void padmod(modptr)
818
PRIVATE void padmod(struct modstruct *modptr)
824
struct modstruct *modptr;
825
{
819
{
826
    bin_off_t count;
820
    bin_off_t count;
827
    fastin_t seg;
821
    fastin_t seg;
Lines 849-857 Link Here
849
    }
843
    }
850
}
844
}
851
845
852
PRIVATE void setsym(name, value)
846
PRIVATE void setsym(char *name, bin_off_t value)
853
char *name;
854
bin_off_t value;
855
{
847
{
856
    struct symstruct *symptr;
848
    struct symstruct *symptr;
857
849
Lines 862-869 Link Here
862
	    symptr->value = value;
854
	    symptr->value = value;
863
}
855
}
864
856
865
PRIVATE void symres(name)
857
PRIVATE void symres(register char *name)
866
register char *name;
867
{
858
{
868
    register struct symstruct *symptr;
859
    register struct symstruct *symptr;
869
860
Lines 882-889 Link Here
882
873
883
/* set new segment */
874
/* set new segment */
884
875
885
PRIVATE void setseg(newseg)
876
PRIVATE void setseg(fastin_pt newseg)
886
fastin_pt newseg;
887
{
877
{
888
    if (newseg != curseg)
878
    if (newseg != curseg)
889
    {
879
    {
Lines 894-909 Link Here
894
    }
884
    }
895
}
885
}
896
886
897
PRIVATE void skip(countsize)
887
PRIVATE void skip(unsigned countsize)
898
unsigned countsize;
899
{
888
{
900
    writenulls((bin_off_t) readsize(countsize));
889
    writenulls((bin_off_t) readsize(countsize));
901
}
890
}
902
891
903
#ifdef EDOS
892
#ifdef EDOS
904
893
905
PRIVATE void writeheader(commandname)
894
PRIVATE void writeheader(char *commandname)
906
char *commandname;
907
{
895
{
908
    char buf[MAX_OFFSET_SIZE];
896
    char buf[MAX_OFFSET_SIZE];
909
    bin_off_t offset;
897
    bin_off_t offset;
Lines 1035-1042 Link Here
1035
1023
1036
#endif /* MINIX */
1024
#endif /* MINIX */
1037
1025
1038
PRIVATE void writenulls(count)
1026
PRIVATE void writenulls(bin_off_t count)
1039
bin_off_t count;
1040
{
1027
{
1041
    long lcount = count;
1028
    long lcount = count;
1042
    if( lcount < 0 )
1029
    if( lcount < 0 )
Lines 1051-1062 Link Here
1051
#define FUNCNAME writebin
1038
#define FUNCNAME writebin
1052
#endif
1039
#endif
1053
1040
1054
PUBLIC void FUNCNAME(outfilename, argsepid, argbits32, argstripflag, arguzp)
1041
PUBLIC void FUNCNAME(char *outfilename, bool_pt argsepid, bool_pt argbits32,
1055
char *outfilename;
1042
					 bool_pt argstripflag, bool_pt arguzp)
1056
bool_pt argsepid;
1057
bool_pt argbits32;
1058
bool_pt argstripflag;
1059
bool_pt arguzp;
1060
{
1043
{
1061
    char * s  = "WARNING: Native a.out generation not included, sorry\n";
1044
    char * s  = "WARNING: Native a.out generation not included, sorry\n";
1062
    write(2, s, strlen(s));
1045
    write(2, s, strlen(s));
(-)a/ld/writex86.c (-22 / +9 lines)
Lines 102-114 Link Here
102
102
103
/* write binary file */
103
/* write binary file */
104
104
105
PUBLIC void write_elks(outfilename, argsepid, argbits32, argstripflag, arguzp, argxsym)
105
PUBLIC void write_elks(char *outfilename, bool_pt argsepid, bool_pt argbits32,
106
char *outfilename;
106
					   bool_pt argstripflag, bool_pt arguzp, bool_pt argxsym)
107
bool_pt argsepid;
108
bool_pt argbits32;
109
bool_pt argstripflag;
110
bool_pt arguzp;
111
bool_pt argxsym;
112
{
107
{
113
    char buf4[4];
108
    char buf4[4];
114
    char *cptr;
109
    char *cptr;
Lines 454-461 Link Here
454
    executable();
449
    executable();
455
}
450
}
456
451
457
PRIVATE void linkmod(modptr)
452
PRIVATE void linkmod(struct modstruct *modptr)
458
struct modstruct *modptr;
459
{
453
{
460
    char buf[ABS_TEXT_MAX];
454
    char buf[ABS_TEXT_MAX];
461
    int command;
455
    int command;
Lines 555-562 Link Here
555
    }
549
    }
556
}
550
}
557
551
558
PRIVATE void padmod(modptr)
552
PRIVATE void padmod(struct modstruct *modptr)
559
struct modstruct *modptr;
560
{
553
{
561
    bin_off_t count;
554
    bin_off_t count;
562
    fastin_t seg;
555
    fastin_t seg;
Lines 584-592 Link Here
584
    }
577
    }
585
}
578
}
586
579
587
PRIVATE void setsym(name, value)
580
PRIVATE void setsym(char *name, bin_off_t value)
588
char *name;
589
bin_off_t value;
590
{
581
{
591
    struct symstruct *symptr;
582
    struct symstruct *symptr;
592
583
Lines 594-601 Link Here
594
	symptr->value = value;
585
	symptr->value = value;
595
}
586
}
596
587
597
PRIVATE void symres(name)
588
PRIVATE void symres(register char *name)
598
register char *name;
599
{
589
{
600
    register struct symstruct *symptr;
590
    register struct symstruct *symptr;
601
591
Lines 611-618 Link Here
611
601
612
/* set new segment */
602
/* set new segment */
613
603
614
PRIVATE void setseg(newseg)
604
PRIVATE void setseg(fastin_pt newseg)
615
fastin_pt newseg;
616
{
605
{
617
    if (newseg != curseg)
606
    if (newseg != curseg)
618
    {
607
    {
Lines 623-630 Link Here
623
    }
612
    }
624
}
613
}
625
614
626
PRIVATE void skip(countsize)
615
PRIVATE void skip(unsigned countsize)
627
unsigned countsize;
628
{
616
{
629
    writenulls((bin_off_t) readsize(countsize));
617
    writenulls((bin_off_t) readsize(countsize));
630
}
618
}
Lines 721-728 Link Here
721
}
709
}
722
#endif
710
#endif
723
711
724
PRIVATE void writenulls(count)
712
PRIVATE void writenulls(bin_off_t count)
725
bin_off_t count;
726
{
713
{
727
    long lcount = count;
714
    long lcount = count;
728
    spos += count;
715
    spos += count;
(-)a/unproto/hash.c (-3 / +1 lines)
Lines 31-39 Link Here
31
31
32
/* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */
32
/* hash - hash a string; original author: P. J. Weinberger at Bell Labs. */
33
33
34
int     hash(s, size)
34
int hash(register char *s, unsigned size)
35
register char *s;
36
unsigned size;
37
{
35
{
38
    register unsigned long h = 0;
36
    register unsigned long h = 0;
39
    register unsigned long g;
37
    register unsigned long g;
(-)a/unproto/strsave.c (-5 / +5 lines)
Lines 24-38 Link Here
24
24
25
static char strsave_sccsid[] = "@(#) strsave.c 1.1 92/01/15 21:53:13";
25
static char strsave_sccsid[] = "@(#) strsave.c 1.1 92/01/15 21:53:13";
26
26
27
/* C library */
28
29
extern char *strcpy();
30
extern char *malloc();
31
32
/* Application-specific stuff */
27
/* Application-specific stuff */
33
28
34
#include "error.h"
29
#include "error.h"
35
30
31
#include <stdlib.h>
32
#include <string.h>
33
34
extern int hash(register char *s, unsigned size);
35
36
#define	STR_TABSIZE	100
36
#define	STR_TABSIZE	100
37
37
38
struct string {
38
struct string {
(-)a/unproto/symbol.c (+4 lines)
Lines 51-58 Link Here
51
#include "token.h"
51
#include "token.h"
52
#include "symbol.h"
52
#include "symbol.h"
53
53
54
#include <string.h>
55
54
#define	SYM_TABSIZE	20
56
#define	SYM_TABSIZE	20
55
57
58
extern int hash(register char *s, unsigned size);
59
56
static struct symbol *sym_tab[SYM_TABSIZE] = {0,};
60
static struct symbol *sym_tab[SYM_TABSIZE] = {0,};
57
61
58
/* More string stuff. Maybe it should go to an #include file. */
62
/* More string stuff. Maybe it should go to an #include file. */
(-)a/unproto/tok_class.c (+1 lines)
Lines 49-54 Link Here
49
/* C library */
49
/* C library */
50
50
51
#include <stdio.h>
51
#include <stdio.h>
52
#include <string.h>
52
53
53
extern char *strcpy();
54
extern char *strcpy();
54
extern long time();
55
extern long time();
(-)a/unproto/tok_io.c (-5 / +2 lines)
Lines 79-91 Link Here
79
/* C library */
79
/* C library */
80
80
81
#include <stdio.h>
81
#include <stdio.h>
82
#include <stdlib.h>
83
#include <string.h>
82
#include <ctype.h>
84
#include <ctype.h>
83
85
84
extern char *strchr();
85
extern char *malloc();
86
extern char *realloc();
87
extern char *strcpy();
88
89
/* Application-specific stuff */
86
/* Application-specific stuff */
90
87
91
#include "token.h"
88
#include "token.h"
(-)a/unproto/unproto.c (+1 lines)
Lines 137-142 Link Here
137
#include <sys/types.h>
137
#include <sys/types.h>
138
#include <sys/stat.h>
138
#include <sys/stat.h>
139
#include <stdio.h>
139
#include <stdio.h>
140
#include <string.h>
140
#include <errno.h>
141
#include <errno.h>
141
142
142
extern void exit();
143
extern void exit();

Return to bug 891533