chiark / gitweb /
volume_id: use PRIu64i, PRIx64 macros
[elogind.git] / extras / volume_id / lib / fat.c
index 58f8f825c43a744217d707278c7fab6bfa7a148d..e5a5cc119180b025b59225f7379640867508f309 100644 (file)
@@ -4,19 +4,24 @@
  * Copyright (C) 2004-2007 Kay Sievers <kay.sievers@vrfy.org>
  * Copyright (C) 2007 Ryan Lortie <desrt@desrt.ca>
  *
- *     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 version 2 of the License.
+ * 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
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * 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, see <http://www.gnu.org/licenses/>.
  */
 
 #ifndef _GNU_SOURCE
 #define _GNU_SOURCE 1
 #endif
 
-#ifdef HAVE_CONFIG_H
-#  include <config.h>
-#endif
-
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
@@ -25,7 +30,7 @@
 #include <ctype.h>
 
 #include "libvolume_id.h"
-#include "util.h"
+#include "libvolume_id-private.h"
 
 #define FAT12_MAX                      0xff5
 #define FAT16_MAX                      0xfff5
@@ -270,7 +275,7 @@ int volume_id_probe_vfat(struct volume_id *id, uint64_t off, uint64_t size)
        int maxloop;
        size_t fnlen;
 
-       info("probing at offset 0x%llx\n", (unsigned long long) off);
+       info("probing at offset 0x%" PRIx64 "\n", off);
 
        buf = volume_id_get_buffer(id, off, 0x400);
        if (buf == NULL)
@@ -375,7 +380,7 @@ magic:
 
        /* the label may be an attribute in the root directory */
        root_start = (reserved + fat_size) * sector_size;
-       dbg("root dir start 0x%llx\n", (unsigned long long) root_start);
+       dbg("root dir start 0x%" PRIx64 "\n", root_start);
        root_dir_entries = le16_to_cpu(vs->dir_entries);
        dbg("expected entries 0x%x\n", root_dir_entries);
 
@@ -437,7 +442,7 @@ fat32:
                dbg("next cluster %u\n", next);
                next_sect_off = (next - 2) * vs->sectors_per_cluster;
                next_off = (start_data_sect + next_sect_off) * sector_size;
-               dbg("cluster offset 0x%llx\n", (unsigned long long) next_off);
+               dbg("cluster offset 0x%" PRIx64 "\n", next_off);
 
                /* get cluster */
                buf = volume_id_get_buffer(id, off + next_off, buf_size);