OSDN Git Service

Remove PED_ASSERT action argument
[android-x86/external-parted.git] / libparted / fs / hfs / file.c
index c12f253..9fc501b 100644 (file)
@@ -1,10 +1,10 @@
 /*
     libparted - a library for manipulating disk partitions
-    Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+    Copyright (C) 2004-2005, 2007, 2009-2011 Free Software Foundation, Inc.
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
-    the Free Software Foundation; either version 2 of the License, or
+    the Free Software Foundation; either version 3 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
@@ -13,8 +13,7 @@
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
 #ifndef DISCOVER_ONLY
@@ -53,7 +52,7 @@ hfs_file_open (PedFileSystem *fs, uint32_t CNID,
        file->CNID = CNID;
        memcpy(file->first, ext_desc, sizeof (HfsExtDataRec));
        file->start_cache = 0;
-       
+
        return file;
 }
 
@@ -61,7 +60,7 @@ hfs_file_open (PedFileSystem *fs, uint32_t CNID,
 void
 hfs_file_close (HfsPrivateFile* file)
 {
-       ped_free (file);
+       free (file);
 }
 
 /* warning : only works on data forks */
@@ -83,7 +82,7 @@ hfs_get_extent_containing (HfsPrivateFile* file, unsigned int block,
        search.file_ID = file->CNID;
        search.start = PED_CPU_TO_BE16 (block);
 
-       if (!hfs_btree_search (priv_data->extent_file, 
+       if (!hfs_btree_search (priv_data->extent_file,
                               (HfsPrivateGenericKey*) &search,
                               record, sizeof (record), NULL))
                return 0;
@@ -147,7 +146,7 @@ hfs_file_find_sector (HfsPrivateFile* file, PedSector sector)
        }
 
        /* in the three cached extent */
-       PED_ASSERT(file->start_cache && block >= file->start_cache, return 0);
+       PED_ASSERT(file->start_cache && block >= file->start_cache);
        for (s = file->start_cache, i = 0; i < HFS_EXT_NB; i++) {
                if ((block >= s) && (block < s + PED_BE16_TO_CPU (
                                                file->cache[i].block_count))) {
@@ -208,7 +207,7 @@ hfs_file_write_sector (HfsPrivateFile* file, void *buf, PedSector sector)
                        PED_EXCEPTION_ERROR,
                        PED_EXCEPTION_CANCEL,
                        _("Trying to write HFS file with CNID %X behind EOF."),
-                         PED_BE32_TO_CPU(file->CNID));         
+                         PED_BE32_TO_CPU(file->CNID));
                return 0;
        }