summaryrefslogtreecommitdiffstats
path: root/fpart
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2015-02-18 16:14:28 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2015-02-18 16:14:28 -0600
commit76ce4aadee1a7a890001affed54a0fb1110b1793 (patch)
tree14a358904909e8fe0f631d414333c26de81e5042 /fpart
parentaa8354ef7ee6606fe32453e3eedce9af8038230a (diff)
downloadffs-76ce4aadee1a7a890001affed54a0fb1110b1793.tar.gz
ffs-76ce4aadee1a7a890001affed54a0fb1110b1793.zip
Support to compile in 64bit for Ubuntu Little Endian
Diffstat (limited to 'fpart')
-rw-r--r--fpart/Rules.mk4
-rw-r--r--fpart/Rules.test.mk2
-rw-r--r--fpart/src/cmd_add.c6
-rw-r--r--fpart/src/cmd_create.c10
-rw-r--r--fpart/src/cmd_delete.c2
-rw-r--r--fpart/src/cmd_erase.c12
-rw-r--r--fpart/src/cmd_list.c6
-rw-r--r--fpart/src/cmd_trunc.c6
-rw-r--r--fpart/src/cmd_user.c6
-rw-r--r--fpart/src/command.c6
-rw-r--r--fpart/src/main.h4
11 files changed, 32 insertions, 32 deletions
diff --git a/fpart/Rules.mk b/fpart/Rules.mk
index 0eff083..11a26fa 100644
--- a/fpart/Rules.mk
+++ b/fpart/Rules.mk
@@ -22,10 +22,10 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-CFLAGS += -m32 -D_GNU_SOURCE -std=gnu99 -D_FILE_OFFSET_BITS=64
+CFLAGS += -D_GNU_SOURCE -std=gnu99 -D_FILE_OFFSET_BITS=64
CFLAGS += -I$(DEPTH)/.. -iquote..
-LDFLAGS += -L. -m32
+LDFLAGS += -L.
NAME=fpart
diff --git a/fpart/Rules.test.mk b/fpart/Rules.test.mk
index 11af900..2b93477 100644
--- a/fpart/Rules.test.mk
+++ b/fpart/Rules.test.mk
@@ -22,7 +22,7 @@
# permissions and limitations under the License.
#
# IBM_PROLOG_END_TAG
-CFLAGS += -m32 -D_GNU_SOURCE -std=gnu99 -D_FILE_OFFSET_BITS=64 -I$(DEPTH)/apps -iquote..
+CFLAGS += -D_GNU_SOURCE -std=gnu99 -D_FILE_OFFSET_BITS=64 -I$(DEPTH)/apps -iquote..
LDFLAGS += -L. -L$(DEPTH)/apps/clib/$(ARCH_DEP_DIR)
OBJS=test_libffs.o
diff --git a/fpart/src/cmd_add.c b/fpart/src/cmd_add.c
index 31ef662..2d8d578 100644
--- a/fpart/src/cmd_add.c
+++ b/fpart/src/cmd_add.c
@@ -67,7 +67,7 @@ int command_add(args_t * args)
int rc = 0;
off_t offset = 0;
- size_t size = 0;
+ uint32_t size = 0;
uint32_t flags = 0;
rc = parse_offset(args->offset, &offset);
@@ -97,8 +97,8 @@ int command_add(args_t * args)
if (args->verbose == f_VERBOSE)
printf("%llx: %s: add partition at offset '%llx' size "
- "'%x' type '%d' flags '%x'\n", poffset,
- args->name, offset, size, type, flags);
+ "'%x' type '%d' flags '%x'\n", (long long)poffset,
+ args->name, (long long)offset, size, type, flags);
return rc;
}
diff --git a/fpart/src/cmd_create.c b/fpart/src/cmd_create.c
index a94e450..6bebc99 100644
--- a/fpart/src/cmd_create.c
+++ b/fpart/src/cmd_create.c
@@ -60,9 +60,9 @@ int command_create(args_t * args)
{
assert(args != NULL);
- size_t block = 0;
- size_t size = 0;
- size_t pad = 0xff;
+ uint32_t block = 0;
+ uint32_t size = 0;
+ uint32_t pad = 0xff;
if (parse_size(args->block, &block) < 0)
return -1;
@@ -87,7 +87,7 @@ int command_create(args_t * args)
if (args->force != f_FORCE && st.st_size != size) {
UNEXPECTED("--size '%d' differs from actual "
"size '%lld', use --force to "
- "override", size, st.st_size);
+ "override", size, (long long)st.st_size);
return -1;
}
}
@@ -98,7 +98,7 @@ int command_create(args_t * args)
int create(args_t * args, off_t poffset)
{
if (args->verbose == f_VERBOSE)
- printf("%llx: create partition table\n", poffset);
+ printf("%llx: create partition table\n", (long long)poffset);
const char * target = args->target;
int debug = args->debug;
diff --git a/fpart/src/cmd_delete.c b/fpart/src/cmd_delete.c
index cc55247..16e13e5 100644
--- a/fpart/src/cmd_delete.c
+++ b/fpart/src/cmd_delete.c
@@ -74,7 +74,7 @@ int command_delete(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: delete\n", poffset, args->name);
+ printf("%llx: %s: delete\n", (long long)poffset, args->name);
return 0;
}
diff --git a/fpart/src/cmd_erase.c b/fpart/src/cmd_erase.c
index e250cec..931283c 100644
--- a/fpart/src/cmd_erase.c
+++ b/fpart/src/cmd_erase.c
@@ -65,7 +65,7 @@ int command_erase(args_t * args)
if (strrchr(name, '$') == NULL)
strcat(name, "$");
- size_t pad = 0xff;
+ uint32_t pad = 0xff;
if (args->pad != NULL)
if (parse_size(args->pad, &pad) < 0)
return -1;
@@ -97,7 +97,7 @@ int command_erase(args_t * args)
args->force != f_FORCE) {
if (args->verbose == f_VERBOSE)
printf("%llx: %s: protected, skipping erase\n",
- __poffset, full_name);
+ (long long)__poffset, full_name);
return 0;
}
@@ -105,7 +105,7 @@ int command_erase(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: truncate size '%x'\n", __poffset,
+ printf("%llx: %s: truncate size '%x'\n", (long long)__poffset,
full_name, 0);
for (uint32_t i=0; i<FFS_USER_WORDS; i++)
@@ -113,14 +113,14 @@ int command_erase(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: user[] zero\n", __poffset, full_name);
+ printf("%llx: %s: user[] zero\n", (long long)__poffset, full_name);
list_iter_init(&it, &list, LI_FLAG_FWD);
list_for_each(&it, node, node) {
if (node->entry.base == entry->base) {
if (args->verbose == f_VERBOSE)
printf("%llx: %s: skipping fill with "
- "'%x'\n", __poffset, full_name,
+ "'%x'\n", (long long)__poffset, full_name,
(uint8_t)pad);
return 0;
}
@@ -165,7 +165,7 @@ int command_erase(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: filled with '%x'\n", __poffset,
+ printf("%llx: %s: filled with '%x'\n", (long long)__poffset,
full_name, (uint8_t)pad);
return 0;
diff --git a/fpart/src/cmd_list.c b/fpart/src/cmd_list.c
index 7e4401f..19eee56 100644
--- a/fpart/src/cmd_list.c
+++ b/fpart/src/cmd_list.c
@@ -75,8 +75,8 @@ int command_list(args_t * args)
int __list_entry(ffs_entry_t * entry)
{
- size_t offset = entry->base * __ffs->hdr->block_size;
- size_t size = entry->size * __ffs->hdr->block_size;
+ uint32_t offset = entry->base * __ffs->hdr->block_size;
+ uint32_t size = entry->size * __ffs->hdr->block_size;
if (__ffs_entry_name(__ffs, entry, full_name,
sizeof full_name) < 0)
@@ -135,7 +135,7 @@ int command_list(args_t * args)
if (0 < ffs->count) {
printf("========================[ PARTITION TABLE"
" 0x%llx ]=======================\n",
- ffs->offset);
+ (long long)ffs->offset);
printf("vers:%04x size:%04x * blk:%06x blk(s):"
"%06x * entsz:%06x ent(s):%06x\n",
ffs->hdr->version,
diff --git a/fpart/src/cmd_trunc.c b/fpart/src/cmd_trunc.c
index fce2de0..ac5c5ee 100644
--- a/fpart/src/cmd_trunc.c
+++ b/fpart/src/cmd_trunc.c
@@ -84,11 +84,11 @@ int command_trunc(args_t * args)
if (entry->flags & FFS_FLAGS_PROTECTED &&
args->force != f_FORCE) {
printf("%llx: %s: protected, skipping truncate\n",
- __poffset, full_name);
+ (long long)__poffset, full_name);
return 0;
}
- size_t size = entry->size * __ffs->hdr->block_size;
+ uint32_t size = entry->size * __ffs->hdr->block_size;
if (args->size != NULL)
if (parse_size(args->size, &size) < 0)
return -1;
@@ -97,7 +97,7 @@ int command_trunc(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: truncate size '%x'\n", __poffset,
+ printf("%llx: %s: truncate size '%x'\n", (long long)__poffset,
full_name, size);
return 0;
diff --git a/fpart/src/cmd_user.c b/fpart/src/cmd_user.c
index b86311a..af61cf0 100644
--- a/fpart/src/cmd_user.c
+++ b/fpart/src/cmd_user.c
@@ -96,7 +96,7 @@ int command_user(args_t * args)
if (entry->flags & FFS_FLAGS_PROTECTED &&
args->force != f_FORCE) {
printf("%llx: %s: protected, skipping user[%d]\n",
- __poffset, full_name, user);
+ (long long)__poffset, full_name, user);
return 0;
}
@@ -111,14 +111,14 @@ int command_user(args_t * args)
return -1;
if (args->verbose == f_VERBOSE)
- printf("%llx: %s: user[%d] = '%x'\n", __poffset,
+ printf("%llx: %s: user[%d] = '%x'\n", (long long)__poffset,
args->name, user, value);
} else {
if (__ffs_entry_user_get(__ffs, args->name,
user, &value) < 0)
return -1;
- printf("%llx: %s: user[%d] = '%x'\n", __poffset,
+ printf("%llx: %s: user[%d] = '%x'\n", (long long)__poffset,
args->name, user, value);
}
diff --git a/fpart/src/command.c b/fpart/src/command.c
index 78b33a0..3f25abb 100644
--- a/fpart/src/command.c
+++ b/fpart/src/command.c
@@ -99,7 +99,7 @@ int parse_offset(const char *str, off_t *offset)
return 0;
}
-int parse_size(const char *str, size_t *size)
+int parse_size(const char *str, uint32_t *size)
{
assert(size != NULL);
@@ -136,7 +136,7 @@ int parse_size(const char *str, size_t *size)
return 0;
}
-int parse_number(const char *str, size_t *num)
+int parse_number(const char *str, uint32_t *num)
{
assert(num != NULL);
@@ -240,7 +240,7 @@ FILE *fopen_generic(const char *path, const char *mode, int debug)
assert(mode != NULL);
FILE *file = NULL;
- size_t port = 0;
+ uint32_t port = 0;
if (strncasecmp(path, "aa:", 3) == 0) {
if (parse_number(path + 3, &port) == 0)
diff --git a/fpart/src/main.h b/fpart/src/main.h
index 31fadcd..35160c6 100644
--- a/fpart/src/main.h
+++ b/fpart/src/main.h
@@ -110,8 +110,8 @@ extern args_t args;
extern size_t page_size;
extern int parse_offset(const char *, off_t *);
-extern int parse_size(const char *, size_t *);
-extern int parse_number(const char *, size_t *);
+extern int parse_size(const char *, uint32_t *);
+extern int parse_number(const char *, uint32_t *);
extern bool check_extension(const char *, const char *);
extern int create_regular_file(const char *, size_t, char);
OpenPOWER on IntegriCloud