From 9e5ad07ee1951b6b000c96e32c9eff7294df301f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Thu, 20 Nov 2008 14:04:05 -0800 Subject: [PATCH] Add gcc-c90 branch --- .topdeps | 1 + .topmsg | 8 ++++++++ zfs/lib/libuutil/uu_misc.c | 4 ++++ zfs/lib/libzcommon/zprop_common.c | 4 ++-- zfs/lib/libzpool/arc.c | 2 +- zfs/lib/libzpool/dbuf.c | 24 +++++++++++++++--------- zfs/lib/libzpool/dsl_dataset.c | 8 +++++--- zfs/zcmd/zfs/zfs_main.c | 2 +- 8 files changed, 37 insertions(+), 16 deletions(-) create mode 100644 .topdeps create mode 100644 .topmsg diff --git a/.topdeps b/.topdeps new file mode 100644 index 0000000000..1f7391f92b --- /dev/null +++ b/.topdeps @@ -0,0 +1 @@ +master diff --git a/.topmsg b/.topmsg new file mode 100644 index 0000000000..555d000264 --- /dev/null +++ b/.topmsg @@ -0,0 +1,8 @@ +From: Brian Behlendorf +Subject: [PATCH] gcc error c90 + +Gcc non-c90 compliant code + +Signed-off-by: Brian Behlendorf + +--- diff --git a/zfs/lib/libuutil/uu_misc.c b/zfs/lib/libuutil/uu_misc.c index 0ead166e70..a5a21efc3e 100644 --- a/zfs/lib/libuutil/uu_misc.c +++ b/zfs/lib/libuutil/uu_misc.c @@ -211,7 +211,11 @@ uu_panic(const char *format, ...) int assfail(const char *astring, const char *file, int line) { +#if defined(__STDC__) && __STDC_VERSION__ - 0 >= 199901L + __assert_c99(astring, file, line, "unknown func"); +#else __assert(astring, file, line); +#endif /*NOTREACHED*/ return (0); } diff --git a/zfs/lib/libzcommon/zprop_common.c b/zfs/lib/libzcommon/zprop_common.c index add8b83532..86bd475bb6 100644 --- a/zfs/lib/libzcommon/zprop_common.c +++ b/zfs/lib/libzcommon/zprop_common.c @@ -158,7 +158,7 @@ int zprop_iter_common(zprop_func func, void *cb, boolean_t show_all, boolean_t ordered, zfs_type_t type) { - int i, num_props, size, prop; + int i, j, num_props, size, prop; zprop_desc_t *prop_tbl; zprop_desc_t **order; @@ -173,7 +173,7 @@ zprop_iter_common(zprop_func func, void *cb, boolean_t show_all, return (ZPROP_CONT); #endif - for (int j = 0; j < num_props; j++) + for (j = 0; j < num_props; j++) order[j] = &prop_tbl[j]; if (ordered) { diff --git a/zfs/lib/libzpool/arc.c b/zfs/lib/libzpool/arc.c index 8d091b7cea..dc5467d428 100644 --- a/zfs/lib/libzpool/arc.c +++ b/zfs/lib/libzpool/arc.c @@ -3878,7 +3878,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev) * Copy buffers for L2ARC writing. */ mutex_enter(&l2arc_buflist_mtx); - for (int try = 0; try <= 3; try++) { + for (try = 0; try <= 3; try++) { list = l2arc_list_locked(try, &list_lock); passed_sz = 0; diff --git a/zfs/lib/libzpool/dbuf.c b/zfs/lib/libzpool/dbuf.c index 08d17fb586..4bd8385a18 100644 --- a/zfs/lib/libzpool/dbuf.c +++ b/zfs/lib/libzpool/dbuf.c @@ -113,11 +113,13 @@ dbuf_find(dnode_t *dn, uint8_t level, uint64_t blkid) { dbuf_hash_table_t *h = &dbuf_hash_table; objset_impl_t *os = dn->dn_objset; - uint64_t obj = dn->dn_object; - uint64_t hv = DBUF_HASH(os, obj, level, blkid); - uint64_t idx = hv & h->hash_table_mask; + uint64_t obj, hv, idx; dmu_buf_impl_t *db; + obj = dn->dn_object; + hv = DBUF_HASH(os, obj, level, blkid); + idx = hv & h->hash_table_mask; + mutex_enter(DBUF_HASH_MUTEX(h, idx)); for (db = h->hash_table[idx]; db != NULL; db = db->db_hash_next) { if (DBUF_EQUAL(db, os, obj, level, blkid)) { @@ -146,11 +148,13 @@ dbuf_hash_insert(dmu_buf_impl_t *db) objset_impl_t *os = db->db_objset; uint64_t obj = db->db.db_object; int level = db->db_level; - uint64_t blkid = db->db_blkid; - uint64_t hv = DBUF_HASH(os, obj, level, blkid); - uint64_t idx = hv & h->hash_table_mask; + uint64_t blkid, hv, idx; dmu_buf_impl_t *dbf; + blkid = db->db_blkid; + hv = DBUF_HASH(os, obj, level, blkid); + idx = hv & h->hash_table_mask; + mutex_enter(DBUF_HASH_MUTEX(h, idx)); for (dbf = h->hash_table[idx]; dbf != NULL; dbf = dbf->db_hash_next) { if (DBUF_EQUAL(dbf, os, obj, level, blkid)) { @@ -180,11 +184,13 @@ static void dbuf_hash_remove(dmu_buf_impl_t *db) { dbuf_hash_table_t *h = &dbuf_hash_table; - uint64_t hv = DBUF_HASH(db->db_objset, db->db.db_object, - db->db_level, db->db_blkid); - uint64_t idx = hv & h->hash_table_mask; + uint64_t hv, idx; dmu_buf_impl_t *dbf, **dbp; + hv = DBUF_HASH(db->db_objset, db->db.db_object, + db->db_level, db->db_blkid); + idx = hv & h->hash_table_mask; + /* * We musn't hold db_mtx to maintin lock ordering: * DBUF_HASH_MUTEX > db_mtx. diff --git a/zfs/lib/libzpool/dsl_dataset.c b/zfs/lib/libzpool/dsl_dataset.c index 88a280d676..d57e8d5e36 100644 --- a/zfs/lib/libzpool/dsl_dataset.c +++ b/zfs/lib/libzpool/dsl_dataset.c @@ -91,11 +91,13 @@ parent_delta(dsl_dataset_t *ds, int64_t delta) void dsl_dataset_block_born(dsl_dataset_t *ds, blkptr_t *bp, dmu_tx_t *tx) { - int used = bp_get_dasize(tx->tx_pool->dp_spa, bp); - int compressed = BP_GET_PSIZE(bp); - int uncompressed = BP_GET_UCSIZE(bp); + int used, compressed, uncompressed; int64_t delta; + used = bp_get_dasize(tx->tx_pool->dp_spa, bp); + compressed = BP_GET_PSIZE(bp); + uncompressed = BP_GET_UCSIZE(bp); + dprintf_bp(bp, "born, ds=%p\n", ds); ASSERT(dmu_tx_is_syncing(tx)); diff --git a/zfs/zcmd/zfs/zfs_main.c b/zfs/zcmd/zfs/zfs_main.c index 710e370f95..40df386ef8 100644 --- a/zfs/zcmd/zfs/zfs_main.c +++ b/zfs/zcmd/zfs/zfs_main.c @@ -3205,7 +3205,7 @@ append_options(char *mntopts, char *newopts) /* original length plus new string to append plus 1 for the comma */ if (len + 1 + strlen(newopts) >= MNT_LINE_MAX) { (void) fprintf(stderr, gettext("the opts argument for " - "'%c' option is too long (more than %d chars)\n"), + "'%s' option is too long (more than %d chars)\n"), "-o", MNT_LINE_MAX); usage(B_FALSE); }