Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Use int64_t for file size.
jlaffaye committed 15 years ago
commit a339f09c49df26a2726a66b82252dd96baea0c11
parent 34726ab
5 files changed +8 -8
modified libpkg/pkg.c
@@ -505,7 +505,7 @@ pkg_adddep(struct pkg *pkg, const char *name, const char *origin, const char *ve
}

int
-
pkg_addfile(struct pkg *pkg, const char *path, const char *sha256, size_t sz)
+
pkg_addfile(struct pkg *pkg, const char *path, const char *sha256, int64_t sz)
{
	struct pkg_file *file;
	if (path == NULL || path[0] == '\0')
modified libpkg/pkg.h
@@ -90,7 +90,7 @@ int pkg_extract(const char *filename);
int pkg_set(struct pkg *, pkg_attr, const char *);
int pkg_set_from_file(struct pkg *, pkg_attr, const char *);
int pkg_adddep(struct pkg *, const char *, const char *, const char *);
-
int pkg_addfile(struct pkg *, const char *, const char *, size_t);
+
int pkg_addfile(struct pkg *, const char *, const char *, int64_t);
int pkg_addconflict(struct pkg *, const char *);
int pkg_addexec(struct pkg *, const char *, pkg_exec_t);
int pkg_addscript(struct pkg *, const char *);
@@ -106,7 +106,7 @@ void pkg_file_reset(struct pkg_file *);
void pkg_file_free(struct pkg_file *);
const char * pkg_file_path(struct pkg_file *);
const char * pkg_file_sha256(struct pkg_file *);
-
size_t pkg_file_size(struct pkg_file *);
+
int64_t pkg_file_size(struct pkg_file *);

/* pkg_conflict */
int pkg_conflict_new(struct pkg_conflict **);
modified libpkg/pkg_file.c
@@ -15,7 +15,7 @@ pkg_file_sha256(struct pkg_file *file)
	return (file->sha256);
}

-
size_t
+
int64_t
pkg_file_size(struct pkg_file *file)
{
	return (file->size);
modified libpkg/pkg_private.h
@@ -47,7 +47,7 @@ struct pkg_exec {
struct pkg_file {
	char path[MAXPATHLEN];
	char sha256[65];
-
	size_t size;
+
	int64_t size;
};

struct pkg_option {
modified libpkg/pkg_repo.c
@@ -24,7 +24,7 @@ pkg_create_repo(char *path, void (progress)(struct pkg *pkg, void *data), void *
	sqlite3 *sqlite;
	sqlite3_stmt *stmt_deps;
	sqlite3_stmt *stmt_pkg;
-
	size_t flatsize = 0;
+
	int64_t flatsize = 0;

	int i;

@@ -123,8 +123,8 @@ pkg_create_repo(char *path, void (progress)(struct pkg *pkg, void *data), void *
		sqlite3_bind_text(stmt_pkg, 7, pkg_get(pkg, PKG_OSVERSION), -1, SQLITE_STATIC);
		sqlite3_bind_text(stmt_pkg, 8, pkg_get(pkg, PKG_MAINTAINER), -1, SQLITE_STATIC);
		sqlite3_bind_text(stmt_pkg, 9, pkg_get(pkg, PKG_WWW), -1, SQLITE_STATIC);
-
		sqlite3_bind_int(stmt_pkg, 11, ent->fts_statp->st_size);
-
		sqlite3_bind_int(stmt_pkg, 12, flatsize);
+
		sqlite3_bind_int64(stmt_pkg, 11, ent->fts_statp->st_size);
+
		sqlite3_bind_int64(stmt_pkg, 12, flatsize);

		sqlite3_step(stmt_pkg);
		sqlite3_reset(stmt_pkg);