Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Adélie Package Tree
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Adélie Linux
Adélie Package Tree
Commits
cf86ca42
Commit
cf86ca42
authored
8 years ago
by
Elizabeth Myers
Committed by
Anna Wilcox
8 years ago
Browse files
Options
Downloads
Patches
Plain Diff
sys-fs/mac-fdisk: Patch
parent
79abd251
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch
+65
-0
65 additions, 0 deletions
sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch
with
65 additions
and
0 deletions
sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch
0 → 100644
+
65
−
0
View file @
cf86ca42
diff --git a/fdisk.c b/fdisk.c
index d77619b..540879a 100644
--- a/fdisk.c
+++ b/fdisk.c
@@ -192,13 +192,21 @@
char read_char(char *mesg);
jmp_buf listingbuf;
-inline unsigned short __swap16(unsigned short x) {
+static inline unsigned short __swap16(unsigned short x) {
return (((__u16)(x) & 0xFF) << 8) | (((__u16)(x) & 0xFF00) >> 8);
}
-inline __u32 __swap32(__u32 x) {
+static inline __u32 __swap32(__u32 x) {
return (((__u32)(x) & 0xFF) << 24) | (((__u32)(x) & 0xFF00) << 8) | (((__u32)(x) & 0xFF0000) >> 8) | (((__u32)(x) & 0xFF000000) >> 24);
}
+#if BYTE_ORDER == BIG_ENDIAN
+#define SWAP16(x) __swap16(x)
+#define SWAP32(x) __swap32(x)
+#else
+#define SWAP16(x) ((__u16)x)
+#define SWAP32(x) ((__u32)x)
+#endif
+
void fatal(enum failure why)
{
char error[LINE_LENGTH],
@@ -1242,7 +1250,7 @@
void new_partition(void)
else
printf("Invalid partition number "
"for type `%c'\n", c);
-
+
}
}
@@ -1339,7 +1347,7 @@
void move_begin(int i)
}
first = rounded(calculate(p->head, p->sector, p->cyl), SWAP32(p->start_sect) +
offsets[i]);
- new = read_int(first, first,
+ new = read_int(first, first,
SWAP32(p->start_sect) + SWAP32(p->nr_sects) + offsets[i] - 1,
lower, "New beginning of data") - offsets[i];
diff --git a/fdisk.h b/fdisk.h
index 2b6ddc8..9d3ab25 100644
--- a/fdisk.h
+++ b/fdisk.h
@@ -12,14 +12,6 @@
typedef long long ext2_loff_t;
typedef long ext2_loff_t;
#endif
-#if BYTE_ORDER == BIG_ENDIAN
-#define SWAP16(x) __swap16(x)
-#define SWAP32(x) __swap32(x)
-#else
-#define SWAP16(x) ((__u16)x)
-#define SWAP32(x) ((__u32)x)
-#endif
-
enum failure {usage, unable_to_open, unable_to_read, unable_to_seek,
unable_to_write, out_of_memory};
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment