xbin on 16bit machines
Jim Budler
jimb at amdcad.UUCP
Mon Apr 1 06:22:01 AEST 1985
The following context diff will allow xbin to be
used on a machine with 16bit int's. I sent a copy to
the author, Dave Johnson, and he suggested I post it
here.
*** xbin.c.old Sat Mar 30 17:08:07 1985
--- xbin.c Sun Mar 31 00:39:24 1985
***************
*** 99,104
* revised ddj 03/17/85 -- extend new features to older formats: -l, stdin
* revised ddj 03/24/85 -- check for filename truncation, allow multiple files
* revised ddj 03/26/85 -- fixed USG botches, many problems w/multiple files
*/
char usage[] = "usage: \"xbin [-v] [-l] [-o] [-n name] [-] filename\"\n";
--- 99,105 -----
* revised ddj 03/17/85 -- extend new features to older formats: -l, stdin
* revised ddj 03/24/85 -- check for filename truncation, allow multiple files
* revised ddj 03/26/85 -- fixed USG botches, many problems w/multiple files
+ * revised jcb 03/30/85 -- revised for compatibility with 16-bit int
*/
char usage[] = "usage: \"xbin [-v] [-l] [-o] [-n name] [-] filename\"\n";
***************
*** 255,262
printf("author: %.4s, ", mh.m_author);
printf("flags: 0x%x\n", mh.m_flags);
if (qformat) {
! printf("data length: %d, ", mh.m_datalen);
! printf("rsrc length: %d\n", mh.m_rsrclen);
}
if (!pre_beta) {
printf("create time: %s", ctime(&mh.m_createtime));
--- 256,263 -----
printf("author: %.4s, ", mh.m_author);
printf("flags: 0x%x\n", mh.m_flags);
if (qformat) {
! printf("data length: %ld, ", mh.m_datalen);
! printf("rsrc length: %ld\n", mh.m_rsrclen);
}
if (!pre_beta) {
printf("create time: %s", ctime(&mh.m_createtime));
***************
*** 412,418
do_q_fork(fname, len)
char *fname;
! register int len;
{
FILE *outf;
register int c, i;
--- 413,419 -----
do_q_fork(fname, len)
char *fname;
! register long len;
{
FILE *outf;
register int c, i;
***************
*** 490,497
get4q()
{
register int c, i;
! long value = 0;
!
for (i = 0; i < 4; i++) {
c = getq();
value <<= 8;
--- 491,497 -----
get4q()
{
register int c, i;
! long value = 0L;
for (i = 0; i < 4; i++) {
c = getq();
value <<= 8;
***************
*** 626,632
register unsigned int c;
{
register int i;
! register unsigned int temp = crc;
for (i=0; i<8; i++) {
c <<= 1;
--- 626,632 -----
register unsigned int c;
{
register int i;
! register long temp = crc;
for (i=0; i<8; i++) {
c <<= 1;
***************
*** 693,698
int forks = 0, found_crc = 0;
int calc_crc, file_crc;
int n;
crc = 0; /* calculate a crc for both forks */
--- 693,699 -----
int forks = 0, found_crc = 0;
int calc_crc, file_crc;
int n;
+ long make_file();
crc = 0; /* calculate a crc for both forks */
***************
*** 737,743
exit(3);
}
}
!
make_file(fname, compressed)
char *fname;
int compressed;
--- 738,744 -----
exit(3);
}
}
! long
make_file(fname, compressed)
char *fname;
int compressed;
***************
*** 745,751
register int n;
char ibuf[BUFSIZ];
FILE *outf;
! int nbytes = 0;
outf = fopen(fname, "w");
if (outf == NULL) {
--- 746,752 -----
register int n;
char ibuf[BUFSIZ];
FILE *outf;
! long nbytes = 0L;
outf = fopen(fname, "w");
if (outf == NULL) {
--
Jim Budler
Advanced Micro Devices, Inc.
(408) 749-5806
UUCPnet: {ucbvax,decwrl,ihnp4,allegra,intelca}!amdcad!jimb
Compuserve: 72415,1200
More information about the Comp.sources.bugs
mailing list