bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

new helper function, no more linux.lo warnings, cleanup


From: Jim Meyering
Subject: new helper function, no more linux.lo warnings, cleanup
Date: Thu, 12 Jan 2012 19:16:13 +0100

I am using the new function added by the first patch
in the in-progress HFS/FAT-resize work, but it's of general use,
so I'm adding it separately.

I'd gotten used to the Makefile warnings fixed by the second patch.
We should never allow ourselves to get used to warnings.

The third is clean-up, inducing no semantic change.


>From b87498c214ed9ae74cdca3b44cdb83f749f654db Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 21 Dec 2011 16:56:17 +0100
Subject: [PATCH 1/3] libparted: provide a new convenience function:
 ptt_geom_clear_sectors

* libparted/labels/pt-tools.c (ptt_geom_clear_sectors): New function.
* libparted/labels/pt-tools.h: Declare it.
---
 libparted/labels/pt-tools.c |    8 ++++++++
 libparted/labels/pt-tools.h |    2 ++
 2 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/libparted/labels/pt-tools.c b/libparted/labels/pt-tools.c
index a8ac4e4..2693151 100644
--- a/libparted/labels/pt-tools.c
+++ b/libparted/labels/pt-tools.c
@@ -103,6 +103,14 @@ ptt_clear_sectors (PedDevice *dev, PedSector start, 
PedSector n)
           ? 1 : ped_device_write (dev, zero, start + n_z_sectors * i, rem));
 }

+/* Zero N sectors of GEOM->dev, starting with GEOM->start + START.
+   Return nonzero to indicate success, zero otherwise.  */
+int
+ptt_geom_clear_sectors (PedGeometry *geom, PedSector start, PedSector n)
+{
+  return ptt_clear_sectors (geom->dev, geom->start + start, n);
+}
+
 #include "pt-limit.c"

 /* Throw an exception and return 0 if PART's starting sector number or
diff --git a/libparted/labels/pt-tools.h b/libparted/labels/pt-tools.h
index ba02977..aa31122 100644
--- a/libparted/labels/pt-tools.h
+++ b/libparted/labels/pt-tools.h
@@ -22,6 +22,8 @@ int ptt_read_sector (PedDevice const *dev, PedSector 
sector_num, void **buf);
 int ptt_read_sectors (PedDevice const *dev, PedSector start_sector,
                      PedSector n_sectors, void **buf);
 int ptt_clear_sectors (PedDevice *dev, PedSector start, PedSector count);
+int ptt_geom_clear_sectors (PedGeometry *geom, PedSector start,
+                           PedSector count);
 int ptt_partition_max_start_len (char const *label_type,
                 const PedPartition *part);

--
1.7.9.rc0.25.gc7817


>From a3c351c2d1cf2c0000bbc681959695c612bd19a0 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 Jan 2012 19:03:20 +0100
Subject: [PATCH 2/3] maint: avoid long-standing warnings from make:

  Makefile:1274: warning: overriding recipe for target `linux.lo'
  Makefile:1267: warning: ignoring old recipe for target `linux.lo'

* libparted/Makefile.am (EXTRA_DIST): Rename from
EXTRA_libparted_la_SOURCES.
---
 libparted/Makefile.am |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/libparted/Makefile.am b/libparted/Makefile.am
index 08a0454..828a288 100644
--- a/libparted/Makefile.am
+++ b/libparted/Makefile.am
@@ -47,10 +47,11 @@ libparted_la_SOURCES  = debug.c                     \
                        $(ARCH_SOURCE)


-EXTRA_libparted_la_SOURCES    = arch/linux.c   \
-                               arch/linux.h    \
-                               arch/gnu.c      \
-                               arch/beos.c
+EXTRA_DIST = \
+  arch/linux.c \
+  arch/linux.h \
+  arch/gnu.c   \
+  arch/beos.c

 libparted_la_LIBADD =  \
   fs/libfs.la          \
@@ -63,6 +64,6 @@ libparted_la_LIBADD = \
   $(LIB_BLKID)         \
   $(INTLLIBS)

-EXTRA_DIST           = mbr.s
+EXTRA_DIST += mbr.s

 INCLUDES = $(partedincludedir) $(INTLINCS)
--
1.7.9.rc0.25.gc7817


>From 65d888ebe876e14a581df99d318b5f69d04ceb3d Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Thu, 12 Jan 2012 17:45:57 +0100
Subject: [PATCH 3/3] maint: remove useless BUILD_LINUX conditional

* configure.ac (BUILD_LINUX): Don't set it.
* libparted/Makefile.am (BUILD_LINUX): Remove useless use.
---
 configure.ac          |    1 -
 libparted/Makefile.am |    3 ---
 2 files changed, 0 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 9f36089..82ffd4a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -546,7 +546,6 @@ AC_CHECK_HEADER([execinfo.h], [
 ])

 AM_CONDITIONAL([COMPILE_FOR_S390], [test "$host_cpu" = s390 || test 
"$host_cpu" = s390x])
-AM_CONDITIONAL([BUILD_LINUX], [test "$OS" = linux])

 dnl check for "check", unit testing library/header
 PKG_CHECK_MODULES([CHECK], [check >= 0.9.3], have_check=yes, have_check=no)
diff --git a/libparted/Makefile.am b/libparted/Makefile.am
index 828a288..6aeab5a 100644
--- a/libparted/Makefile.am
+++ b/libparted/Makefile.am
@@ -9,9 +9,6 @@ SUBDIRS_CHECK += tests
 endif

 ARCH_SOURCE = arch/$(OS).c
-if BUILD_LINUX
-ARCH_SOURCE += arch/$(OS).h
-endif

 AM_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)

--
1.7.9.rc0.25.gc7817



reply via email to

[Prev in Thread] Current Thread [Next in Thread]