r12608: Remove some unused #include lines.
[jelmer/samba4-debian.git] / source / torture / basic / utable.c
index 30d389dd928c52a22882261b0ac413d56dab4d08..ebe9cd915681f4425650afbc52e6d6b58b3eb2c3 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "includes.h"
 #include "system/iconv.h"
+#include "system/filesys.h"
+#include "pstring.h"
 
 BOOL torture_utable(void)
 {
@@ -27,7 +29,7 @@ BOOL torture_utable(void)
        fstring fname;
        const char *alt_name;
        int fnum;
-       char c2[4];
+       uint8_t c2[4];
        int c, len, fd;
        int chars_allowed=0, alt_allowed=0;
        uint8_t valid[0x10000];
@@ -101,7 +103,7 @@ BOOL torture_utable(void)
 static char *form_name(int c)
 {
        static fstring fname;
-       char c2[4];
+       uint8_t c2[4];
        char *p;
        int len;
 
@@ -148,13 +150,13 @@ BOOL torture_casetable(void)
                fname = form_name(c);
                fnum = smbcli_nt_create_full(cli->tree, fname, 0,
 #if 0
-                                         SEC_RIGHT_MAXIMUM_ALLOWED, 
+                                            SEC_RIGHT_MAXIMUM_ALLOWED, 
 #else
-                                         GENERIC_RIGHTS_FILE_ALL_ACCESS,
+                                            SEC_RIGHTS_FILE_ALL,
 #endif
-                                         FILE_ATTRIBUTE_NORMAL,
-                                         NTCREATEX_SHARE_ACCESS_NONE,
-                                         NTCREATEX_DISP_OPEN_IF, 0, 0);
+                                            FILE_ATTRIBUTE_NORMAL,
+                                            NTCREATEX_SHARE_ACCESS_NONE,
+                                            NTCREATEX_DISP_OPEN_IF, 0, 0);
 
                if (fnum == -1) {
                        printf("Failed to create file with char %04x\n", c);
@@ -172,12 +174,12 @@ BOOL torture_casetable(void)
 
                        if (size/sizeof(int) >= MAX_EQUIVALENCE) {
                                printf("too many chars match?? size=%d c=0x%04x\n",
-                                      size, c);
+                                      (int)size, c);
                                smbcli_close(cli->tree, fnum);
                                return False;
                        }
 
-                       smbcli_read(cli->tree, fnum, (char *)c2, 0, size);
+                       smbcli_read(cli->tree, fnum, c2, 0, size);
                        printf("%04x: ", c);
                        equiv[c][0] = c;
                        for (i=0; i<size/sizeof(int); i++) {
@@ -188,7 +190,7 @@ BOOL torture_casetable(void)
                        fflush(stdout);
                }
 
-               smbcli_write(cli->tree, fnum, 0, (char *)&c, size, sizeof(c));
+               smbcli_write(cli->tree, fnum, 0, &c, size, sizeof(c));
                smbcli_close(cli->tree, fnum);
        }