s4:torture - always cast correctly when using the "%x" format string argument
authorMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 7 May 2011 09:06:38 +0000 (11:06 +0200)
committerMatthias Dieter Wallnöfer <mdw@samba.org>
Sat, 21 May 2011 14:21:12 +0000 (16:21 +0200)
Signed-off-by: Metze
source4/torture/basic/attr.c
source4/torture/raw/open.c

index 9655f7a74387945eee897dbc6d70c8808de8bce6..2f0248e20fb44732499667b5a1e4da89e08362b8 100644 (file)
@@ -374,7 +374,7 @@ error_exit_file:
                                [0x%x], got attr 0x%x, should be 0x%x\n",
                                open_attrs_table[j],
                                (uint16_t)attr,
-                               (int)open_attrs_table[j]|FILE_ATTRIBUTE_DIRECTORY);
+                               (unsigned int)(open_attrs_table[j]|FILE_ATTRIBUTE_DIRECTORY));
                        CHECK_MAX_FAILURES(error_exit_dir);
                }
 
index beb629069f67e2ed6f4e71e0d0dcb04a45d7b0fb..8a66a12cd577197c6775597e8f155ff311ad1734 100644 (file)
@@ -130,7 +130,7 @@ static const char *rdwr_string(enum rdwr_mode m)
        if ((v) != (finfo.all_info.out.field)) { \
                torture_result(tctx, TORTURE_FAIL, \
                       "(%s) wrong value for field %s  0x%x - 0x%x\n", \
-                      __location__, #field, (int)v, (int)(finfo.all_info.out.field)); \
+                      __location__, #field, (unsigned int)(v), (unsigned int)(finfo.all_info.out.field)); \
                dump_all_info(tctx, &finfo); \
                ret = false; \
        }} while (0)
@@ -139,7 +139,7 @@ static const char *rdwr_string(enum rdwr_mode m)
        if ((v) != (correct)) { \
                torture_result(tctx, TORTURE_FAIL, \
                       "(%s) wrong value for %s  0x%x - should be 0x%x\n", \
-                      __location__, #v, (int)(v), (int)correct); \
+                      __location__, #v, (unsigned int)(v), (unsigned int)(correct)); \
                ret = false; \
        }} while (0)
 
@@ -152,7 +152,7 @@ static const char *rdwr_string(enum rdwr_mode m)
        status = smb_raw_setpathinfo(cli->tree, &sfinfo); \
        if (!NT_STATUS_IS_OK(status)) { \
                torture_warning(tctx, "(%s) Failed to set attrib 0x%x on %s\n", \
-                      __location__, (int)sattrib, fname); \
+                      __location__, (unsigned int)(sattrib), fname); \
        }} while (0)
 
 /*
@@ -337,7 +337,7 @@ static bool test_openx(struct torture_context *tctx, struct smbcli_state *cli)
                                __location__, nt_errstr(status),
                                nt_errstr(open_funcs[i].correct_status),
                                i, (int)open_funcs[i].with_file,
-                               (int)open_funcs[i].open_func);
+                               open_funcs[i].open_func);
                        ret = false;
                }
                if (NT_STATUS_IS_OK(status)) {
@@ -602,7 +602,7 @@ static bool test_t2open(struct torture_context *tctx, struct smbcli_state *cli)
                                 __location__, nt_errstr(status),
                                nt_errstr(open_funcs[i].correct_status),
                                i, (int)open_funcs[i].with_file,
-                               (int)open_funcs[i].open_func);
+                               open_funcs[i].open_func);
                        ret = false;
                }
                if (NT_STATUS_IS_OK(status)) {