Ignore:
Timestamp:
Nov 10, 2005, 9:41:13 PM (17 years ago)
Author:
Sam Hocevar
Message:
  • absolute shitloads of 64 bit fixes.
Location:
abuse/trunk/src/net/include
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/net/include/endian.hpp

    r2 r17  
    1919
    2020#ifdef BIGUNS
    21 #define swap_short(x) (((((unsigned short) (x)))<<8)|((((unsigned short) (x)))>>8))
    22 #define swap_long(x) \
    23    ((( ((unsigned long)(x)) )>>24)|((( ((unsigned long)(x)) )&0x00ff0000)>>8)| \
    24    ((( ((unsigned long)(x)) )&0x0000ff00)<<8)|(( ((unsigned long)(x)) )<<24))
     21#define swap_uint16(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8))
     22#define swap_uint32(x) \
     23   ((( ((uint32_t)(x)) )>>24)|((( ((uint32_t)(x)) )&0x00ff0000)>>8)| \
     24   ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24))
    2525#else
    26 #define swap_short(x) (x)
    27 #define swap_long(x) (x)
     26#define swap_uint16(x) (x)
     27#define swap_uint32(x) (x)
    2828
    2929#endif
    30 
    31 #define uchar unsigned char
    3230
    3331#endif
  • abuse/trunk/src/net/include/fileman.hpp

    r4 r17  
    2020
    2121    nfs_client *next;
    22     long size_to_read; 
    23     long size;
     22    int32_t size_to_read; 
     23    int32_t size;
    2424    nfs_client(net_socket *sock, int file_fd, nfs_client *next);
    2525    int send_read();     // flushes as much of size_to_read as possible
     
    3333    net_socket *sock;
    3434    void r_close(char *reason);
    35     long size;   // server tells us the size of the file when we open it
     35    int32_t size;   // server tells us the size of the file when we open it
    3636    int open_local;
    3737    remote_file *next;
     
    4040    int unbuffered_read(void *buffer, size_t count);
    4141    int unbuffered_write(void *buf, size_t count) { return 0; } // not supported
    42     long unbuffered_tell();
    43     long unbuffered_seek(long offset);
    44     long file_size() { return size; }
     42    int32_t unbuffered_tell();
     43    int32_t unbuffered_seek(int32_t offset);
     44    int32_t file_size() { return size; }
    4545    int open_failure() { return sock==NULL; }   
    4646    ~remote_file();
     
    6464
    6565  int rf_open_file(char *&filename, char *mode);
    66   long rf_tell(int fd);
    67   long rf_seek(int fd, long offset);
     66  int32_t rf_tell(int fd);
     67  int32_t rf_seek(int fd, int32_t offset);
    6868  int rf_read(int fd, void *buffer, size_t count);
    6969  int rf_close(int fd);
    70   long rf_file_size(int fd);
     70  int32_t rf_file_size(int fd);
    7171  void set_default_fs(net_address *def) { default_fs=def->copy(); }
    7272  ~file_manager() { if (default_fs) delete default_fs; }
  • abuse/trunk/src/net/include/indian.hpp

    r2 r17  
    1010
    1111#ifdef BIGUNS
    12 #define lstl(x) (((((unsigned short) (x)))<<8)|((((unsigned short) (x)))>>8))
     12#define lstl(x) (((((uint16_t) (x)))<<8)|((((uint16_t) (x)))>>8))
    1313#define lltl(x) \
    14    ((( ((unsigned long)(x)) )>>24)|((( ((unsigned long)(x)) )&0x00ff0000)>>8)| \
    15    ((( ((unsigned long)(x)) )&0x0000ff00)<<8)|(( ((unsigned long)(x)) )<<24))
     14   ((( ((uint32_t)(x)) )>>24)|((( ((uint32_t)(x)) )&0x00ff0000)>>8)| \
     15   ((( ((uint32_t)(x)) )&0x0000ff00)<<8)|(( ((uint32_t)(x)) )<<24))
    1616#else
    1717#define lstl(x) (x)
     
    1919
    2020#endif
    21 
    22 #define uchar unsigned char
    2321
    2422#endif
  • abuse/trunk/src/net/include/ipx.hpp

    r2 r17  
    141141    void add_to_packet(void *buf, int size);
    142142
    143     void write_byte(unsigned char x) { add_to_packet(&x,1); }
    144     void write_short(unsigned short x) { x=lstl(x); add_to_packet(&x,2); }
    145     void write_long(unsigned long x) { x=lltl(x); add_to_packet(&x,4); }
     143    void write_uint8(uint8_t x) { add_to_packet(&x,1); }
     144    void write_uint16(uint16_t x) { x=lstl(x); add_to_packet(&x,2); }
     145    void write_uint32(uint32_t x) { x=lltl(x); add_to_packet(&x,4); }
    146146
    147147
Note: See TracChangeset for help on using the changeset viewer.