Ignore:
Timestamp:
Mar 2, 2008, 12:29:06 AM (15 years ago)
Author:
Sam Hocevar
Message:
  • Fix almost 2,000 warnings by using proper "const" keywords where needed.
Location:
abuse/trunk/src/net
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/net/fileman.cpp

    r17 r39  
    269269
    270270
    271 void file_manager::remote_file::r_close(char *reason)
     271void file_manager::remote_file::r_close(char const *reason)
    272272{
    273273//  if (reason) fprintf(stderr,"remote_file : %s\n",reason);
     
    281281}
    282282
    283 file_manager::remote_file::remote_file(net_socket *sock, char *filename, char *mode, remote_file *Next) : sock(sock)
     283file_manager::remote_file::remote_file(net_socket *sock, char const *filename, char const *mode, remote_file *Next) : sock(sock)
    284284{
    285285  next=Next;
     
    382382{ r_close(NULL); }
    383383
    384 int file_manager::rf_open_file(char *&filename, char *mode)
     384int file_manager::rf_open_file(char const *&filename, char const *mode)
    385385{
    386386  net_address *fs_server_addr=NULL;
  • abuse/trunk/src/net/gserver.cpp

    r17 r39  
    88#include "jwindow.hpp"
    99#include "input.hpp"
     10#include "dev.hpp"
    1011
    1112extern base_memory_struct *base;
     
    1617extern join_struct *join_array;
    1718extern window_manager *eh;
    18 extern char *symbol_str(char *name);
    1919extern void service_net_request();
    2020
  • abuse/trunk/src/net/include/fileman.hpp

    r17 r39  
    3232    public :
    3333    net_socket *sock;
    34     void r_close(char *reason);
     34    void r_close(char const *reason);
    3535    int32_t size;   // server tells us the size of the file when we open it
    3636    int open_local;
    3737    remote_file *next;
    38     remote_file(net_socket *sock, char *filename, char *mode, remote_file *Next);
     38    remote_file(net_socket *sock, char const *filename, char const *mode, remote_file *Next);
    3939
    4040    int unbuffered_read(void *buffer, size_t count);
    41     int unbuffered_write(void *buf, size_t count) { return 0; } // not supported
     41    int unbuffered_write(void const *buf, size_t count) { return 0; } // not supported
    4242    int32_t unbuffered_tell();
    4343    int32_t unbuffered_seek(int32_t offset);
     
    6363
    6464
    65   int rf_open_file(char *&filename, char *mode);
     65  int rf_open_file(char const *&filename, char const *mode);
    6666  int32_t rf_tell(int fd);
    6767  int32_t rf_seek(int fd, int32_t offset);
  • abuse/trunk/src/net/include/sock.hpp

    r5 r39  
    2929  virtual int ready_to_read()                                      = 0;
    3030  virtual int ready_to_write()                                     = 0;
    31   virtual int write(void *buf, int size, net_address *addr=0)   = 0;
     31  virtual int write(void const *buf, int size, net_address *addr=0)   = 0;
    3232  virtual int read(void *buf, int size, net_address **addr=0)      = 0;
    3333  virtual int get_fd()                                             = 0;
     
    6666
    6767  virtual net_address *get_local_address() = 0;
    68   virtual net_address *get_node_address(char *&server_name, int def_port, int force_port) = 0;
     68  virtual net_address *get_node_address(char const *&server_name, int def_port, int force_port) = 0;
    6969  virtual net_socket *connect_to_server(net_address *addr,
    7070                                        net_socket::socket_type sock_type=net_socket::SOCKET_SECURE) =0;
    7171  virtual net_socket *create_listen_socket(int port, net_socket::socket_type sock_type) = 0;
    7272  virtual int installed() = 0;
    73   virtual char *name() = 0;
     73  virtual char const *name() = 0;
    7474  virtual int select(int block) = 0;          // return # of sockets available for read & writing
    7575  virtual void cleanup() { ; }                // should do any needed pre-exit cleanup stuff
    76   net_socket *connect_to_server(char *&server_name, int port, int force_port=0,
     76  net_socket *connect_to_server(char const *&server_name, int port, int force_port=0,
    7777                                net_socket::socket_type sock_type=net_socket::SOCKET_SECURE);
    7878
  • abuse/trunk/src/net/include/tcpip.hpp

    r4 r39  
    101101  tcpip_protocol();
    102102  net_address *get_local_address();
    103   net_address *get_node_address(char *&server_name, int def_port, int force_port);
     103  net_address *get_node_address(char const *&server_name, int def_port, int force_port);
    104104  net_socket *connect_to_server(net_address *addr,
    105105        net_socket::socket_type sock_type=net_socket::SOCKET_SECURE);
    106106  net_socket *create_listen_socket(int port, net_socket::socket_type sock_type);
    107107  int installed() { return 1; }  // always part of unix
    108   char *name() { return "UNIX generic TCPIP"; }
     108  char const *name() { return "UNIX generic TCPIP"; }
    109109  void cleanup();
    110110  int select(int block);          // return # of sockets available for read & writing
     
    139139    return FD_ISSET(fd,&write_check);
    140140  }
    141   virtual int write(void *buf, int size, net_address *addr=NULL);
     141  virtual int write(void const *buf, int size, net_address *addr=NULL);
    142142  virtual int read(void *buf, int size, net_address **addr);
    143143
     
    212212    return tr;
    213213  }
    214   virtual int write(void *buf, int size, net_address *addr=NULL)
     214  virtual int write(void const *buf, int size, net_address *addr=NULL)
    215215  {
    216216    if (addr)
  • abuse/trunk/src/net/sock.cpp

    r2 r39  
    1212// in sub-classes
    1313
    14 net_socket *net_protocol::connect_to_server(char *&server_name, int port, int force_port, net_socket::socket_type sock_type)
     14net_socket *net_protocol::connect_to_server(char const *&server_name, int port, int force_port, net_socket::socket_type sock_type)
    1515{
    1616  net_address *a=get_node_address(server_name,port,force_port);
  • abuse/trunk/src/net/tcpip.cpp

    r4 r39  
    6060//}}}///////////////////////////////////
    6161
    62 int unix_fd::write(void *buf, int size, net_address *addr)
     62int unix_fd::write(void const *buf, int size, net_address *addr)
    6363//{{{
    6464{
     
    120120        } 
    121121
    122   char tmp[4],*np;
    123         sockaddr_in host;
     122  char tmp[4];
     123  char const *np;
     124  sockaddr_in host;
    124125 
    125126  np = my_name;
     
    150151//}}}///////////////////////////////////
    151152
    152 net_address *tcpip_protocol::get_node_address(char *&server_name,
     153net_address *tcpip_protocol::get_node_address(char const *&server_name,
    153154                                                                                                                                                                                        int def_port, int force_port)
    154155//{{{
    155156{
    156   sockaddr_in host;
    157 
    158         if (server_name[0]>='0' && server_name[0]<='9')
    159         {
    160           char tmp[4],*np;
     157    sockaddr_in host;
     158
     159    if (server_name[0]>='0' && server_name[0]<='9')
     160    {
     161        char tmp[4];
     162        char const *np;
    161163         
    162164          np = server_name;
     
    193195        else
    194196        {
    195           char name[256],*np;
     197          char name[256], *np;
    196198
    197199          np=name;
Note: See TracChangeset for help on using the changeset viewer.