]> granicus.if.org Git - zfs/commitdiff
Update gcc-cast
authorBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 14 Jun 2010 21:40:10 +0000 (14:40 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Mon, 14 Jun 2010 21:40:10 +0000 (14:40 -0700)
Fix new instances of missing casts or assumed types.

cmd/zdb/zdb.c
cmd/ztest/ztest.c
lib/libzfs/libzfs_pool.c
module/zfs/sa.c
module/zfs/zfs_ioctl.c

index ff73072f8a64f5622c23cb5b2b3c625af3b9e9b4..92c65bdbc93c507a912e0c7c1016521da3bc9ece 100644 (file)
@@ -865,8 +865,8 @@ dump_history(spa_t *spa)
                        (void) snprintf(internalstr,
                            sizeof (internalstr),
                            "[internal %s txg:%lld] %s",
-                           zfs_history_event_names[ievent], txg,
-                           intstr);
+                           zfs_history_event_names[ievent],
+                           (longlong_t)txg, intstr);
                        cmd = internalstr;
                }
                tsec = time;
index 2c2382d327e9f37e19ae96b5a77b8dd43bb499c2..d7877b52d922af24e4c016e632b6610070d9d25d 100644 (file)
@@ -2013,7 +2013,7 @@ ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index,
        od->od_gen = 0;
 
        (void) snprintf(od->od_name, sizeof (od->od_name), "%s(%lld)[%llu]",
-           tag, (int64_t)id, index);
+           tag, (longlong_t)id, (u_longlong_t)index);
 }
 
 /*
@@ -3907,7 +3907,7 @@ ztest_fzap(ztest_ds_t *zd, uint64_t id)
                int error;
 
                (void) snprintf(name, sizeof (name), "fzap-%llu-%llu",
-                   id, value);
+                   (u_longlong_t)id, (u_longlong_t)value);
 
                tx = dmu_tx_create(os);
                dmu_tx_hold_zap(tx, object, B_TRUE, name);
index 4f0f6861c1c166a1d9b4b65c2311fab76f026732..1d416152fb9a5619a7b7a370ec90f90a5569129a 100644 (file)
@@ -1223,7 +1223,7 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
        (void) nvlist_lookup_int64(rbi, ZPOOL_CONFIG_REWIND_TIME, &loss);
 
        if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, 0, &t) != 0) {
+           strftime(timestr, 128, "%c", &t) != 0) {
                if (dryrun) {
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "Would be able to return %s "
@@ -1238,13 +1238,14 @@ zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "%s approximately %lld "),
                            dryrun ? "Would discard" : "Discarded",
-                           (loss + 30) / 60);
+                           ((longlong_t)loss + 30) / 60);
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "minutes of transactions.\n"));
                } else if (loss > 0) {
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "%s approximately %lld "),
-                           dryrun ? "Would discard" : "Discarded", loss);
+                           dryrun ? "Would discard" : "Discarded",
+                           (longlong_t)loss);
                        (void) printf(dgettext(TEXT_DOMAIN,
                            "seconds of transactions.\n"));
                }
@@ -1282,7 +1283,7 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
            "Recovery is possible, but will result in some data loss.\n"));
 
        if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, 0, &t) != 0) {
+           strftime(timestr, 128, "%c", &t) != 0) {
                (void) printf(dgettext(TEXT_DOMAIN,
                    "\tReturning the pool to its state as of %s\n"
                    "\tshould correct the problem.  "),
@@ -1296,11 +1297,13 @@ zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
        if (loss > 120) {
                (void) printf(dgettext(TEXT_DOMAIN,
                    "Approximately %lld minutes of data\n"
-                   "\tmust be discarded, irreversibly.  "), (loss + 30) / 60);
+                   "\tmust be discarded, irreversibly.  "),
+                   ((longlong_t)loss + 30) / 60);
        } else if (loss > 0) {
                (void) printf(dgettext(TEXT_DOMAIN,
                    "Approximately %lld seconds of data\n"
-                   "\tmust be discarded, irreversibly.  "), loss);
+                   "\tmust be discarded, irreversibly.  "),
+                   (longlong_t)loss);
        }
        if (edata != 0 && edata != UINT64_MAX) {
                if (edata == 1) {
index a91b379f998455ec4291e8928aa8dcb68933c7d6..17649274dd75f6f9f8fc58273b4d829046c8c907 100644 (file)
@@ -1469,12 +1469,12 @@ sa_attr_register_sync(sa_handle_t *hdl, dmu_tx_t *tx)
 
        mutex_enter(&sa->sa_lock);
 
-       if (!sa->sa_need_attr_registration || sa->sa_master_obj == NULL) {
+       if (!sa->sa_need_attr_registration || sa->sa_master_obj == 0) {
                mutex_exit(&sa->sa_lock);
                return;
        }
 
-       if (sa->sa_reg_attr_obj == NULL) {
+       if (sa->sa_reg_attr_obj == 0) {
                int error;
                sa->sa_reg_attr_obj = zap_create(hdl->sa_os,
                    DMU_OT_SA_ATTR_REGISTRATION, DMU_OT_NONE, 0, tx);
index d05b9468bdb7427bfcd3ba1af18753bcda6db4a6..e965aefbcfcb71ac9316e5971198b3350094b7c3 100644 (file)
@@ -2274,7 +2274,7 @@ zfs_ioc_set_prop(zfs_cmd_t *zc)
 
        error = zfs_set_prop_nvlist(zc->zc_name, source, nvl, &errors);
 
-       if (zc->zc_nvlist_dst != NULL && errors != NULL) {
+       if (zc->zc_nvlist_dst != 0 && errors != NULL) {
                (void) put_nvlist(zc, errors);
        }
 
@@ -3709,7 +3709,7 @@ zfs_ioc_clear(zfs_cmd_t *zc)
                nvlist_t *policy;
                nvlist_t *config = NULL;
 
-               if (zc->zc_nvlist_src == NULL)
+               if (zc->zc_nvlist_src == 0)
                        return (EINVAL);
 
                if ((error = get_nvlist(zc->zc_nvlist_src,