Author: jra Date: 2005-09-13 06:32:42 +0000 (Tue, 13 Sep 2005) New Revision: 10196
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=10196 Log: Fix all const warnings. We compile without warnings now (ok, a few strange exceptions... - getdate.y for example). Jeremy. Modified: trunk/source/client/smbspool.c trunk/source/libsmb/libsmbclient.c trunk/source/modules/weird.c trunk/source/printing/notify.c trunk/source/utils/ntlm_auth.c trunk/source/utils/testparm.c Changeset: Modified: trunk/source/client/smbspool.c =================================================================== --- trunk/source/client/smbspool.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/client/smbspool.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -70,7 +70,10 @@ FILE *fp; /* File to print */ int status=0; /* Status of LPD job */ struct cli_state *cli; /* SMB interface */ + char null_str[0]; + null_str[0] = '\0'; + /* we expect the URI in argv[0]. Detect the case where it is in argv[1] and cope */ if (argc > 2 && strncmp(argv[0],"smb://", 6) && !strncmp(argv[1],"smb://", 6)) { argv++; @@ -158,12 +161,12 @@ if ((password = strchr_m(username, ':')) != NULL) *password++ = '\0'; else - password = ""; + password = null_str; } else { - username = ""; - password = ""; + username = null_str; + password = null_str; server = uri + 6; } Modified: trunk/source/libsmb/libsmbclient.c =================================================================== --- trunk/source/libsmb/libsmbclient.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/libsmb/libsmbclient.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -3057,7 +3057,7 @@ /* * We return the pointer here as the offset */ - ret_val = (off_t)dir->dir_next; + ret_val = (off_t)(long)dir->dir_next; return ret_val; } Modified: trunk/source/modules/weird.c =================================================================== --- trunk/source/modules/weird.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/modules/weird.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -23,7 +23,7 @@ static struct { char from; - char *to; + const char *to; int len; } weird_table[] = { {'q', "^q^", 3}, Modified: trunk/source/printing/notify.c =================================================================== --- trunk/source/printing/notify.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/printing/notify.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -328,7 +328,7 @@ static void send_notify_field_buffer(const char *sharename, uint32 type, uint32 field, uint32 id, uint32 len, - char *buffer) + const char *buffer) { struct spoolss_notify_msg *msg; @@ -349,7 +349,7 @@ msg->field = field; msg->id = id; msg->len = len; - msg->notify.data = buffer; + msg->notify.data = CONST_DISCARD(char *,buffer); send_spoolss_notify2_msg(msg); } @@ -484,7 +484,7 @@ snum, strlen(location) + 1, location); } -void notify_printer_byname( const char *printername, uint32 change, char *value ) +void notify_printer_byname( const char *printername, uint32 change, const char *value ) { int snum = print_queue_snum(printername); int type = PRINTER_NOTIFY_TYPE; Modified: trunk/source/utils/ntlm_auth.c =================================================================== --- trunk/source/utils/ntlm_auth.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/utils/ntlm_auth.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -1023,7 +1023,7 @@ DATA_BLOB null_blob = data_blob(NULL, 0); DATA_BLOB to_server; char *to_server_base64; - char *my_mechs[] = {OID_NTLMSSP, NULL}; + const char *my_mechs[] = {OID_NTLMSSP, NULL}; DEBUG(10, ("Got spnego negTokenInit with NTLMSSP\n")); @@ -1053,7 +1053,7 @@ } spnego.type = SPNEGO_NEG_TOKEN_INIT; - spnego.negTokenInit.mechTypes = my_mechs; + spnego.negTokenInit.mechTypes = CONST_DISCARD(char **,my_mechs); spnego.negTokenInit.reqFlags = 0; spnego.negTokenInit.mechListMIC = null_blob; Modified: trunk/source/utils/testparm.c =================================================================== --- trunk/source/utils/testparm.c 2005-09-13 05:39:00 UTC (rev 10195) +++ trunk/source/utils/testparm.c 2005-09-13 06:32:42 UTC (rev 10196) @@ -206,7 +206,7 @@ poptContext pc; static const char *term_code = ""; static char *parameter_name = NULL; - static char *section_name = NULL; + static const char *section_name = NULL; static char *new_local_machine = NULL; const char *cname; const char *caddr;