[Parted-commits] GNU Parted Official Repository: Changes to 'master'

Jim Meyering meyering at alioth.debian.org
Sun Jan 8 20:05:27 UTC 2012


 include/parted/parted.h    |   11 ++++++++++-
 tests/t0220-gpt-msftres.sh |    2 +-
 tests/t7000-scripting.sh   |    4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit d51bfc0bf33680e55cd528eac427573dad4e54e9
Author: Jim Meyering <meyering at redhat.com>
Date:   Sun Jan 8 20:43:26 2012 +0100

    libparted: don't use _GL_ATTRIBUTE_CONST in public parted.h, ...
    
    Instead, use the bare __attribute__((__const__)).
    * include/parted/parted.h (__attribute): Define.
    (ped_get_version): Use open-coded __attribute.
    Prompted by a report from Keshav P R.

diff --git a/include/parted/parted.h b/include/parted/parted.h
index 6c0d2e1..dff6dca 100644
--- a/include/parted/parted.h
+++ b/include/parted/parted.h
@@ -25,6 +25,12 @@
 extern "C" {
 #endif
 
+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)
+# define __attribute(arg) __attribute__ (arg)
+#else
+# define __attribute(arg)
+#endif
+
 #include <parted/constraint.h>
 #include <parted/device.h>
 #include <parted/disk.h>
@@ -37,7 +43,10 @@ extern "C" {
 #include <stdlib.h>
 #include <string.h>
 
-extern const char* ped_get_version () _GL_ATTRIBUTE_CONST;
+extern const char *ped_get_version ()
+#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)
+  __attribute ((__const__));
+#endif
 
 extern void* ped_malloc (size_t size);
 extern void* ped_calloc (size_t size);

commit 5ce39625c2619346b2ec5ea650159f3093a63009
Author: Jim Meyering <meyering at redhat.com>
Date:   Sun Jan 8 18:03:34 2012 +0100

    tests: fix misleading mkpart usage
    
    Using "primary" is fine (and common) as a partition *type* for dos
    partition tables, but with a partition table of type GPT, it is
    downright misleading to specify the partition *name* as "primary".
    * tests/t0220-gpt-msftres.sh: Use "p-name" as partition name,
    rather than misleading "primary".
    * tests/t7000-scripting.sh: Likewise.

diff --git a/tests/t0220-gpt-msftres.sh b/tests/t0220-gpt-msftres.sh
index 83c50f2..8bfa17c 100755
--- a/tests/t0220-gpt-msftres.sh
+++ b/tests/t0220-gpt-msftres.sh
@@ -57,7 +57,7 @@ i=1
 for type in $fs_types; do
   end=$(expr $start + $part_size - 1)
   echo "$i:${start}s:${end}s:${part_size}s::$type:;" >> exp || fail=1
-  parted -s $dev mkpart primary $type ${start}s ${end}s > err 2>&1 || fail=1
+  parted -s $dev mkpart p-name $type ${start}s ${end}s > err 2>&1 || fail=1
   compare /dev/null err || fail=1
   parted -s $dev name $i $type > err 2>&1 || fail=1
   compare /dev/null err || fail=1
diff --git a/tests/t7000-scripting.sh b/tests/t7000-scripting.sh
index 1cfb08a..e64814b 100755
--- a/tests/t7000-scripting.sh
+++ b/tests/t7000-scripting.sh
@@ -47,7 +47,7 @@ for mkpart in mkpart; do
   dd if=/dev/zero of=testfile bs=${ss}c count=$N 2> /dev/null || fail=1
 
   # Test the scripting mode of $mkpart.
-  parted -s testfile -- mklabel gpt "$mkpart" primary ext3 1s -1s > out 2>&1
+  parted -s testfile -- mklabel gpt "$mkpart" p-name ext3 1s -1s > out 2>&1
   test $? = 1 || fail=1
 
   # Compare the real error and the expected one
@@ -61,7 +61,7 @@ for mkpart in mkpart; do
   # Test the interactive mode of $mkpart
   echo n | \
     parted ---pretend-input-tty testfile \
-      "mklabel gpt '$mkpart' primary ext3 1s -1s" > out 2>&1 && fail=1
+      "mklabel gpt '$mkpart' p-name ext3 1s -1s" > out 2>&1 && fail=1
 
   # We have to format the output before comparing.
   # normalize the actual output



More information about the Parted-commits mailing list