Re: Fix warnings from Solaris Compiles of CVS 2_2

2002-05-16 Thread Gerald Carter

On Wed, 15 May 2002, Richard Bollinger wrote:

> Here's the changes required to elimenate all of the compiler's warnings
> issued while compiling CVS 2_2 with cc: WorkShop Compilers 5.0 98/12/15
> C 5.0 on sparc-sun-solaris2.8.  Most of them seem reasonable; though
> someone might want to take a closer look.  The changes don't apparently
> affect generated code.

Thanks.  I'm testing these now.





cheers, jerry





Re: Fix warnings from Solaris Compiles of CVS 2_2

2002-05-15 Thread Gerald Carter

On Wed, 15 May 2002, Richard Bollinger wrote:

> Here's the changes required to elimenate all of the compiler's warnings
> issued while compiling CVS 2_2 with cc: WorkShop Compilers 5.0 98/12/15
> C 5.0 on sparc-sun-solaris2.8.  Most of them seem reasonable; though
> someone might want to take a closer look.  The changes don't apparently
> affect generated code.

Yeah.  I have been meaning to fix these. Thanks.  I'll take a look.
There just casts basically IIRC.








cheers, jerry
 -
 Hewlett-Packard http://www.hp.com
 SAMBA Team   http://www.samba.org
 --http://www.plainjoe.org
 "Sam's Teach Yourself Samba in 24 Hours" 2ed.  ISBN 0-672-32269-2
 --"I never saved anything for the swim back." Ethan Hawk in Gattaca--





Fix warnings from Solaris Compiles of CVS 2_2

2002-05-15 Thread Richard Bollinger

Here's the changes required to elimenate all of the compiler's warnings issued while 
compiling CVS
2_2 with
cc: WorkShop Compilers 5.0 98/12/15 C 5.0 on sparc-sun-solaris2.8.  Most of them seem 
reasonable;
though someone might want to take a closer look.  The changes don't apparently affect 
generated
code.

Rich Bollinger

--- ../source/rpc_client/cli_login.c Tue Mar 19 07:56:55 2002
+++ ./rpc_client/cli_login.c Wed May 15 15:00:07 2002
@@ -52,7 +52,7 @@
   / Long-term Session key **/

   /* calculate the session key */
-  cred_session_key(&clnt_chal, &srv_chal, (char *)mach_pwd, cli->sess_key);
+  cred_session_key(&clnt_chal, &srv_chal, (uchar *)mach_pwd, cli->sess_key);
   memset((char *)cli->sess_key+8, '\0', 8);

   /*** Authenticate 2 /
--- ../source/libsmb/cli_netlogon.c Thu Apr 18 07:46:04 2002
+++ ./libsmb/cli_netlogon.c Wed May 15 15:11:21 2002
@@ -443,7 +443,7 @@
   0, /* param_ctrl */
   0xdead, 0xbeef, /* LUID? */
   username, cli->clnt_name_slash,
-  cli->sess_key, lm_owf_user_pwd,
+  (char *)cli->sess_key, lm_owf_user_pwd,
   nt_owf_user_pwd);

 break;
@@ -455,8 +455,8 @@

 generate_random_buffer(chal, 8, False);

-SMBencrypt(password, chal, local_lm_response);
-SMBNTencrypt(password, chal, local_nt_response);
+SMBencrypt((const uchar *)password, chal, local_lm_response);
+SMBNTencrypt((const uchar *)password, chal, local_nt_response);

 init_id_info2(&ctr.auth.id2, lp_workgroup(),
   0, /* param_ctrl */
--- ../source/lib/kanji.c Tue Mar 19 07:48:55 2002
+++ ./lib/kanji.c Wed May 15 15:03:22 2002
@@ -1249,7 +1249,7 @@
 const unsigned char *sp;
 unsigned char *dp;

-sp = from;
+sp = (const uchar *)from;
 dp = (unsigned char*) cvtbuf;
 while (*sp && (((char *)dp)- cvtbuf < sizeof(cvtbuf)-7)) {
  if (is_kana(*sp)) {
@@ -1321,7 +1321,7 @@
 const unsigned char *sp;
 unsigned char *dp;

-sp = from;
+sp = (const uchar *)from;
 dp = (unsigned char*) cvtbuf;
 while (*sp && (((char *)dp) - cvtbuf < sizeof(cvtbuf)-4)) {
  if (*sp >= 0x80) {
--- ../source/lib/messages.c Wed Mar 27 07:17:40 2002
+++ ./lib/messages.c Wed May 15 14:42:07 2002
@@ -474,7 +474,7 @@
   lock the messaging tdb based on a string - this is used as a primitive form of mutex
   between smbd instances.
 */
-BOOL message_named_mutex(char *name, unsigned int timeout)
+BOOL message_named_mutex(const char *name, unsigned int timeout)
 {
  TDB_DATA key;
  int ret;
@@ -482,7 +482,7 @@
  if (!message_init())
  return False;

- key.dptr = name;
+ key.dptr = (char *)name;
  key.dsize = strlen(name)+1;

  if (timeout) {
--- ../source/smbd/oplock.c Fri Apr 19 07:16:33 2002
+++ ./smbd/oplock.c Wed May 15 15:07:36 2002
@@ -133,7 +133,7 @@
  * Read a loopback udp message.
  */
  msg_len = sys_recvfrom(oplock_sock, &buffer[OPBRK_CMD_HEADER_LEN],
- buffer_len - OPBRK_CMD_HEADER_LEN, 0, (struct sockaddr *)&from, &fromlen);
+ buffer_len - OPBRK_CMD_HEADER_LEN, 0, (struct sockaddr *)&from, (uint *)&fromlen);

  if(msg_len < 0) {
  DEBUG(0,("receive_local_message. Error in recvfrom. (%s).\n",strerror(errno)));
--- ../source/libsmb/smbencrypt.c Fri Mar 22 07:16:33 2002
+++ ./libsmb/smbencrypt.c Wed May 15 14:53:18 2002
@@ -59,7 +59,7 @@
  int16 wpwd[129];

  /* Password cannot be longer than 128 characters */
- len = strlen(passwd);
+ len = strlen((const char *)passwd);
  if(len > 128)
  len = 128;
  /* Password must be converted to NT unicode - null terminated. */
--- ../source/rpc_server/srv_netlog_nt.c Thu Mar 28 07:46:34 2002
+++ ./rpc_server/srv_netlog_nt.c Wed May 15 14:56:29 2002
@@ -223,7 +223,7 @@

  /* from client / server challenges and md4 password, generate sess key */
  cred_session_key(&p->dc.clnt_chal, &p->dc.srv_chal,
- (char *)p->dc.md4pw, p->dc.sess_key);
+ (uchar *)p->dc.md4pw, p->dc.sess_key);

  /* Save the machine account name. */
  fstrcpy(p->dc.mach_acct, mach_acct);
--- ../source/rpc_server/srv_spoolss_nt.c Fri May 10 07:16:53 2002
+++ ./rpc_server/srv_spoolss_nt.c Wed May 15 15:41:30 2002
@@ -7960,6 +7960,5 @@
  return WERR_UNKNOWN_LEVEL;
  }

- return WERR_ACCESS_DENIED;
 }

--- ../source/nsswitch/winbind_nss.c Mon May 13 07:16:12 2002
+++ ./nsswitch/winbind_nss.c Wed May 15 15:21:37 2002
@@ -867,7 +867,7 @@
  }

  ret = fill_pwent(result, &pw_cache[ndx_pw_cache],
- &buffer, &buflen);
+ &buffer, (int *)&buflen);

  /* Out of memory - try again */

@@ -917,7 +917,7 @@

  if (ret == NSS_STATUS_SUCCESS) {
  ret = fill_pwent(result, &response.data.pw,
- &buffer, &buflen);
+ &buffer, (int *)&buflen);

  if (ret == NSS_STATUS_TRYAGAIN) {
  keep_response = True;
@@ -930,7 +930,7 @@

  /* We've been called again */

- r