SV: [CIRCLE] [Circle] Bpl17 warnings when compiling

From: Jan Pedersen (superjan@get2net.dk)
Date: 12/13/00


-----Oprindelig meddelelse-----
Fra: Circle Discussion List [mailto:CIRCLE@POST.QUEENSU.CA]På vegne af
Jan Pedersen
Sendt: 13. december 2000 13:52
Til: CIRCLE@POST.QUEENSU.CA
Emne: [CIRCLE] [Circle] Bpl17 warnings when compiling


Hello all

I downloaded the circle30bpl17 and compiled it but it came up with 3
warnings:

Act.wizard.c<2920> Warning C4033: 'perform set' must return a value.
It was 2930 not 2990 as i wrote first time
Act.wizard.c<2930> Warning C4033: 'perform set' must return a value.

  case 52:
    if (GET_LEVEL(ch) < LVL_LOVIMP)
    {
    i = parse_race(*val_arg);
    if (i == RACE_UNDEFINED)
    {
     send_to_char("That is not a race.\r\n", ch);
     return;  <----THIS IS LINE 2920
    }
    GET_RACE(vict) = i;
    break;
    }
   else
    {
     if ((i = parse_race_impl(*val_arg)) == RACE_UNDEFINED)
     {
     send_to_char("That is not a race.\r\n", ch);
     return;    <-----THIS IS LINE 2930
    }
    GET_RACE(vict) = i;
    break;
}



Comm.c<1204> Warning C4028: format parameter 1 different from declaration.
int new_descriptor(int s)
{       <-----THIS IS LINE 1204
  socket_t desc;
  int sockets_connected = 0;
  socklen_t i;
  static int last_desc = 0;     /* last descriptor number */
  struct descriptor_data *newd;
  struct sockaddr_in peer;
  struct hostent *from;

  /* accept the new connection */
  i = sizeof(peer);
  if ((desc = accept(s, (struct sockaddr *) &peer, &i)) == INVALID_SOCKET) {
    perror("SYSERR: accept");
    return (-1);
  }
  /* keep it from blocking */
  nonblock(desc);

  /* set the send buffer size */
  if (set_sendbuf(desc) < 0) {
    CLOSE_SOCKET(desc);
    return (0);
  }

  /* make sure we have room for it */
  for (newd = descriptor_list; newd; newd = newd->next)
    sockets_connected++;

  if (sockets_connected >= max_players) {
    write_to_descriptor(desc, "Sorry, CircleMUD is full right now... please
try again later!\r\n");
    CLOSE_SOCKET(desc);
    return (0);
  }
  /* create a new descriptor */
  CREATE(newd, struct descriptor_data, 1);
  memset((char *) newd, 0, sizeof(struct descriptor_data));

  /* find the sitename */
  if (nameserver_is_slow || !(from = gethostbyaddr((char *) &peer.sin_addr,
                                      sizeof(peer.sin_addr), AF_INET))) {

    /* resolution failed */
    if (!nameserver_is_slow)
      perror("SYSERR: gethostbyaddr");

    /* find the numeric site address */
    strncpy(newd->host, (char *)inet_ntoa(peer.sin_addr), HOST_LENGTH);
    *(newd->host + HOST_LENGTH) = '\0';
  } else {
    strncpy(newd->host, from->h_name, HOST_LENGTH);
    *(newd->host + HOST_LENGTH) = '\0';
  }

  /* determine if the site is banned */
  if (isbanned(newd->host) == BAN_ALL) {
    CLOSE_SOCKET(desc);
    sprintf(buf2, "Connection attempt denied from [%s]", newd->host);
    mudlog(buf2, CMP, LVL_GOD, TRUE);
    free(newd);
    return (0);
  }
#if 0
  /*
   * Log new connections - probably unnecessary, but you may want it.
   * Note that your immortals may wonder if they see a connection from
   * your site, but you are wizinvis upon login.
   */
  sprintf(buf2, "New connection from [%s]", newd->host);
  mudlog(buf2, CMP, LVL_GOD, FALSE);
#endif

  /* initialize descriptor data */
  newd->descriptor = desc;
  newd->idle_tics = 0;
  newd->output = newd->small_outbuf;
  newd->bufspace = SMALL_BUFSIZE - 1;
  newd->login_time = time(0);
  *newd->output = '\0';
  newd->bufptr = 0;
  newd->has_prompt = 1;  /* prompt is part of greetings */
  STATE(newd) = CON_GET_NAME;

-Jan

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 04/11/01 PDT