From e38e9c2db7db666605ef914fb481397e784eb7d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Ter=C3=A4s?= Date: Tue, 10 Aug 2010 14:50:55 +0300 Subject: squarkdb: use stdint.h defined typedefs u_int32_t is not standard, use uint32_t from stdint.h instead. --- squarkdb.c | 4 ++-- squarkdb.h | 25 +++++++++++++------------ 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/squarkdb.c b/squarkdb.c index a62ea61..543cbb1 100644 --- a/squarkdb.c +++ b/squarkdb.c @@ -85,7 +85,7 @@ void sqdb_close(struct sqdb *db) close(db->fd); } -void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size) +void *sqdb_section_create(struct sqdb *db, int id, uint32_t size) { struct sqdb_header *hdr; size_t pos; @@ -106,7 +106,7 @@ void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size) return db->mmap_base + pos; } -void *sqdb_section_get(struct sqdb *db, int id, u_int32_t *size) +void *sqdb_section_get(struct sqdb *db, int id, uint32_t *size) { struct sqdb_header *hdr = db->mmap_base; diff --git a/squarkdb.h b/squarkdb.h index 2f96155..3733ec1 100644 --- a/squarkdb.h +++ b/squarkdb.h @@ -1,6 +1,7 @@ #ifndef SQUARKDB_H #define SQUARKDB_H +#include #include #define SQDB_SECTION_STRINGS 0 @@ -18,24 +19,24 @@ struct sqdb { }; struct sqdb_section { - u_int32_t offset; - u_int32_t length; + uint32_t offset; + uint32_t length; }; struct sqdb_header { char description[116]; - u_int32_t num_sections; - u_int32_t version; - u_int32_t magic; + uint32_t num_sections; + uint32_t version; + uint32_t magic; struct sqdb_section section[SQDB_SECTION_MAX]; }; struct sqdb_index_entry { - u_int32_t has_subdomains : 1; - u_int32_t has_paths : 1; - u_int32_t category : 6; - u_int32_t parent : 24; - u_int32_t component; + uint32_t has_subdomains : 1; + uint32_t has_paths : 1; + uint32_t category : 6; + uint32_t parent : 24; + uint32_t component; }; const char *sqdb_section_names[SQDB_SECTION_MAX]; @@ -44,7 +45,7 @@ int sqdb_create(struct sqdb *db, const char *fn); int sqdb_open(struct sqdb *db, const char *fn); void sqdb_close(struct sqdb *db); -void *sqdb_section_create(struct sqdb *db, int id, u_int32_t size); -void *sqdb_section_get(struct sqdb *db, int id, u_int32_t *size); +void *sqdb_section_create(struct sqdb *db, int id, uint32_t size); +void *sqdb_section_get(struct sqdb *db, int id, uint32_t *size); #endif -- cgit v1.2.3