-
Notifications
You must be signed in to change notification settings - Fork 9
assorted fixes for powerpc-apple-darwin9 #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a74728f
d7b590b
e503f39
cecfebf
1efba18
db910bf
310a9c6
d09b1ce
fead401
102a254
979cb81
1675582
04c33c6
908445b
5853ccf
952557f
e83ac12
f97f34c
1755e70
e672253
3127e33
58967cf
86d7771
de3eb17
0d77d50
37f0876
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,12 +123,12 @@ main(argc, argv) | |
| run_ranlib = 1; | ||
|
|
||
| if (argc < 3) { | ||
| if(strcmp(argv[1], "--version") == 0){ | ||
| if(argc >= 2 && strcmp(argv[1], "--version") == 0){ | ||
| /* Implement a gnu-style --version to be friendly to GCC. */ | ||
| fprintf(stdout, "xtools-%s ar %s\nBased on Apple Inc. %s\n", | ||
| xtools_version, package_version, apple_version); | ||
| exit(0); | ||
| } else if(strcmp(argv[1], "--help") == 0){ | ||
| } else if(argc >= 2 && strcmp(argv[1], "--help") == 0){ | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These changes were already included in #8 which has been merged; I wonder why they're still showing up as part of the diff here? |
||
| usage(0); | ||
| fprintf(stdout, "Please report bugs to %s\n", support_url); | ||
| exit(0); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,8 +231,9 @@ get_arobj(fd) | |
| int fd; | ||
| { | ||
| struct ar_hdr *hdr; | ||
| int len, nr; | ||
| size_t len, nr; | ||
| char *p, buf[20]; | ||
| long longval; | ||
|
|
||
| nr = read(fd, hb, sizeof(HDR)); | ||
| if (nr != sizeof(HDR)) { | ||
|
|
@@ -252,8 +253,10 @@ get_arobj(fd) | |
| #define OCTAL 8 | ||
|
|
||
| AR_ATOI(hdr->ar_date, chdr.date, sizeof(hdr->ar_date), DECIMAL); | ||
| AR_ATOI(hdr->ar_uid, chdr.uid, sizeof(hdr->ar_uid), DECIMAL); | ||
| AR_ATOI(hdr->ar_gid, chdr.gid, sizeof(hdr->ar_gid), DECIMAL); | ||
| AR_ATOI(hdr->ar_uid, longval, sizeof(hdr->ar_uid), DECIMAL); | ||
| chdr.uid = (uid_t)longval; | ||
| AR_ATOI(hdr->ar_gid, longval, sizeof(hdr->ar_gid), DECIMAL); | ||
| chdr.gid = (gid_t)longval; | ||
| AR_ATOI(hdr->ar_mode, chdr.mode, sizeof(hdr->ar_mode), OCTAL); | ||
| AR_ATOI(hdr->ar_size, chdr.size, sizeof(hdr->ar_size), DECIMAL); | ||
|
|
||
|
|
@@ -288,7 +291,7 @@ get_arobj(fd) | |
| return (1); | ||
| } | ||
|
|
||
| static int already_written; | ||
| static size_t already_written; | ||
|
|
||
| /* | ||
| * put_arobj -- | ||
|
|
@@ -299,7 +302,7 @@ put_arobj(cfp, sb) | |
| CF *cfp; | ||
| struct stat *sb; | ||
| { | ||
| unsigned int lname; | ||
| size_t lname; | ||
| char *name; | ||
| struct ar_hdr *hdr; | ||
| off_t size; | ||
|
|
@@ -343,7 +346,8 @@ put_arobj(cfp, sb) | |
| sb->st_mode, sb->st_size, ARFMAG); | ||
| lname = 0; | ||
| } else if (lname > sizeof(hdr->ar_name) || strchr(name, ' ')) | ||
| (void)sprintf(hb, HDR1, AR_EFMT1, (lname + 3) & ~3, | ||
| (void)sprintf(hb, HDR1, AR_EFMT1, | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if it'd be worthwhile to change |
||
| (int)((lname + 3) & ~3), | ||
| (long int)tv_sec, | ||
| (unsigned int)(u_short)sb->st_uid, | ||
| (unsigned int)(u_short)sb->st_gid, | ||
|
|
@@ -371,13 +375,13 @@ put_arobj(cfp, sb) | |
| * which is required for object files in archives. | ||
| */ | ||
| if (lname) { | ||
| if (write(cfp->wfd, name, lname) != (int)lname) | ||
| if (write(cfp->wfd, name, lname) != (ssize_t)lname) | ||
| error(cfp->wname); | ||
| already_written = lname; | ||
| if ((lname % 4) != 0) { | ||
| static char pad[3] = "\0\0\0"; | ||
| if (write(cfp->wfd, pad, 4-(lname%4)) != | ||
| (int)(4-(lname%4))) | ||
| (ssize_t)(4-(lname%4))) | ||
| error(cfp->wname); | ||
| already_written += 4 - (lname % 4); | ||
| } | ||
|
|
@@ -407,7 +411,8 @@ copy_ar(cfp, size) | |
| { | ||
| static char pad = '\n'; | ||
| off_t sz; | ||
| int from, nr, nw, off, to; | ||
| ssize_t nr, nw; | ||
| int from, off, to; | ||
| char buf[8*1024]; | ||
|
|
||
| nr = 0; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, so, yes, this file is old and obsolete, but would it really harm anything just to leave it?