summaryrefslogtreecommitdiff
path: root/source3/torture/denytest.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2003-01-02 09:07:17 +0000
committerAndrew Bartlett <abartlet@samba.org>2003-01-02 09:07:17 +0000
commit6d66fb308ab85bd9691d541764e683e6040cf724 (patch)
tree10b705921665cb7bafdd332ca53b8a943e13f0e5 /source3/torture/denytest.c
parentc105c12d122e599fe57dde8b2b73c52231f0c1d2 (diff)
downloadsamba-6d66fb308ab85bd9691d541764e683e6040cf724.tar.gz
samba-6d66fb308ab85bd9691d541764e683e6040cf724.tar.bz2
samba-6d66fb308ab85bd9691d541764e683e6040cf724.zip
BIG patch...
This patch makes Samba compile cleanly with -Wwrite-strings. - That is, all string literals are marked as 'const'. These strings are always read only, this just marks them as such for passing to other functions. What is most supprising is that I didn't need to change more than a few lines of code (all in 'net', which got a small cleanup of net.h and extern variables). The rest is just adding a lot of 'const'. As far as I can tell, I have not added any new warnings - apart from making all of tdbutil.c's function const (so they warn for adding that const string to struct). Andrew Bartlett (This used to be commit 92a777d0eaa4fb3a1c7835816f93c6bdd456816d)
Diffstat (limited to 'source3/torture/denytest.c')
-rw-r--r--source3/torture/denytest.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/source3/torture/denytest.c b/source3/torture/denytest.c
index 045246f126..017bb1c06d 100644
--- a/source3/torture/denytest.c
+++ b/source3/torture/denytest.c
@@ -27,11 +27,11 @@ extern BOOL torture_showall;
enum deny_result {A_0=0, A_X=1, A_R=2, A_W=3, A_RW=5};
-static char *denystr(int denymode)
+static const char *denystr(int denymode)
{
struct {
int v;
- char *name;
+ const char *name;
} deny_modes[] = {
{DENY_DOS, "DENY_DOS"},
{DENY_ALL, "DENY_ALL"},
@@ -47,11 +47,11 @@ static char *denystr(int denymode)
return "DENY_XXX";
}
-static char *openstr(int mode)
+static const char *openstr(int mode)
{
struct {
int v;
- char *name;
+ const char *name;
} open_modes[] = {
{O_RDWR, "O_RDWR"},
{O_RDONLY, "O_RDONLY"},
@@ -64,11 +64,11 @@ static char *openstr(int mode)
return "O_XXX";
}
-static char *resultstr(enum deny_result res)
+static const char *resultstr(enum deny_result res)
{
struct {
enum deny_result res;
- char *name;
+ const char *name;
} results[] = {
{A_X, "X"},
{A_0, "-"},
@@ -1412,7 +1412,7 @@ BOOL torture_denytest1(int dummy)
int fnum1, fnum2;
int i;
BOOL correct = True;
- char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"};
+ const char *fnames[2] = {"\\denytest1.dat", "\\denytest1.exe"};
if (!torture_open_connection(&cli1)) {
return False;
@@ -1431,7 +1431,7 @@ BOOL torture_denytest1(int dummy)
for (i=0; i<ARRAY_SIZE(denytable1); i++) {
enum deny_result res;
- char *fname = fnames[denytable1[i].isexe];
+ const char *fname = fnames[denytable1[i].isexe];
progress_bar(i, ARRAY_SIZE(denytable1));
@@ -1498,7 +1498,7 @@ BOOL torture_denytest2(int dummy)
int fnum1, fnum2;
int i;
BOOL correct = True;
- char *fnames[2] = {"\\denytest2.dat", "\\denytest2.exe"};
+ const char *fnames[2] = {"\\denytest2.dat", "\\denytest2.exe"};
if (!torture_open_connection(&cli1) || !torture_open_connection(&cli2)) {
return False;
@@ -1515,7 +1515,7 @@ BOOL torture_denytest2(int dummy)
for (i=0; i<ARRAY_SIZE(denytable2); i++) {
enum deny_result res;
- char *fname = fnames[denytable2[i].isexe];
+ const char *fname = fnames[denytable2[i].isexe];
progress_bar(i, ARRAY_SIZE(denytable1));