Changeset a009d94 in rtems


Ignore:
Timestamp:
Aug 31, 2006, 1:10:02 AM (13 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, master
Children:
ddee935
Parents:
ae5a79c3
Message:

2006-08-30 Joel Sherrill <joel@…>

  • ftpd/ftpd.c, libcsupport/include/sys/ioccom.h, libcsupport/src/ioctl.c, libnetworking/kern/uipc_mbuf.c, libnetworking/libc/inet_addr.c, libnetworking/net/ethernet.h, libnetworking/net/if.c, libnetworking/net/if_ethersubr.c, libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h, libnetworking/net/if_var.h, libnetworking/net/ppp_tty.c, libnetworking/netinet/in_cksum.c, libnetworking/nfs/bootp_subr.c, libnetworking/rtems/rtems_bsdnet_internal.h, libnetworking/sys/mbuf.h, pppd/md4.c, pppd/pppd.h: Remove warnings due to improper use of int which shows up on 16 bit targets. Added ioctl_command_t since IOCTL command argument does not reliably fit into 16 bits.
Location:
cpukit
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • cpukit/ChangeLog

    rae5a79c3 ra009d94  
     12006-08-30      Joel Sherrill <joel@OARcorp.com>
     2
     3        * ftpd/ftpd.c, libcsupport/include/sys/ioccom.h,
     4        libcsupport/src/ioctl.c, libnetworking/kern/uipc_mbuf.c,
     5        libnetworking/libc/inet_addr.c, libnetworking/net/ethernet.h,
     6        libnetworking/net/if.c, libnetworking/net/if_ethersubr.c,
     7        libnetworking/net/if_ppp.c, libnetworking/net/if_pppvar.h,
     8        libnetworking/net/if_var.h, libnetworking/net/ppp_tty.c,
     9        libnetworking/netinet/in_cksum.c, libnetworking/nfs/bootp_subr.c,
     10        libnetworking/rtems/rtems_bsdnet_internal.h,
     11        libnetworking/sys/mbuf.h, pppd/md4.c, pppd/pppd.h: Remove warnings
     12        due to improper use of int which shows up on 16 bit targets. Added
     13        ioctl_command_t since IOCTL command argument does not reliably fit
     14        into 16 bits.
     15
    1162006-08-30      Joel Sherrill <joel@OARcorp.com>
    217
  • cpukit/ftpd/ftpd.c

    rae5a79c3 ra009d94  
    11931193      time_t tf = stat_buf.st_mtime;
    11941194      enum { SIZE = 80 };
    1195       enum { SIX_MONTHS = 365*24*60*60/2 };
     1195      uint32_t SIX_MONTHS = (365L*24L*60L*60L)/2L;
    11961196      char timeBuf[SIZE];
    11971197      gmtime_r(&tf, &bt);
  • cpukit/libcsupport/include/sys/ioccom.h

    rae5a79c3 ra009d94  
    9191#include <sys/cdefs.h>
    9292
     93#ifndef __ioctl_command_defined
     94typedef u_int32_t ioctl_command_t;
     95#define __ioctl_command_defined
     96#endif
     97
    9398__BEGIN_DECLS
    94 int     ioctl(int, int, ...);
     99int     ioctl(int, ioctl_command_t, ...);
    95100__END_DECLS
    96101
  • cpukit/libcsupport/src/ioctl.c

    rae5a79c3 ra009d94  
    2828int ioctl(
    2929  int  fd,
    30   int  command,
     30  ioctl_command_t  command,
    3131  ...
    3232)
  • cpukit/libnetworking/kern/uipc_mbuf.c

    rae5a79c3 ra009d94  
    222222
    223223struct mbuf *
    224 m_copym(struct mbuf *m, int off0, int len, int wait)
     224m_copym(struct mbuf *m, int off0, uint32_t len, int wait)
    225225{
    226226        struct mbuf *n, **np;
  • cpukit/libnetworking/libc/inet_addr.c

    rae5a79c3 ra009d94  
    9494        register int base, n;
    9595        register char c;
    96         u_int parts[4];
    97         register u_int *pp = parts;
     96        uint32_t parts[4];
     97        register uint32_t *pp = parts;
    9898
    9999        c = *cp;
  • cpukit/libnetworking/net/ethernet.h

    rae5a79c3 ra009d94  
    361361extern  void ether_ifattach(struct ifnet *);
    362362extern  void ether_ifdetach(struct ifnet *);
    363 extern  int  ether_ioctl(struct ifnet *, int32_t, caddr_t);
     363extern  int  ether_ioctl(struct ifnet *, ioctl_command_t, caddr_t);
    364364extern  void    ether_input (struct ifnet *, struct ether_header *, struct mbuf *);
    365365extern  int  ether_output(struct ifnet *,
  • cpukit/libnetworking/net/if.c

    rae5a79c3 ra009d94  
    560560                 * header (40) + the minimum mss (32).
    561561                 */
    562                 if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535)
     562                if (ifr->ifr_mtu < 72 || ifr->ifr_mtu > 65535L)
    563563                        return (EINVAL);
    564564                error = (*ifp->if_ioctl)(ifp, cmd, data);
  • cpukit/libnetworking/net/if_ethersubr.c

    rae5a79c3 ra009d94  
    826826
    827827int
    828 ether_ioctl(struct ifnet *ifp, int32_t command, caddr_t data)
     828ether_ioctl(struct ifnet *ifp, ioctl_command_t command, caddr_t data)
    829829{
    830830        struct ifaddr *ifa = (struct ifaddr *) data;
  • cpukit/libnetworking/net/if_ppp.c

    rae5a79c3 ra009d94  
    133133#endif
    134134
    135 static int      pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data);
     135static int      pppsioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data);
    136136static void     ppp_requeue(struct ppp_softc *);
    137137#ifdef PPP_COMPRESS
     
    620620pppioctl(sc, cmd, data, flag, p)
    621621    struct ppp_softc *sc;
    622     int32_t cmd;
     622    ioctl_command_t cmd;
    623623    caddr_t data;
    624624    int flag;
     
    839839 */
    840840static int
    841 pppsioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
     841pppsioctl(struct ifnet *ifp, ioctl_command_t cmd, caddr_t data)
    842842{
    843843    /*struct proc *p = curproc;*/       /* XXX */
  • cpukit/libnetworking/net/if_pppvar.h

    rae5a79c3 ra009d94  
    119119int     pppoutput(struct ifnet *, struct mbuf *,
    120120                       struct sockaddr *, struct rtentry *);
    121 int     pppioctl(struct ppp_softc *sc, int32_t cmd, caddr_t data,
     121int     pppioctl(struct ppp_softc *sc, ioctl_command_t cmd, caddr_t data,
    122122                      int flag, struct proc *p);
    123123struct  mbuf *ppp_dequeue(struct ppp_softc *sc);
  • cpukit/libnetworking/net/if_var.h

    rae5a79c3 ra009d94  
    117117                (struct ifnet *);
    118118        int     (*if_ioctl)             /* ioctl routine */
    119                 (struct ifnet *, u_long, caddr_t);
     119                (struct ifnet *, ioctl_command_t, caddr_t);
    120120        void    (*if_watchdog)          /* timer routine */
    121121                (struct ifnet *);
  • cpukit/libnetworking/net/ppp_tty.c

    rae5a79c3 ra009d94  
    428428/*    int                 i;    */
    429429    int                 error = RTEMS_SUCCESSFUL;
    430     int32_t             cmd   = args->command;
     430    ioctl_command_t     cmd   = args->command;
    431431    caddr_t             data  = args->buffer;
    432432    struct ppp_softc   *sc    = tty->t_sc;
  • cpukit/libnetworking/netinet/in_cksum.c

    rae5a79c3 ra009d94  
    6969 */
    7070
    71 #define ADDCARRY(x)  (x > 65535 ? x -= 65535 : x)
     71#define ADDCARRY(x)  (x > 65535L ? x -= 65535L : x)
    7272#define REDUCE \
    7373  {l_util.l = sum; sum = l_util.s[0] + l_util.s[1];  ADDCARRY(sum);}
     
    7676in_cksum(m, len)
    7777        register struct mbuf *m;
    78         register int len;
     78        register uint32_t len;
    7979{
    8080        register u_short *w;
    81         register int sum = 0;
    82         register int mlen = 0;
     81        register uint32_t sum = 0;
     82        register uint32_t mlen = 0;
    8383        int byte_swapped = 0;
    8484
  • cpukit/libnetworking/nfs/bootp_subr.c

    rae5a79c3 ra009d94  
    7272#include <rtems/rtems_bsdnet.h>
    7373#include <rtems/bsdnet/servers.h>
     74#include <inttypes.h>
    7475
    7576#define BOOTP_MIN_LEN           300     /* Minimum size of bootp udp packet */
     
    707708static void printip(char *prefix,struct in_addr addr)
    708709{
    709   unsigned int ip;
     710  uint32_t ip;
    710711
    711712  ip = ntohl(addr.s_addr);
    712713
    713   printf("%s is %d.%d.%d.%d\n",prefix,
    714          ip >> 24, (ip >> 16) & 255 ,(ip >> 8) & 255 ,ip & 255 );
     714  printf("%s is %" PRId32" .%" PRId32" .%" PRId32" .%" PRId32" \n",prefix,
     715         ip >> 24, (ip >> 16) & 0xff ,(ip >> 8) & 0xff ,ip & 0xff );
    715716}
    716717
  • cpukit/libnetworking/rtems/rtems_bsdnet_internal.h

    rae5a79c3 ra009d94  
    1919typedef unsigned int            vm_pindex_t;
    2020typedef unsigned int            vm_size_t;
     21
     22#ifndef __ioctl_command_defined
     23typedef u_int32_t ioctl_command_t;
     24#define __ioctl_command_defined
     25#endif
     26
    2127
    2228#define _BSD_OFF_T_     int32_t
     
    174180void bootpc_init(int );
    175181int socket (int, int, int);
    176 int ioctl (int, int, ...);
     182int ioctl (int, ioctl_command_t, ...);
    177183
    178184/*
     
    184190#define SBWAIT_EVENT   RTEMS_EVENT_24
    185191#define SOSLEEP_EVENT  RTEMS_EVENT_25
    186 #define NETISR_IP_EVENT                (1 << NETISR_IP)
    187 #define NETISR_ARP_EVENT       (1 << NETISR_ARP)
     192#define NETISR_IP_EVENT        (1L << NETISR_IP)
     193#define NETISR_ARP_EVENT       (1L << NETISR_ARP)
    188194#define NETISR_EVENTS  (NETISR_IP_EVENT|NETISR_ARP_EVENT)
    189195#if (SBWAIT_EVENT & SOSLEEP_EVENT & NETISR_EVENTS)
  • cpukit/libnetworking/sys/mbuf.h

    rae5a79c3 ra009d94  
    396396
    397397/* Length to m_copy to copy all. */
    398 #define M_COPYALL       1000000000
     398#define M_COPYALL       (uint32_t)1000000000L
    399399
    400400/* Compatibility with 4.3. */
     
    414414extern int      max_datalen;            /* MHLEN - max_hdr */
    415415
    416 struct  mbuf *m_copym(struct mbuf *, int, int, int);
     416struct  mbuf *m_copym(struct mbuf *, int, uint32_t, int);
    417417struct  mbuf *m_copypacket(struct mbuf *, int);
    418418struct  mbuf *m_devget(char *, int, int, struct ifnet *,
  • cpukit/pppd/md4.c

    rae5a79c3 ra009d94  
    125125unsigned char *Xb;
    126126{
    127   register unsigned int tmp, A, B, C, D;
    128   unsigned int X[16];
     127  register uint32_t tmp, A, B, C, D;
     128  uint32_t X[16];
    129129  int i;
    130130
  • cpukit/pppd/pppd.h

    rae5a79c3 ra009d94  
    7575        void    *addr;
    7676        char    *description;
    77         int     flags;
     77        uint32_t flags;
    7878        void    *addr2;
    7979        int     upper_limit;
     
    8282
    8383/* Values for flags */
    84 #define OPT_VALUE       0xff    /* mask for presupplied value */
    85 #define OPT_HEX         0x100   /* int option is in hex */
    86 #define OPT_NOARG       0x200   /* option doesn't take argument */
    87 #define OPT_OR          0x400   /* OR in argument to value */
    88 #define OPT_INC         0x800   /* increment value */
    89 #define OPT_PRIV        0x1000  /* privileged option */
    90 #define OPT_STATIC      0x2000  /* string option goes into static array */
    91 #define OPT_LLIMIT      0x4000  /* check value against lower limit */
    92 #define OPT_ULIMIT      0x8000  /* check value against upper limit */
     84#define OPT_VALUE       0xffL   /* mask for presupplied value */
     85#define OPT_HEX         0x100L  /* int option is in hex */
     86#define OPT_NOARG       0x200L  /* option doesn't take argument */
     87#define OPT_OR          0x400L  /* OR in argument to value */
     88#define OPT_INC         0x800L  /* increment value */
     89#define OPT_PRIV        0x1000L /* privileged option */
     90#define OPT_STATIC      0x2000L /* string option goes into static array */
     91#define OPT_LLIMIT      0x4000L /* check value against lower limit */
     92#define OPT_ULIMIT      0x8000L /* check value against upper limit */
    9393#define OPT_LIMITS      (OPT_LLIMIT|OPT_ULIMIT)
    94 #define OPT_ZEROOK      0x10000 /* 0 value is OK even if not within limits */
    95 #define OPT_NOINCR      0x20000 /* value mustn't be increased */
    96 #define OPT_ZEROINF     0x40000 /* with OPT_NOINCR, 0 == infinity */
    97 #define OPT_A2INFO      0x100000 /* addr2 -> option_info to update */
    98 #define OPT_A2COPY      0x200000 /* addr2 -> second location to rcv value */
    99 #define OPT_ENABLE      0x400000 /* use *addr2 as enable for option */
    100 #define OPT_PRIVFIX     0x800000 /* can't be overridden if noauth */
    101 #define OPT_PREPASS     0x1000000 /* do this opt in pre-pass to find device */
    102 #define OPT_INITONLY    0x2000000 /* option can only be set in init phase */
    103 #define OPT_DEVEQUIV    0x4000000 /* equiv to device name */
     94#define OPT_ZEROOK      0x10000L        /* 0 value is OK even if not within limits */
     95#define OPT_NOINCR      0x20000L        /* value mustn't be increased */
     96#define OPT_ZEROINF     0x40000L        /* with OPT_NOINCR, 0 == infinity */
     97#define OPT_A2INFO      0x100000L /* addr2 -> option_info to update */
     98#define OPT_A2COPY      0x200000L /* addr2 -> second location to rcv value */
     99#define OPT_ENABLE      0x400000L /* use *addr2 as enable for option */
     100#define OPT_PRIVFIX     0x800000L /* can't be overridden if noauth */
     101#define OPT_PREPASS     0x1000000L /* do this opt in pre-pass to find device */
     102#define OPT_INITONLY    0x2000000L /* option can only be set in init phase */
     103#define OPT_DEVEQUIV    0x4000000L /* equiv to device name */
    104104#define OPT_DEVNAM      (OPT_PREPASS | OPT_INITONLY | OPT_DEVEQUIV)
    105105
Note: See TracChangeset for help on using the changeset viewer.