summaryrefslogtreecommitdiff
path: root/source3/rpc_client
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/rpc_client
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/rpc_client')
-rw-r--r--source3/rpc_client/cli_pipe.c2
-rw-r--r--source3/rpc_client/cli_spoolss.c16
2 files changed, 9 insertions, 9 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 632dd30c3a..0b9f425bdc 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -1006,7 +1006,7 @@ int get_pipe_index( const char *pipe_name )
check the rpc bind acknowledge response
****************************************************************************/
-char* get_pipe_name_from_index( const int pipe_index )
+const char* get_pipe_name_from_index( const int pipe_index )
{
if ( (pipe_index < 0) || (pipe_index >= PI_MAX_PIPES) )
diff --git a/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 15a3db389e..0a168d93ba 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/rpc_client/cli_spoolss.c
@@ -275,8 +275,8 @@ static void decode_printerdriverdir_1 (TALLOC_CTX *mem_ctx, NEW_BUFFER *buffer,
********************************************************************************/
WERROR cli_spoolss_open_printer_ex(struct cli_state *cli, TALLOC_CTX *mem_ctx,
- char *printername, char *datatype, uint32 access_required,
- char *station, char *username, POLICY_HND *pol)
+ const char *printername, const char *datatype, uint32 access_required,
+ const char *station, const char *username, POLICY_HND *pol)
{
prs_struct qbuf, rbuf;
SPOOL_Q_OPEN_PRINTER_EX q;
@@ -720,7 +720,7 @@ WERROR cli_spoolss_getprinterdriver(struct cli_state *cli,
TALLOC_CTX *mem_ctx,
uint32 offered, uint32 *needed,
POLICY_HND *pol, uint32 level,
- char *env, PRINTER_DRIVER_CTR *ctr)
+ const char *env, PRINTER_DRIVER_CTR *ctr)
{
prs_struct qbuf, rbuf;
SPOOL_Q_GETPRINTERDRIVER2 q;
@@ -799,7 +799,7 @@ WERROR cli_spoolss_getprinterdriver(struct cli_state *cli,
WERROR cli_spoolss_enumprinterdrivers (struct cli_state *cli,
TALLOC_CTX *mem_ctx,
uint32 offered, uint32 *needed,
- uint32 level, char *env,
+ uint32 level, const char *env,
uint32 *num_drivers,
PRINTER_DRIVER_CTR *ctr)
{
@@ -1067,8 +1067,8 @@ WERROR cli_spoolss_addprinterex (struct cli_state *cli, TALLOC_CTX *mem_ctx,
* the driver files
*/
WERROR cli_spoolss_deleteprinterdriver (struct cli_state *cli,
- TALLOC_CTX *mem_ctx, char *arch,
- char *driver)
+ TALLOC_CTX *mem_ctx, const char *arch,
+ const char *driver)
{
prs_struct qbuf, rbuf;
SPOOL_Q_DELETEPRINTERDRIVER q;
@@ -2163,7 +2163,7 @@ WERROR cli_spoolss_enumprinterdata(struct cli_state *cli, TALLOC_CTX *mem_ctx,
WERROR cli_spoolss_enumprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ctx,
uint32 offered, uint32 *needed,
- POLICY_HND *hnd, char *keyname,
+ POLICY_HND *hnd, const char *keyname,
REGVAL_CTR *ctr)
{
prs_struct qbuf, rbuf;
@@ -2364,7 +2364,7 @@ WERROR cli_spoolss_deleteprinterdataex(struct cli_state *cli, TALLOC_CTX *mem_ct
WERROR cli_spoolss_enumprinterkey(struct cli_state *cli, TALLOC_CTX *mem_ctx,
uint32 offered, uint32 *needed,
- POLICY_HND *hnd, char *keyname,
+ POLICY_HND *hnd, const char *keyname,
uint16 **keylist, uint32 *len)
{
prs_struct qbuf, rbuf;