OpenSDE Packages Database (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

102 lines
3.4 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: package/.../gpart/debian_fixes.patch
  5. # Copyright (C) 2006 - 2008 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This patch file is dual-licensed. It is available under the license the
  10. # patched project is licensed under, as long as it is an OpenSource license
  11. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  12. # of the GNU General Public License as published by the Free Software
  13. # Foundation; either version 2 of the License, or (at your option) any later
  14. # version.
  15. # --- SDE-COPYRIGHT-NOTE-END ---
  16. Fixed ntfs module to make use of the proper initeger types. (Debian)
  17. --- gpart-0.1h.orig/src/gm_ntfs.h
  18. +++ gpart-0.1h/src/gm_ntfs.h
  19. @@ -14,6 +14,9 @@
  20. *
  21. */
  22. +#include <stdint.h>
  23. +#include <asm/byteorder.h>
  24. +
  25. #ifndef _GM_NTFS_H
  26. #define _GM_NTFS_H
  27. @@ -29,32 +32,38 @@
  28. /* 'NTFS' in little endian */
  29. #define NTFS_SUPER_MAGIC 0x5346544E
  30. -#if defined(i386) || defined(__i386__) || defined(__alpha__)
  31. -
  32. /* unsigned integral types */
  33. #ifndef NTFS_INTEGRAL_TYPES
  34. #define NTFS_INTEGRAL_TYPES
  35. -typedef unsigned char ntfs_u8;
  36. -typedef unsigned short ntfs_u16;
  37. -typedef unsigned int ntfs_u32;
  38. -typedef s64_t ntfs_u64;
  39. +typedef uint8_t ntfs_u8;
  40. +typedef uint16_t ntfs_u16;
  41. +typedef uint32_t ntfs_u32;
  42. +typedef uint64_t ntfs_u64;
  43. +typedef int8_t ntfs_s8;
  44. +typedef int16_t ntfs_s16;
  45. #endif /* NTFS_INTEGRAL_TYPES */
  46. -#endif /* defined(i386) || defined(__i386__) || defined(__alpha__) */
  47. -
  48. -
  49. -/* Macros reading unsigned integers from a byte pointer */
  50. -/* these should work for all little endian machines */
  51. -#define NTFS_GETU8(p) (*(ntfs_u8*)(p))
  52. -#define NTFS_GETU16(p) (*(ntfs_u16*)(p))
  53. -#define NTFS_GETU24(p) (NTFS_GETU32(p) & 0xFFFFFF)
  54. -#define NTFS_GETU32(p) (*(ntfs_u32*)(p))
  55. -#define NTFS_GETU64(p) (*(ntfs_u64*)(p))
  56. -
  57. -/* Macros reading signed integers, returning int */
  58. -#define NTFS_GETS8(p) ((int)(*(char*)(p)))
  59. -#define NTFS_GETS16(p) ((int)(*(short*)(p)))
  60. -#define NTFS_GETS24(p) (NTFS_GETU24(p) < 0x800000 ? (int)NTFS_GETU24(p) :
  61. -
  62. +#define CPU_TO_LE16(a) __cpu_to_le16(a)
  63. +#define CPU_TO_LE32(a) __cpu_to_le32(a)
  64. +#define CPU_TO_LE64(a) __cpu_to_le64(a)
  65. +
  66. +#define LE16_TO_CPU(a) __cpu_to_le16(a)
  67. +#define LE32_TO_CPU(a) __cpu_to_le32(a)
  68. +#define LE64_TO_CPU(a) __cpu_to_le64(a)
  69. +
  70. +/* Macros reading unsigned integers */
  71. +#define NTFS_GETU8(p) (*(ntfs_u8*)(p))
  72. +#define NTFS_GETU16(p) ((ntfs_u16)LE16_TO_CPU(*(ntfs_u16*)(p)))
  73. +#define NTFS_GETU24(p) ((ntfs_u32)NTFS_GETU16(p) | \
  74. + ((ntfs_u32)NTFS_GETU8(((char*)(p)) + 2) << 16))
  75. +#define NTFS_GETU32(p) ((ntfs_u32)LE32_TO_CPU(*(ntfs_u32*)(p)))
  76. +#define NTFS_GETU64(p) ((ntfs_u64)LE64_TO_CPU(*(ntfs_u64*)(p)))
  77. +
  78. +/* Macros reading signed integers */
  79. +#define NTFS_GETS8(p) ((*(ntfs_s8*)(p)))
  80. +#define NTFS_GETS16(p) ((ntfs_s16)LE16_TO_CPU(*(short*)(p)))
  81. +#define NTFS_GETS24(p) (NTFS_GETU24(p) < 0x800000 ? \
  82. + (int)NTFS_GETU24(p) : \
  83. + (int)(NTFS_GETU24(p) - 0x1000000))
  84. #endif /* _GM_NTFS_H */
  85. --- gpart-0.1h.orig/src/gm_fat.h
  86. +++ gpart-0.1h/src/gm_fat.h
  87. @@ -60,6 +60,6 @@
  88. __u16 info_sector; /* filesystem info sector */
  89. __u16 backup_boot; /* backup boot sector */
  90. __u16 reserved2[6]; /* Unused */
  91. -};
  92. -
  93. +} __attribute__ ((packed));
  94. +
  95. #endif /* _GM_FAT_H */