Fix warnings from Solaris Compiles of CVS 2_2

Richard Bollinger rabollinger at attbi.com
Wed May 15 13:25:02 GMT 2002


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 */

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

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

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

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

  /* We've been called again */

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

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

  ret = fill_grent(result, &gr_cache[ndx_gr_cache],
  ((char *)getgrent_response.extra_data)+mem_ofs,
- &buffer, &buflen);
+ &buffer, (int *)&buflen);

  /* Out of memory - try again */

@@ -1176,7 +1176,7 @@
  if (ret == NSS_STATUS_SUCCESS) {
  ret = fill_grent(result, &response.data.gr,
  response.extra_data,
- &buffer, &buflen);
+ &buffer, (int *)&buflen);

  if (ret == NSS_STATUS_TRYAGAIN) {
  keep_response = True;
@@ -1190,7 +1190,7 @@
  /* We've been called again */

  ret = fill_grent(result, &response.data.gr,
- response.extra_data, &buffer, &buflen);
+ response.extra_data, &buffer, (int *)&buflen);

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

  ret = fill_grent(result, &response.data.gr,
  response.extra_data,
- &buffer, &buflen);
+ &buffer, (int *)&buflen);

  if (ret == NSS_STATUS_TRYAGAIN) {
  keep_response = True;
@@ -1253,7 +1253,7 @@
  /* We've been called again */

  ret = fill_grent(result, &response.data.gr,
- response.extra_data, &buffer, &buflen);
+ response.extra_data, &buffer, (int *)&buflen);

  if (ret == NSS_STATUS_TRYAGAIN) {
  keep_response = True;
--- ../source/nsswitch/winbindd_cache.c Thu Apr  4 07:46:47 2002
+++ ./nsswitch/winbindd_cache.c Wed May 15 15:16:46 2002
@@ -275,7 +275,7 @@
  }

  centry = smb_xmalloc(sizeof(*centry));
- centry->data = data.dptr;
+ centry->data = (uchar *)data.dptr;
  centry->len = data.dsize;
  centry->ofs = 0;

@@ -389,7 +389,7 @@

  key.dptr = kstr;
  key.dsize = strlen(kstr);
- data.dptr = centry->data;
+ data.dptr = (char *)centry->data;
  data.dsize = centry->ofs;

  tdb_store(wcache->tdb, key, data, TDB_REPLACE);
@@ -416,7 +416,7 @@
  len = sid_size(sid);
  centry_expand(centry, len);
  centry_put_uint32(centry, type);
- sid_linearize(centry->data + centry->ofs, len, sid);
+ sid_linearize((char *)centry->data + centry->ofs, len, sid);
  centry->ofs += len;
  centry_end(centry, "NS/%s/%s", domain->name, name);
  centry_free(centry);
@@ -603,7 +603,7 @@
  centry = wcache_fetch(cache, domain, "NS/%s/%s", domain->name, name);
  if (!centry) goto do_query;
  *type = centry_uint32(centry);
- sid_parse(centry->data + centry->ofs, centry->len - centry->ofs, sid);
+ sid_parse((char *)centry->data + centry->ofs, centry->len - centry->ofs, sid);

  status = centry->status;
  centry_free(centry);
--- ../source/nsswitch/winbindd_util.c Fri Mar 22 07:16:47 2002
+++ ./nsswitch/winbindd_util.c Wed May 15 15:13:32 2002
@@ -151,7 +151,7 @@

  DEBUG(1, ("getting trusted domain list\n"));

- result = cache_methods.trusted_domains(domain, mem_ctx, &num_domains,
+ result = cache_methods.trusted_domains(domain, mem_ctx, (uint *)&num_domains,
         &names, &dom_sids);

  /* Add each domain to the trusted domain list */





More information about the samba-technical mailing list