diff options
author | Elizabeth Myers <elizabeth@interlinked.me> | 2017-01-24 03:54:56 +0000 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-01-24 03:54:56 +0000 |
commit | cf86ca4248dcfb369816ceb50ef87daf38bd932f (patch) | |
tree | a82b15593c7ae5b9ad374b9395c792f735b2da7b /sys-fs/mac-fdisk/files | |
parent | 79abd251f1491f44ec34d90895b14f47d7a3d452 (diff) | |
download | packages-cf86ca4248dcfb369816ceb50ef87daf38bd932f.tar.gz packages-cf86ca4248dcfb369816ceb50ef87daf38bd932f.tar.bz2 packages-cf86ca4248dcfb369816ceb50ef87daf38bd932f.tar.xz packages-cf86ca4248dcfb369816ceb50ef87daf38bd932f.zip |
sys-fs/mac-fdisk: Patch
Diffstat (limited to 'sys-fs/mac-fdisk/files')
-rw-r--r-- | sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch new file mode 100644 index 000000000..943827ffc --- /dev/null +++ b/sys-fs/mac-fdisk/files/mac-fdisk-0.1_p16-proper-inline.patch @@ -0,0 +1,65 @@ +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};
+
|